qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V3 3/7] qemu-nbd: add doc for internal snapshot


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V3 3/7] qemu-nbd: add doc for internal snapshot export
Date: Thu, 10 Oct 2013 14:04:48 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

于 2013/10/1 22:49, Eric Blake 写道:
On 09/25/2013 06:16 PM, Wenchao Xia wrote:
Signed-off-by: Wenchao Xia<address@hidden>
---
  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.





reply via email to

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