X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fguestfsd.c;h=e5f2cf0b94b5ea8df69be7c5f5c13c94b58198f5;hb=a67c46b4b2ff5a2c4305e39d1bb105b658ca5f89;hp=0a3e64f57beb393b2a234dff0e764d91f10855ad;hpb=4513f2ec7b6aa843005ba886cdd1747b6ff00915;p=libguestfs.git diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 0a3e64f..e5f2cf0 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -741,3 +741,16 @@ device_name_translation (char *device, const char *func) device[5] = 's'; /* Restore original device name. */ goto error; } + +/* LVM and other commands aren't synchronous, especially when udev is + * involved. eg. You can create or remove some device, but the /dev + * device node won't appear until some time later. This means that + * you get an error if you run one command followed by another. + * Use 'udevadm settle' after certain commands, but don't be too + * fussed if it fails. + */ +void +udev_settle (void) +{ + command (NULL, NULL, "/sbin/udevadm", "settle", NULL); +}