From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7VqY-0000L8-KG for qemu-devel@nongnu.org; Fri, 31 Aug 2012 14:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7VqX-0003Tf-GA for qemu-devel@nongnu.org; Fri, 31 Aug 2012 14:21:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7VqX-0003TZ-7z for qemu-devel@nongnu.org; Fri, 31 Aug 2012 14:21:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7VILUtQ013635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 31 Aug 2012 14:21:32 -0400 Message-ID: <5040F4B9.50509@redhat.com> Date: Fri, 31 Aug 2012 10:30:33 -0700 From: Eric Blake MIME-Version: 1.0 References: <1346434010-14801-1-git-send-email-berrange@redhat.com> In-Reply-To: <1346434010-14801-1-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5AD99EA144E54B7B2F4408EA" Subject: Re: [Qemu-devel] [PATCH] Don't require encryption password for 'qemu-img info' command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5AD99EA144E54B7B2F4408EA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/31/2012 10:26 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" >=20 > The encryption password is only required if I/O is going to be > performed on a disk image. The 'qemu-img info' command merely > reports metadata, so it should not ask for a decryption password >=20 > Signed-off-by: Daniel P. Berrange > --- > qemu-img.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index b41e670..3dd4ec7 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -221,7 +221,8 @@ static int print_block_option_help(const char *file= name, const char *fmt) > =20 > static BlockDriverState *bdrv_new_open(const char *filename, > const char *fmt, > - int flags) > + int flags, > + int requireIO) Since you only pass 0 or 1 for requireIO, why not make it bool? For that matter, why not make it part of 'flags', where the default is to require decryption, and a new flag BDV_O_NO_IO can be added when opening an image for no I/O and used to avoid the decryption? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig5AD99EA144E54B7B2F4408EA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQQPS6AAoJEKeha0olJ0NqPssH/201xMvULlgvUJaQo0TYq31/ tDBk/0MnO8dhSRfgjXhiIX58VVQjZGMDtWET8EkYF9cei9PUc7W2SJuQ5eNhzpnz Jlbdr9dds/nnjpanjSmAa+1ugqwQaThRrZBWxPovHjN6hzdSYEnt/L6MskoRZVqw Rgzs39XtGMsn/YeXqoI0g63kQG+oAOnzcDnrLAAyE2IKv2eVA2H+10eAQZshGfjP ekZ/4R1tS5Br2lmh3BBFeEMF+YFCA5eM2yvZHTIxHBsaZNd2+zW8vrf/DZEYVftp rWF+50+Q1gTT4EP9/N53O2TsePqi9UUeMmIdKkZ3zMWYdMgieqCElwLfekl4STk= =eI1c -----END PGP SIGNATURE----- --------------enig5AD99EA144E54B7B2F4408EA--