Call 'udevadm settle' after operations which add/remove device nodes.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 1 Jul 2009 16:15:24 +0000 (17:15 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 1 Jul 2009 16:15:24 +0000 (17:15 +0100)
commit99e28249d52ca5495b636e14ae3e4387ee62c8fe
tree6038b57e180556e9429cd422d075fccd9c4a9ff7
parent3e2d925717d1dac6b3862e98192c12d1080c2152
Call 'udevadm settle' after operations which add/remove device nodes.

Because udev operates asynchronously, we found errors which were
caused by a previous command (eg. sfdisk or pvremove) creating
or removing a device, and that change not having happened by the
time the next command was run.

This patch adds calls to '/sbin/udevadm settle' after any commands
which can add or remove device nodes.

If udev is not being used or not available, this should have no
effect.  The command fails and this is silently ignored.
daemon/daemon.h
daemon/guestfsd.c
daemon/lvm.c
daemon/sfdisk.c