From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3i32-00019R-ML for qemu-devel@nongnu.org; Mon, 29 Jul 2013 03:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3i2w-0006fv-Mh for qemu-devel@nongnu.org; Mon, 29 Jul 2013 03:39:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3i2w-0006fo-Fc for qemu-devel@nongnu.org; Mon, 29 Jul 2013 03:39:10 -0400 Date: Mon, 29 Jul 2013 09:39:04 +0200 From: Stefan Hajnoczi Message-ID: <20130729073904.GB26410@stefanha-thinkpad.redhat.com> References: <1374069835-14287-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1374069835-14287-4-git-send-email-xiawenc@linux.vnet.ibm.com> <20130726081134.GA31438@stefanha-thinkpad.redhat.com> <51F5CC0C.3070305@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51F5CC0C.3070305@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/4] qemu-nbd: add doc for internal snapshot export List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, dietmar@proxmox.com, pbonzini@redhat.com On Mon, Jul 29, 2013 at 09:57:32AM +0800, Wenchao Xia wrote: > =E4=BA=8E 2013-7-26 16:11, Stefan Hajnoczi =E5=86=99=E9=81=93: > > On Wed, Jul 17, 2013 at 10:03:54PM +0800, Wenchao Xia wrote: > >> Signed-off-by: Wenchao Xia > >> --- > >> 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 e= xport it as\n" > >> +" an read-only device, format is 'id=3D[ID],n= ame=3D[NAME]'\n" > >=20 > > Does it really export it read-only? I think you'll get an error unle= ss > > you pass qemu-nbd --read-only. > >=20 > I think so. In patch 2: >=20 > + case 'l': > + sn_param =3D parse_option_parameters(optarg, > + snapshot_options, sn_pa= ram); > + if (!sn_param) { > + errx(EXIT_FAILURE, > + "Invalid snapshot-load options '%s'", optarg); > + } > case 'r': > nbdflags |=3D NBD_FLAG_READ_ONLY; > flags &=3D ~BDRV_O_RDWR; >=20 > when "l" is set, readonly will also be set. I missed that, please add a /* fall through */ comment to make readers aware. Stefan