[Libguestfs] [PATCH 2/2] daemon: add udev_settle_file to is_root_device

Pavel Butsykin pbutsykin at virtuozzo.com
Wed Apr 12 14:01:11 UTC 2017


It fixes a fail with ENOENT when device is not yet present after system boot.

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 daemon/guestfsd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index dccfa15bc..9aa69301f 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -402,6 +402,9 @@ int
 is_root_device (const char *device)
 {
   struct stat statbuf;
+
+  udev_settle_file(device);
+
   if (stat (device, &statbuf) == -1) {
     perror (device);
     return 0;
-- 
2.11.0




More information about the Libguestfs mailing list