qemu-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/4] qemu-nbd: add doc for internal snapshot export
Date: Mon, 29 Jul 2013 09:39:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jul 29, 2013 at 09:57:32AM +0800, Wenchao Xia wrote:
> 于 2013-7-26 16:11, Stefan Hajnoczi 写道:
> > On Wed, Jul 17, 2013 at 10:03:54PM +0800, Wenchao Xia wrote:
> >> Signed-off-by: Wenchao Xia <address@hidden>
> >> ---
> >>   qemu-nbd.c    |    2 ++
> >>   qemu-nbd.texi |    3 +++
> >>   2 files changed, 5 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/qemu-nbd.c b/qemu-nbd.c
> >> index 46be2b2..8eeee33 100644
> >> --- a/qemu-nbd.c
> >> +++ b/qemu-nbd.c
> >> @@ -80,6 +80,8 @@ static void usage(const char *name)
> >>   "Block device options:\n"
> >>   "  -r, --read-only      export read-only\n"
> >>   "  -s, --snapshot       use snapshot file\n"
> >> +"  -l, --snapshot-load  temporarily load an internal snapshot and export 
> >> it as\n"
> >> +"                       an read-only device, format is 
> >> 'id=[ID],name=[NAME]'\n"
> > 
> > Does it really export it read-only?  I think you'll get an error unless
> > you pass qemu-nbd --read-only.
> > 
>   I think so. In patch 2:
> 
> +        case 'l':
> +            sn_param = parse_option_parameters(optarg,
> +                                               snapshot_options, sn_param);
> +            if (!sn_param) {
> +                errx(EXIT_FAILURE,
> +                     "Invalid snapshot-load options '%s'", optarg);
> +            }
>          case 'r':
>              nbdflags |= NBD_FLAG_READ_ONLY;
>              flags &= ~BDRV_O_RDWR;
> 
>   when "l" is set, readonly will also be set.

I missed that, please add a /* fall through */ comment to make readers
aware.

Stefan



reply via email to

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