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:54:22 +0200

Le samedi 14 juin 2008 à 12:35 -0700, Avi Kivity a écrit :
> 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.

re-checked, no events with sleep() only.

events generated with sleep() + open() are:

UEVENT[1213473088.354639] change@/block/nbd0
ACTION=change
DEVPATH=/block/nbd0
SUBSYSTEM=block
MAJOR=43
MINOR=0
DEVTYPE=disk
SEQNUM=2921

UEVENT[1213473088.354721] add@/block/nbd0/nbd0p1
ACTION=add
DEVPATH=/block/nbd0/nbd0p1
SUBSYSTEM=block
MAJOR=43
MINOR=1
DEVTYPE=partition
SEQNUM=2922

UEVENT[1213473088.354781] add@/block/nbd0/nbd0p2
ACTION=add
DEVPATH=/block/nbd0/nbd0p2
SUBSYSTEM=block
MAJOR=43
MINOR=2
DEVTYPE=partition
SEQNUM=2923

UEVENT[1213473088.354842] add@/block/nbd0/nbd0p5
ACTION=add
DEVPATH=/block/nbd0/nbd0p5
SUBSYSTEM=block
MAJOR=43
MINOR=5
DEVTYPE=partition
SEQNUM=2924

UDEV  [1213473088.355617] change@/block/nbd0
UDEV_LOG=3
ACTION=change
DEVPATH=/block/nbd0
SUBSYSTEM=block
MAJOR=43
MINOR=0
DEVTYPE=disk
SEQNUM=2921
UDEVD_EVENT=1
DEVNAME=/dev/nbd0

UDEV  [1213473088.356818] add@/block/nbd0/nbd0p1
UDEV_LOG=3
ACTION=add
DEVPATH=/block/nbd0/nbd0p1
SUBSYSTEM=block
MAJOR=43
MINOR=1
DEVTYPE=partition
SEQNUM=2922
UDEVD_EVENT=1
DEVNAME=/dev/nbd0p1

UDEV  [1213473088.358335] add@/block/nbd0/nbd0p5
UDEV_LOG=3
ACTION=add
DEVPATH=/block/nbd0/nbd0p5
SUBSYSTEM=block
MAJOR=43
MINOR=5
DEVTYPE=partition
SEQNUM=2924
UDEVD_EVENT=1
DEVNAME=/dev/nbd0p5

UDEV  [1213473088.358390] add@/block/nbd0/nbd0p2
UDEV_LOG=3
ACTION=add
DEVPATH=/block/nbd0/nbd0p2
SUBSYSTEM=block
MAJOR=43
MINOR=2
DEVTYPE=partition
SEQNUM=2923
UDEVD_EVENT=1
DEVNAME=/dev/nbd0p2

> There is also some ioctl which can be used to force re-reading the 
> partition table, perhaps invoking that and then udevsettle will suffice.

Yes, I know that, but to make the ioctl() you need an open()... and the
open() is enough.

Regards,
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]