qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V7 4/6] qemu-img: add -l for snapshot in convert


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V7 4/6] qemu-img: add -l for snapshot in convert
Date: Wed, 04 Dec 2013 13:42:07 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/04/2013 02:10 AM, Wenchao Xia wrote:
> Now qemu-img convert have similar options as qemu-nbd for internal
> snapshot.
> 
> Signed-off-by: Wenchao Xia <address@hidden>
> ---

> @@ -1183,6 +1189,18 @@ static int img_convert(int argc, char **argv)
>          case 's':
>              snapshot_name = optarg;
>              break;
> +        case 'l':
> +            if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
> +                sn_opts = qemu_opts_parse(&internal_snapshot_opts, optarg, 
> 0);
> +                if (!sn_opts) {
> +                    error_report("Failed in parsing snapshot param '%s'",
> +                                 optarg);
> +                    return 1;
> +                }
> +            } else {
> +                snapshot_name = optarg;
> +            }
> +            break;

Do we want a followup patch that makes it an error to use -l and -s
together?  Without such a patch, we have the odd behavior that:

convert -l name1 -s name2

loads name2, but:

convert -l snapshot.name=name1 -s name2

loads name1.  Confusing that the choice of HOW the argument to -l is
specified determines whether the -s has any impact.

For that matter, why can't '-s' and '-l' be made synonyms of each other?
 In other words, why not support:

convert -s snapshot.name=name1

-- 
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]