summaryrefslogtreecommitdiffstats
path: root/clone
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-10-13 11:56:52 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-10-13 15:25:13 +0100
commit11be7d8eee16e6249ed2868b5bd552f29508ec02 (patch)
tree46c255e7d1ad2eed24dfe10194dc3021c8ba23e4 /clone
parentbaa1618e0f917017c1934b7da41250029c1791ef (diff)
downloadlibguestfs-11be7d8eee16e6249ed2868b5bd552f29508ec02.tar.gz
libguestfs-11be7d8eee16e6249ed2868b5bd552f29508ec02.tar.xz
libguestfs-11be7d8eee16e6249ed2868b5bd552f29508ec02.zip
fish: docs: note how to clean up the remote process properly.
Killing it is always a bad idea, because the qemu subprocess will be left hanging around. The best thing is to send the exit command. This also makes the change to virt-sysprep.
Diffstat (limited to 'clone')
-rw-r--r--clone/virt-sysprep.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/clone/virt-sysprep.in b/clone/virt-sysprep.in
index b6c8a404..792282c7 100644
--- a/clone/virt-sysprep.in
+++ b/clone/virt-sysprep.in
@@ -175,16 +175,16 @@ if [ -z "$GUESTFISH_PID" ]; then
exit 1
fi
+# Helper.
+gf="guestfish --remote --"
+
cleanup ()
{
- kill $GUESTFISH_PID >/dev/null 2>&1 ||:
+ $gf exit >/dev/null 2>&1 ||:
rm -rf "$tmpdir" ||:
}
trap cleanup EXIT ERR
-# Helper.
-gf="guestfish --remote --"
-
# Launch back-end, inspect for operating systems, and get the guest
# root disk.
root=$($gf inspect-get-roots)