From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoS68-0008Il-W6 for qemu-devel@nongnu.org; Thu, 05 Dec 2013 01:07:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoS5x-00041g-Nl for qemu-devel@nongnu.org; Thu, 05 Dec 2013 01:07:40 -0500 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:58033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoS5x-000406-04 for qemu-devel@nongnu.org; Thu, 05 Dec 2013 01:07:29 -0500 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Dec 2013 11:37:21 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id B761E1258053 for ; Thu, 5 Dec 2013 11:38:22 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rB567Cjs5243332 for ; Thu, 5 Dec 2013 11:37:12 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rB566tVf022170 for ; Thu, 5 Dec 2013 11:37:16 +0530 Message-ID: <52A017CD.2020508@linux.vnet.ibm.com> Date: Thu, 05 Dec 2013 14:06:05 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1386148259-10962-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1386148259-10962-5-git-send-email-xiawenc@linux.vnet.ibm.com> <529F939F.8020709@redhat.com> In-Reply-To: <529F939F.8020709@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V7 4/6] qemu-img: add -l for snapshot in convert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, jcody@redhat.com, stefanha@redhat.com 于 2013/12/5 4:42, Eric Blake 写道: > 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 >> --- > >> @@ -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 > Previous I planned to use -l for internal snapshot in all possible program, since -s is taken as external snapshot in qemu, qemu-nbd. let -s stands for internal in qemu-img convert only, may bring confuse to user, so I deprecated it instead of enhance it(I want to remove it but may bring compatiablity issue). Yes, it should report error when both specified, will send a patch if you agree '-l' should still be used.