From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7bX1-0006RD-8v for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:35:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7bWz-0006Qt-TH for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:35:23 -0400 Received: from [199.232.76.173] (port=59862 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7bWz-0006Qq-NR for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:35:21 -0400 Received: from il.qumranet.com ([212.179.150.194]:11282) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7bWz-0001Lb-Ae for qemu-devel@nongnu.org; Sat, 14 Jun 2008 15:35:21 -0400 Message-ID: <48541D73.7000001@qumranet.com> Date: Sat, 14 Jun 2008 12:35:15 -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> <485416D2.9050900@qumranet.com> <1213471298.3843.20.camel@frecb07144> In-Reply-To: <1213471298.3843.20.camel@frecb07144> Content-Type: text/plain; charset=UTF-8; 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: Laurent Vivier Cc: qemu-devel@nongnu.org Laurent Vivier wrote: >> It is udev that creates the devices, based on events it receives from >> the kernel. Calling udevsettle after the kernel instructs udev to >> create the device files will wait until they are actually created. >> > > Yes, I agree but the kernel events are generated by the open(), so I > think I can't use this to know if I can use open(). > > I've used udevmonitor to see what happen: > - without open() -> no events > - whith open() whithout sleep() -> no events > -> open() + sleep() -> events generated by the partition creation. > > So, what do I miss ? > For this, it seems like sleep() generates the events, which is a little unlikely. I suggest re-checking this. There is also some ioctl which can be used to force re-reading the partition table, perhaps invoking that and then udevsettle will suffice. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.