From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEJAX-0008Ut-4w for qemu-devel@nongnu.org; Thu, 03 Jul 2008 03:23:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEJAT-0008UN-6v for qemu-devel@nongnu.org; Thu, 03 Jul 2008 03:23:52 -0400 Received: from [199.232.76.173] (port=35610 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEJAS-0008UJ-Vo for qemu-devel@nongnu.org; Thu, 03 Jul 2008 03:23:49 -0400 Received: from ns.suse.de ([195.135.220.2]:34157 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KEJAS-0003hm-Qq for qemu-devel@nongnu.org; Thu, 03 Jul 2008 03:23:49 -0400 Message-ID: <486C7DE6.5070306@suse.de> Date: Thu, 03 Jul 2008 09:21:10 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 2/5] qemu-nbd: merge NBD client/server References: <20080627110204.818732368@bull.net> <20080627110247.660215428@bull.net> <20080702212607.GG7007@networkno.de> In-Reply-To: <20080702212607.GG7007@networkno.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent.Vivier@bull.net 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=/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 = cylinders of 16065 * 512 = 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 you 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 >> documentation. > > There's still a call to sleep() in this patch. 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? Kevin