From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU9N9-0005GQ-Ua for qemu-devel@nongnu.org; Thu, 10 Oct 2013 02:05:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU9Mw-0004xP-AO for qemu-devel@nongnu.org; Thu, 10 Oct 2013 02:05:19 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:37677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU9Mv-0004rJ-NT for qemu-devel@nongnu.org; Thu, 10 Oct 2013 02:05:06 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Oct 2013 11:35:03 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id F3C87125803F for ; Thu, 10 Oct 2013 11:35:23 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9A67Lgh35848340 for ; Thu, 10 Oct 2013 11:37:22 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9A64fto032575 for ; Thu, 10 Oct 2013 11:34:41 +0530 Message-ID: <52564380.4020208@linux.vnet.ibm.com> Date: Thu, 10 Oct 2013 14:04:48 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1380154568-5339-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1380154568-5339-4-git-send-email-xiawenc@linux.vnet.ibm.com> <524AE0EC.1010802@redhat.com> In-Reply-To: <524AE0EC.1010802@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V3 3/7] qemu-nbd: add doc for internal snapshot export List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@gmail.com 于 2013/10/1 22:49, Eric Blake 写道: > On 09/25/2013 06:16 PM, Wenchao Xia wrote: >> Signed-off-by: Wenchao Xia >> --- >> qemu-nbd.c | 11 ++++++++++- >> qemu-nbd.texi | 11 ++++++++++- >> 2 files changed, 20 insertions(+), 2 deletions(-) > This should be squashed into 2/7. When adding new options, the > documentation should be added at the same time. > OK. >> +" the temporary one\n" >> +" -l, --load-snapshot=SNAPSHOT_ID_OR_NAME\n" >> +" load an internal snapshot inside FILE and export it\n" >> +" as an read-only device\n" >> +" -L, --load-snapshot1=SNAPSHOT_PARAM\n" >> +" load an internal snapshot inside FILE and export it\n" >> +" as an read-only device, SNAPSHOT_PARAM format is\n" >> +" 'snapshot.id=[ID],snapshot.name=[NAME]'\n" > Why can't ONE option be good enough? In other words, make the command > line parser smart enough so that: > > --load-snapshot=name > > tries SNAPSHOT_ID_OR_NAME, while > > --load-snapshot=snapshot.id=xyz,snapshot.name=name > > tries the SNAPSHOT_PARAM form. In other words, if the optarg begins > with 'snapshot.', assume the SNAPSHOT_PARAM form, otherwise use the > SNAPSHOT_ID_OR_NAME form. Then you only burn one short option letter, > and avoid the problem with ambiguous abbreviation that I complained > about in 2/7. > I split the option as two item since want to keep capatiability for "-s snapshot.id=xyz" in qemu-img convert, it is possible some one already named a snapshot as "snapshot.id=xyz". But from the comments of Paolo, I think add a new option in qemu-img convert and deprecate -s, can solve the problem, so I will use your format in next version, thanks for tipping that.