Autosync now runs umount-all; sync
authorRichard Jones <rjones@redhat.com>
Thu, 30 Apr 2009 16:34:23 +0000 (17:34 +0100)
committerRichard Jones <rjones@redhat.com>
Thu, 30 Apr 2009 16:34:23 +0000 (17:34 +0100)
fish/cmds.c
guestfish-actions.pod
guestfs-actions.pod
java/com/redhat/et/libguestfs/GuestFS.java
perl/lib/Sys/Guestfs.pm
python/guestfs.py
src/generator.ml
src/guestfs.c

index f0da329..1e8cb30 100644 (file)
@@ -165,7 +165,7 @@ void display_command (const char *cmd)
     pod2text ("get-path - get the search path", " get-path\n\nReturn the current search path.\n\nThis is always non-NULL.  If it wasn't set already, then this will\nreturn the default path.");
   else
   if (strcasecmp (cmd, "set_autosync") == 0 || strcasecmp (cmd, "set-autosync") == 0 || strcasecmp (cmd, "autosync") == 0)
-    pod2text ("set-autosync - set autosync mode", " set-autosync <autosync>\n\nIf C<autosync> is true, this enables autosync.  Libguestfs will make a\nbest effort attempt to run C<sync> when the handle is closed\n(also if the program exits without closing handles).\n\nYou can use 'autosync' as an alias for this command.");
+    pod2text ("set-autosync - set autosync mode", " set-autosync <autosync>\n\nIf C<autosync> is true, this enables autosync.  Libguestfs will make a\nbest effort attempt to run C<umount_all> followed by\nC<sync> when the handle is closed\n(also if the program exits without closing handles).\n\nThis is disabled by default (except in guestfish where it is\nenabled by default).\n\nYou can use 'autosync' as an alias for this command.");
   else
   if (strcasecmp (cmd, "get_autosync") == 0 || strcasecmp (cmd, "get-autosync") == 0)
     pod2text ("get-autosync - get autosync mode", " get-autosync\n\nGet the autosync flag.");
index 62688ee..fce1b31 100644 (file)
@@ -823,9 +823,13 @@ Remove the single directory C<path>.
  set-autosync true|false
 
 If C<autosync> is true, this enables autosync.  Libguestfs will make a
-best effort attempt to run C<sync> when the handle is closed
+best effort attempt to run C<umount-all> followed by
+C<sync> when the handle is closed
 (also if the program exits without closing handles).
 
+This is disabled by default (except in guestfish where it is
+enabled by default).
+
 =head2 set-e2label
 
  set-e2label device label
index 260cb4f..210e825 100644 (file)
@@ -1099,9 +1099,13 @@ This function returns 0 on success or -1 on error.
                int autosync);
 
 If C<autosync> is true, this enables autosync.  Libguestfs will make a
-best effort attempt to run C<guestfs_sync> when the handle is closed
+best effort attempt to run C<guestfs_umount_all> followed by
+C<guestfs_sync> when the handle is closed
 (also if the program exits without closing handles).
 
+This is disabled by default (except in guestfish where it is
+enabled by default).
+
 This function returns 0 on success or -1 on error.
 
 =head2 guestfs_set_busy
index fdf6e4e..7e7cd68 100644 (file)
@@ -319,9 +319,12 @@ public class GuestFS {
    * set autosync mode
    *
    * If "autosync" is true, this enables autosync. Libguestfs
-   * will make a best effort attempt to run "g.sync" when the
-   * handle is closed (also if the program exits without
-   * closing handles).
+   * will make a best effort attempt to run "g.umount_all"
+   * followed by "g.sync" when the handle is closed (also if
+   * the program exits without closing handles).
+   * 
+   * This is disabled by default (except in guestfish where
+   * it is enabled by default).
    * 
    * @throws LibGuestFSException
    */
index 90384da..efc2845 100644 (file)
@@ -758,9 +758,13 @@ Remove the single directory C<path>.
 =item $h->set_autosync ($autosync);
 
 If C<autosync> is true, this enables autosync.  Libguestfs will make a
-best effort attempt to run C<$h-E<gt>sync> when the handle is closed
+best effort attempt to run C<$h-E<gt>umount_all> followed by
+C<$h-E<gt>sync> when the handle is closed
 (also if the program exits without closing handles).
 
+This is disabled by default (except in guestfish where it is
+enabled by default).
+
 =item $h->set_busy ();
 
 This sets the state to C<BUSY>.  This is only used when implementing
index ab0154f..2fced28 100644 (file)
@@ -194,9 +194,12 @@ class GuestFS:
 
     def set_autosync (self, autosync):
         u"""If "autosync" is true, this enables autosync. Libguestfs
-        will make a best effort attempt to run "g.sync" when the
-        handle is closed (also if the program exits without
-        closing handles).
+        will make a best effort attempt to run "g.umount_all"
+        followed by "g.sync" when the handle is closed (also if
+        the program exits without closing handles).
+        
+        This is disabled by default (except in guestfish where
+        it is enabled by default).
         """
         return libguestfsmod.set_autosync (self._o, autosync)
 
index ae640e2..9a9c168 100755 (executable)
@@ -339,8 +339,12 @@ return the default path.");
    "set autosync mode",
    "\
 If C<autosync> is true, this enables autosync.  Libguestfs will make a
-best effort attempt to run C<guestfs_sync> when the handle is closed
-(also if the program exits without closing handles).");
+best effort attempt to run C<guestfs_umount_all> followed by
+C<guestfs_sync> when the handle is closed
+(also if the program exits without closing handles).
+
+This is disabled by default (except in guestfish where it is
+enabled by default).");
 
   ("get_autosync", (RBool "autosync", []), -1, [],
    [],
index 05c02f3..c2d58e8 100644 (file)
@@ -267,8 +267,10 @@ guestfs_close (guestfs_h *g)
     fprintf (stderr, "closing guestfs handle %p (state %d)\n", g, g->state);
 
   /* Try to sync if autosync flag is set. */
-  if (g->autosync && g->state == READY)
+  if (g->autosync && g->state == READY) {
+    guestfs_umount_all (g);
     guestfs_sync (g);
+  }
 
   /* Remove any handlers that might be called back before we kill the
    * subprocess.