From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmF8a-0005wc-T2 for qemu-devel@nongnu.org; Tue, 03 Jul 2012 22:16:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmF8Y-0005FF-VY for qemu-devel@nongnu.org; Tue, 03 Jul 2012 22:16:16 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:39652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmF8Y-0005Av-Ax for qemu-devel@nongnu.org; Tue, 03 Jul 2012 22:16:14 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Jul 2012 07:46:05 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q642Fh7H7405908 for ; Wed, 4 Jul 2012 07:45:44 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q647kGh5010310 for ; Wed, 4 Jul 2012 17:46:17 +1000 Message-ID: <4FF3A719.5040702@linux.vnet.ibm.com> Date: Wed, 04 Jul 2012 10:14:49 +0800 From: Wayne Xia MIME-Version: 1.0 References: <1341313544-6256-1-git-send-email-xiawenc@linux.vnet.ibm.com> <4FF34BBD.2050101@msgid.tls.msk.ru> In-Reply-To: <4FF34BBD.2050101@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] add text about how to use qemu-nbd with qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, stefanha@linux.vnet.ibm.com > On 03.07.2012 15:05, xiawenc@linux.vnet.ibm.com wrote: >> From: Wenchao Xia >> >> Qemu system emulator reports only fails that make people confused >> about why, when it is invoked with nbd block device tring to connect >> qemu-nbd server. In fact qemu will try connect server for several >> times but server only accept one connect by default. >> I paid some times to find out why it fails. This patch add special >> text to explain how to use it in such case. >> >> Signed-off-by: Wenchao Xia >> --- >> qemu-nbd.texi | 6 ++++++ >> 1 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/qemu-nbd.texi b/qemu-nbd.texi >> index 6955d90..014040a 100644 >> --- a/qemu-nbd.texi >> +++ b/qemu-nbd.texi >> @@ -44,6 +44,12 @@ Export QEMU disk image using NBD protocol. >> display this help and exit >> @item -V, --version >> output version information and exit >> + >> + Note: When qemu-nbd was used to export a disk that would be used by QEMU >> +block device, -t or --persistent must be set for that QEMU nbd client would try >> +connect more than one time. For eg: >> + qemu-nbd ./simple.img -p 10809 -t >> + qemu -hdb nbd:127.0.0.1:10809 > > It is not accurate. > > qemu connect to nbd server not "several" but exactly two times by default. > The first connection it does (it need not be a separate connection > actually, and this, I'd say, a bug in qemu) in order to guess the format I think so, actually I planned to patch qemu client side to make it connect only once, but the disconnect logical lies in general block layer and changing of that may break other block device logical I guess, so I gave up of that approach. > of the internal structure inside - be it raw, or qcow, or anything else. > So, if you specify the format of the device explicitly, by using > format=raw, only single connection will be made. thanks, that helped me. A bit more question: is there a way to let nbd client know the image format used by server? qemu-nbd exports simple_qcow2.img, and qemu saw it as raw block device, is it possible to get the information in qemu that server is using qcow2 image? > > /mjt > -- Best Regards Wayne Xia mail:xiawenc@linux.vnet.ibm.com tel:86-010-82450803