[Libguestfs] [PATCH] Document problems mixing mkmountpoint and umount-all (RHBZ#599503).

Richard W.M. Jones rjones at redhat.com
Tue Oct 26 09:47:12 UTC 2010


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-------------- next part --------------
>From d9cb852cab6a98241cd9d11c65f6835635f351e7 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Tue, 26 Oct 2010 10:44:11 +0100
Subject: [PATCH] Document problems mixing mkmountpoint and umount-all (RHBZ#599503).

---
 generator/generator_actions.ml |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 8add55f..63ece15 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -3394,13 +3394,28 @@ in guestfish:
  add-ro Fedora-11-i686-Live.iso
  run
  mkmountpoint /cd
- mkmountpoint /squash
- mkmountpoint /ext3
+ mkmountpoint /sqsh
+ mkmountpoint /ext3fs
  mount /dev/sda /cd
- mount-loop /cd/LiveOS/squashfs.img /squash
- mount-loop /squash/LiveOS/ext3fs.img /ext3
+ mount-loop /cd/LiveOS/squashfs.img /sqsh
+ mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs
 
-The inner filesystem is now unpacked under the /ext3 mountpoint.");
+The inner filesystem is now unpacked under the /ext3fs mountpoint.
+
+C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>.
+You may get unexpected errors if you try to mix these calls.  It is
+safest to manually unmount filesystems and remove mountpoints after use.
+
+C<guestfs_umount_all> unmounts filesystems by sorting the paths
+longest first, so for this to work for manual mountpoints, you
+must ensure that the innermost mountpoints have the longest
+pathnames, as in the example code above.
+
+For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>
+
+Autosync [see C<guestfs_set_autosync>, this is set by default on
+handles] means that C<guestfs_umount_all> is called when the handle
+is closed which can also trigger these issues.");
 
   ("rmmountpoint", (RErr, [String "exemptpath"], []), 149, [],
    [],
-- 
1.7.3.1



More information about the Libguestfs mailing list