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.");
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
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
* 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
*/
=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
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)
"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, [],
[],
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.