From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7DPl-0004O5-SX for qemu-devel@nongnu.org; Fri, 13 Jun 2008 13:50:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7DPj-0004Ng-FZ for qemu-devel@nongnu.org; Fri, 13 Jun 2008 13:50:16 -0400 Received: from [199.232.76.173] (port=49377 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7DPj-0004Nc-5t for qemu-devel@nongnu.org; Fri, 13 Jun 2008 13:50:15 -0400 Received: from yw-out-1718.google.com ([74.125.46.158]:11497) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7DPi-0002AM-QU for qemu-devel@nongnu.org; Fri, 13 Jun 2008 13:50:14 -0400 Received: by yw-out-1718.google.com with SMTP id 6so2641057ywa.82 for ; Fri, 13 Jun 2008 10:50:09 -0700 (PDT) Message-ID: <4852B339.5090307@codemonkey.ws> Date: Fri, 13 Jun 2008 12:49:45 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd References: <1213370134.4833.29.camel@frecb07144> In-Reply-To: <1213370134.4833.29.camel@frecb07144> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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" Laurent Vivier wrote: > Hi, > > 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 > > Regards, > Laurent > > +static void show_parts(const char *device) > +{ > + if (fork() == 0) { > + int nbd; > + > + /* wait device */ > + sleep(1); > This looks like a big red-herring. What is this sleep waiting for any can it be possibly made into something less racy? Regards, Anthony Liguori