qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd
Date: Sat, 14 Jun 2008 21:21:38 +0200

Le samedi 14 juin 2008 à 12:06 -0700, Avi Kivity a écrit :
> Laurent Vivier wrote:
> > Le samedi 14 juin 2008 à 20:18 +0300, Avi Kivity a écrit :
> >   
> >> Laurent Vivier wrote:
> >>     
> >>> int timeout = 5;
> >>> while ((fd = open(device, O_RDWR)) == -1 && timeout--)
> >>>     sleep(1);
> >>>
> >>> Any suggestion ???
> >>>
> >>>   
> >>>       
> >> /sbin/udevsettle
> >>     
> >
> > 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).
> >   
> 
> 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 ?

Laurent
-- 
------------- address@hidden ---------------
"The best way to predict the future is to invent it."
- Alan Kay





reply via email to

[Prev in Thread] Current Thread [Next in Thread]