qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent.Vivier@bull.net>
To: Avi Kivity <avi@qumranet.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd
Date: Sat, 14 Jun 2008 21:54:22 +0200	[thread overview]
Message-ID: <1213473262.15674.6.camel@frecb07144> (raw)
In-Reply-To: <48541D73.7000001@qumranet.com>

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
-- 
------------- Laurent.Vivier@bull.net ---------------
"The best way to predict the future is to invent it."
- Alan Kay

  reply	other threads:[~2008-06-14 19:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 15:15 [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd Laurent Vivier
2008-06-13 17:49 ` Anthony Liguori
2008-06-13 18:09   ` Avi Kivity
2008-06-13 18:39   ` Laurent Vivier
2008-06-14 15:12     ` Anthony Liguori
2008-06-14 18:47       ` Laurent Vivier
2008-06-14 17:18     ` Avi Kivity
2008-06-14 19:03       ` Laurent Vivier
2008-06-14 19:06         ` Avi Kivity
2008-06-14 19:21           ` Laurent Vivier
2008-06-14 19:35             ` Avi Kivity
2008-06-14 19:54               ` Laurent Vivier [this message]
2008-06-15 14:25                 ` Anthony Liguori
2008-06-15 15:56                   ` Laurent Vivier
2008-06-15 16:00                     ` Avi Kivity
2008-06-15 17:39                       ` Laurent Vivier
2008-06-19  8:58                         ` [Qemu-devel] [PATCH][v2] " Laurent Vivier
2008-06-19  9:18                           ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213473262.15674.6.camel@frecb07144 \
    --to=laurent.vivier@bull.net \
    --cc=avi@qumranet.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).