summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-03 13:22:45 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-03 21:27:29 +0100
commitffbf1475f7ae7c462db289ad4834391469e72edd (patch)
tree5caa1b0f2ed83afd56495f9dabf8e81be5f680c7 /tools
parentbcc4ffb52b9f4b5db7861682905ec32844f4603b (diff)
downloadlibguestfs-ffbf1475f7ae7c462db289ad4834391469e72edd.tar.gz
libguestfs-ffbf1475f7ae7c462db289ad4834391469e72edd.tar.xz
libguestfs-ffbf1475f7ae7c462db289ad4834391469e72edd.zip
New API: guestfs_shutdown: Cleanly shutdown the backend.
The new API splits orderly close into a two-step process: if (guestfs_shutdown (g) == -1) { /* handle the error, eg. qemu error */ } guestfs_close (g); Note that the explicit shutdown step is only necessary in the case where you have made changes to the disk image and want to handle write errors. Read the documentation for further information. This change also: - deprecates guestfs_kill_subprocess - turns guestfs_kill_subprocess into the same as guestfs_shutdown - changes guestfish and other tools to call shutdown + close where necessary (not for read-only tools) - updates documentation - updates examples
Diffstat (limited to 'tools')
-rwxr-xr-xtools/virt-make-fs5
-rwxr-xr-xtools/virt-tar6
-rwxr-xr-xtools/virt-win-reg6
3 files changed, 7 insertions, 10 deletions
diff --git a/tools/virt-make-fs b/tools/virt-make-fs
index 7d032804..b53e8607 100755
--- a/tools/virt-make-fs
+++ b/tools/virt-make-fs
@@ -539,9 +539,8 @@ eval {
}
print STDERR "finishing off\n" if $debug;
- $g->umount_all ();
- $g->sync ();
- undef $g;
+ $g->shutdown ();
+ $g->close ()
};
if ($@) {
# Error: delete the output before exiting.
diff --git a/tools/virt-tar b/tools/virt-tar
index 777dbbdd..801104fe 100755
--- a/tools/virt-tar
+++ b/tools/virt-tar
@@ -279,10 +279,8 @@ if ($mode eq "x") {
}
}
-$g->sync ();
-$g->umount_all ();
-
-undef $g;
+$g->shutdown ();
+$g->close ();
exit 0;
diff --git a/tools/virt-win-reg b/tools/virt-win-reg
index ab5daa71..2caa954c 100755
--- a/tools/virt-win-reg
+++ b/tools/virt-win-reg
@@ -337,9 +337,9 @@ else { # Import mode.
upload_hive ($hiveshortname, $hives{$hiveshortname}->{hivefile})
}
- # Sync everything.
- $g->umount_all ();
- $g->sync ();
+ # Close.
+ $g->shutdown ();
+ $g->close ();
}
exit 0;