From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7b5g-0002vQ-02 for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:07:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7b5b-0002sa-6p for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:07:07 -0400 Received: from [199.232.76.173] (port=53308 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7b5b-0002sS-0B for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:07:03 -0400 Received: from il.qumranet.com ([212.179.150.194]:10453) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7b5a-0005vN-Ld for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:07:02 -0400 Message-ID: <485416D2.9050900@qumranet.com> Date: Sat, 14 Jun 2008 12:06:58 -0700 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd References: <1213370134.4833.29.camel@frecb07144> <4852B339.5090307@codemonkey.ws> <1213382394.3803.9.camel@frecb07144> <4853FD68.9000308@qumranet.com> <1213470224.3843.11.camel@frecb07144> In-Reply-To: <1213470224.3843.11.camel@frecb07144> Content-Type: text/plain; charset=UTF-8; format=flowed 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: Laurent Vivier Cc: qemu-devel@nongnu.org Laurent Vivier wrote: > Le samedi 14 juin 2008 =C3=A0 20:18 +0300, Avi Kivity a =C3=A9crit : > =20 >> Laurent Vivier wrote: >> =20 >>> int timeout =3D 5; >>> while ((fd =3D open(device, O_RDWR)) =3D=3D -1 && timeout--) >>> sleep(1); >>> >>> Any suggestion ??? >>> >>> =20 >>> =20 >> /sbin/udevsettle >> =20 > > Why do you think udev is involved at this moment ? > > /dev/nbd0 is created when the module is loaded (thus before) and the > partitions when the partition table is read (from within the open). > =20 It is udev that creates the devices, based on events it receives from=20 the kernel. Calling udevsettle after the kernel instructs udev to=20 create the device files will wait until they are actually created. --=20 I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.