From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3cix-0001HC-4n for qemu-devel@nongnu.org; Sun, 28 Jul 2013 21:58:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3cio-00049n-7V for qemu-devel@nongnu.org; Sun, 28 Jul 2013 21:58:11 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:47144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3cin-000497-Hh for qemu-devel@nongnu.org; Sun, 28 Jul 2013 21:58:02 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 07:20:35 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 97EDD394004D for ; Mon, 29 Jul 2013 07:27:42 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6T1vhEC39911594 for ; Mon, 29 Jul 2013 07:27:44 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6T1vkgp016175 for ; Mon, 29 Jul 2013 11:57:47 +1000 Message-ID: <51F5CC0C.3070305@linux.vnet.ibm.com> Date: Mon, 29 Jul 2013 09:57:32 +0800 From: Wenchao Xia MIME-Version: 1.0 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> In-Reply-To: <20130726081134.GA31438@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit 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: Stefan Hajnoczi Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, dietmar@proxmox.com ÓÚ 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 >> --- >> 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