summaryrefslogtreecommitdiffstats
path: root/tests
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 /tests
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 'tests')
-rwxr-xr-xtests/btrfs/test-btrfs-subvolume-default.pl1
-rwxr-xr-xtests/disks/test-max-disks.pl2
-rwxr-xr-xtests/guests/guest-aux/make-fedora-img.pl3
-rwxr-xr-xtests/selinux/run-test.pl1
4 files changed, 6 insertions, 1 deletions
diff --git a/tests/btrfs/test-btrfs-subvolume-default.pl b/tests/btrfs/test-btrfs-subvolume-default.pl
index 013291ba..2c09ce2d 100755
--- a/tests/btrfs/test-btrfs-subvolume-default.pl
+++ b/tests/btrfs/test-btrfs-subvolume-default.pl
@@ -90,6 +90,7 @@ $g->mount ("/dev/sda1", "/");
# Now we're back to the original default volume, so this should work:
$g->mkdir ("/test1/foo/bar/baz");
+$g->shutdown ();
$g->close ();
unlink $testimg or die "$testimg: unlink: $!";
diff --git a/tests/disks/test-max-disks.pl b/tests/disks/test-max-disks.pl
index 3ced9713..a0bba7f5 100755
--- a/tests/disks/test-max-disks.pl
+++ b/tests/disks/test-max-disks.pl
@@ -140,7 +140,7 @@ for ($i = 0, $j = 0; $i < $max_disks; ++$i) {
}
}
-$g->umount_all ();
+$g->shutdown ();
$g->close ();
for ($i = 0; $i < $max_disks; ++$i) {
diff --git a/tests/guests/guest-aux/make-fedora-img.pl b/tests/guests/guest-aux/make-fedora-img.pl
index 96e41683..6a0a183e 100755
--- a/tests/guests/guest-aux/make-fedora-img.pl
+++ b/tests/guests/guest-aux/make-fedora-img.pl
@@ -195,6 +195,9 @@ $g->mkfs_opts ('ext2', '/dev/VG/LV2', blocksize => 1024);
$g->mkfs_opts ('ext2', '/dev/VG/LV3', blocksize => 2048);
# Cleanup
+$g->shutdown ();
+$g->close ();
+
unlink ("fstab.tmp.$$") or die;
foreach my $img (@images) {
$img =~ /^(.*)\.tmp\.\d+$/ or die;
diff --git a/tests/selinux/run-test.pl b/tests/selinux/run-test.pl
index 6b0ffb5c..bbe3a2f5 100755
--- a/tests/selinux/run-test.pl
+++ b/tests/selinux/run-test.pl
@@ -154,6 +154,7 @@ if ($test_via eq "direct") {
}
# Finish up.
+$g->shutdown ();
$g->close ();
unlink $testimg or die "$testimg: $!";