δΊ 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 <[email protected]>
>> ---
>> 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.
--
Best Regards
Wenchao Xia