From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEM23-00044U-HX for qemu-devel@nongnu.org; Thu, 03 Jul 2008 06:27:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEM20-00041s-7z for qemu-devel@nongnu.org; Thu, 03 Jul 2008 06:27:17 -0400 Received: from [199.232.76.173] (port=34245 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEM1z-00041Z-SD for qemu-devel@nongnu.org; Thu, 03 Jul 2008 06:27:15 -0400 Received: from relay01.mx.bawue.net ([193.7.176.67]:46846) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KEM1z-0004YO-CO for qemu-devel@nongnu.org; Thu, 03 Jul 2008 06:27:15 -0400 Date: Thu, 3 Jul 2008 11:27:11 +0100 From: Thiemo Seufer Subject: Re: [Qemu-devel] [patch 2/5] qemu-nbd: merge NBD client/server Message-ID: <20080703102711.GH7007@networkno.de> References: <20080627110204.818732368@bull.net> <20080627110247.660215428@bull.net> <20080702212607.GG7007@networkno.de> <486C7DE6.5070306@suse.de> <1215072813.3804.2.camel@frecb07144> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1215072813.3804.2.camel@frecb07144> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Kevin Wolf , qemu-devel@nongnu.org Laurent Vivier wrote: > Le jeudi 03 juillet 2008 =E0 09:21 +0200, Kevin Wolf a =E9crit : > > Thiemo Seufer schrieb: > > > Laurent.Vivier@bull.net wrote: > > >> This patch allows to connect directly a disk image file to an NBD > > >> device. It introduces the use of a unix socket (instead of inet). > > >> > > >> - To connect a file to a device: > > >> > > >> # qemu-nbd --connect=3D/dev/nbd0 my_disk.qcow2 > > >> > > >> Then you can see directly your disk (no need of nbd-client): > > >> > > >> # fdisk -l /dev/nbd0 > > >> > > >> Disk /dev/nbd0: 4294 MB, 4294967296 bytes > > >> 255 heads, 63 sectors/track, 522 cylinders > > >> Units =3D cylinders of 16065 * 512 =3D 8225280 bytes > > >> > > >> Device Boot Start End Blocks Id System > > >> /dev/nbd0p1 * 1 492 3951958+ 83 Linux > > >> /dev/nbd0p2 493 522 240975 5 Extended > > >> /dev/nbd0p5 493 522 240943+ 82 Linux swap= / > > >> Solaris > > >> > > >> - To disconnect the file from the device: > > >> > > >> # qemu-nbd --disconnect /dev/nbd0 > > >> > > >> Changelog: > > >> - v2: call show_parts() from client and avoid the sleep(1). Thank yo= u to > > >> Avi and Anthony. Include my cleanup patch and comments from Carlo > > >> Marcelo Arenas Belon. > > >> - v3: allow to specify unix socket name with "--socket" and update= =20 > > >> documentation. > > >=20 > > > There's still a call to sleep() in this patch. > >=20 > > And that's fine, IMHO. sleep() is not bad per se. The remaining call is > > not a "guess it'll take at most a second" style sleep but waiting in a > > loop until the child is ready. You don't want the loop to eat up 100% > > CPU, do you? >=20 > I agree. I committed it with a small change (exit is not the best name for a label). Thiemo