From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEJwg-0002Pm-Jz for qemu-devel@nongnu.org; Thu, 03 Jul 2008 04:13:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEJwf-0002P2-TX for qemu-devel@nongnu.org; Thu, 03 Jul 2008 04:13:38 -0400 Received: from [199.232.76.173] (port=37409 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEJwf-0002On-Ld for qemu-devel@nongnu.org; Thu, 03 Jul 2008 04:13:37 -0400 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:44857) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEJwf-0003y5-Dq for qemu-devel@nongnu.org; Thu, 03 Jul 2008 04:13:37 -0400 Subject: Re: [Qemu-devel] [patch 2/5] qemu-nbd: merge NBD client/server From: Laurent Vivier In-Reply-To: <486C7DE6.5070306@suse.de> References: <20080627110204.818732368@bull.net> <20080627110247.660215428@bull.net> <20080702212607.GG7007@networkno.de> <486C7DE6.5070306@suse.de> Content-Type: text/plain; charset=utf-8 Date: Thu, 03 Jul 2008 10:13:33 +0200 Message-Id: <1215072813.3804.2.camel@frecb07144> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org Le jeudi 03 juillet 2008 =C3=A0 09:21 +0200, Kevin Wolf a =C3=A9crit : > 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? I agree. Laurent --=20 ------------- Laurent.Vivier@bull.net --------------- "The best way to predict the future is to invent it." - Alan Kay