qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 06/10] qemu-nbd: allow specifying image as a


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 06/10] qemu-nbd: allow specifying image as a set of options args
Date: Wed, 3 Feb 2016 08:47:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/02/2016 05:57 AM, Daniel P. Berrange wrote:
> Currently qemu-nbd allows an image filename to be passed on the
> command line, but unless using the JSON format, it does not have
> a way to set any options except the format eg
> 
>    qemu-nbd https://127.0.0.1/images/centos7.iso
>    qemu-nbd /home/berrange/demo.qcow2
> 
> This adds a --image-opts arg that indicates that the positional
> filename should be interpreted as a full option string, not
> just a filename.
> 
>    qemu-nbd --image-opts 
> driver=https,url=https://127.0.0.1/images,sslverify=off
>    qemu-nbd --image-opts driver=file,filename=/home/berrange/demo.qcow2
> 
> This flag is mutually exclusive with the '-f' flag.
> 
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
>  qemu-nbd.c | 42 +++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 37 insertions(+), 5 deletions(-)

Where is this new option documented? At a minimum, 'qemu-nbd --help'
should mention it. If later in the series, mention that in the commit
message.

> 
> diff --git a/qemu-nbd.c b/qemu-nbd.c
> index 0e019c1..ee91e47 100644
> --- a/qemu-nbd.c
> +++ b/qemu-nbd.c
> @@ -47,6 +47,7 @@
>  #define QEMU_NBD_OPT_DISCARD       3
>  #define QEMU_NBD_OPT_DETECT_ZEROES 4
>  #define QEMU_NBD_OPT_OBJECT        5
> +#define QEMU_NBD_OPT_IMAGE_OPTS    6

Churn here where 8/10 has to touch the same line; but I'm not sure
rearranging the series is worth the effort, so I don't mind it.

> @@ -724,13 +740,29 @@ int main(int argc, char **argv)
>      bdrv_init();
>      atexit(bdrv_close_all);

There's an earlier use of argv[optind] for the --disconnect option;
should that code be tweaked at all, or is it always safe for that path
to blindly open(name) without trying to parse options?


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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]