summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fish/cmds.c2
-rw-r--r--guestfish-actions.pod6
-rw-r--r--guestfs-actions.pod6
-rw-r--r--java/com/redhat/et/libguestfs/GuestFS.java9
-rw-r--r--perl/lib/Sys/Guestfs.pm6
-rw-r--r--python/guestfs.py9
-rwxr-xr-xsrc/generator.ml8
-rw-r--r--src/guestfs.c4
8 files changed, 37 insertions, 13 deletions
diff --git a/fish/cmds.c b/fish/cmds.c
index f0da3291..1e8cb300 100644
--- a/fish/cmds.c
+++ b/fish/cmds.c
@@ -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.");
diff --git a/guestfish-actions.pod b/guestfish-actions.pod
index 62688eed..fce1b319 100644
--- a/guestfish-actions.pod
+++ b/guestfish-actions.pod
@@ -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
diff --git a/guestfs-actions.pod b/guestfs-actions.pod
index 260cb4f2..210e8251 100644
--- a/guestfs-actions.pod
+++ b/guestfs-actions.pod
@@ -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
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java
index fdf6e4ec..7e7cd686 100644
--- a/java/com/redhat/et/libguestfs/GuestFS.java
+++ b/java/com/redhat/et/libguestfs/GuestFS.java
@@ -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
*/
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 90384da8..efc28457 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -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
diff --git a/python/guestfs.py b/python/guestfs.py
index ab0154f2..2fced28e 100644
--- a/python/guestfs.py
+++ b/python/guestfs.py
@@ -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)
diff --git a/src/generator.ml b/src/generator.ml
index ae640e2c..9a9c168e 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -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, [],
[],
diff --git a/src/guestfs.c b/src/guestfs.c
index 05c02f3f..c2d58e82 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -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.