summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-09-24 18:53:21 +0100
committerRichard W.M. Jones <rjones@redhat.com>2010-09-24 19:11:56 +0100
commit840536ea5a0568296dfd3e483442c76b93c5a949 (patch)
treedc6161332d18ddb36e9afe881aa5bbc93d2cd57b
parentbe49d1efa2c2447553f12a51c04f2c21f213fd75 (diff)
downloadlibguestfs-840536ea5a0568296dfd3e483442c76b93c5a949.tar.gz
libguestfs-840536ea5a0568296dfd3e483442c76b93c5a949.tar.xz
libguestfs-840536ea5a0568296dfd3e483442c76b93c5a949.zip
Call blockdev --rereadpt then udev_settle after sfdisk commands.
This updates commit 956fc5a3feacc970ea763697bf28fb686c875408 so that we call udev_settle after rereading the partition table. This ensures that the devices nodes for the new partitions have been created.
-rw-r--r--daemon/sfdisk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/daemon/sfdisk.c b/daemon/sfdisk.c
index 99a18bb1..bf62c1da 100644
--- a/daemon/sfdisk.c
+++ b/daemon/sfdisk.c
@@ -89,8 +89,6 @@ sfdisk (const char *device, int n, int cyls, int heads, int sectors,
return -1;
}
- udev_settle ();
-
/* sfdisk sometimes fails on fast machines with:
*
* Re-reading the partition table ...
@@ -103,7 +101,12 @@ sfdisk (const char *device, int n, int cyls, int heads, int sectors,
* other component. In any case, reread the partition table
* unconditionally here.
*/
- return do_blockdev_rereadpt (device);
+ if (do_blockdev_rereadpt (device) == -1)
+ return -1;
+
+ udev_settle ();
+
+ return 0;
}
int