qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Don't require encryption password for 'qemu-img info' command
Date: Fri, 31 Aug 2012 10:30:33 -0700	[thread overview]
Message-ID: <5040F4B9.50509@redhat.com> (raw)
In-Reply-To: <1346434010-14801-1-git-send-email-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

On 08/31/2012 10:26 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
> 
> 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
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  qemu-img.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> 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 *filename, const char *fmt)
>  
>  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?

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

  reply	other threads:[~2012-08-31 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 17:26 [Qemu-devel] [PATCH] Don't require encryption password for 'qemu-img info' command Daniel P. Berrange
2012-08-31 17:30 ` Eric Blake [this message]
2012-09-04 14:23   ` Kevin Wolf
2012-09-10 10:44     ` Kevin Wolf
2012-09-10 10:52       ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5040F4B9.50509@redhat.com \
    --to=eblake@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).