diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-30 17:34:23 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-30 17:34:23 +0100 |
commit | f7e6ffa8a82f8a7a214a47ff32f46d9e893902d8 (patch) | |
tree | c0026038f845c5ec934d89aa3be5c3f1c307e305 /src | |
parent | e4733575efff31742444b180cdcfbc2504b144c8 (diff) | |
download | libguestfs-f7e6ffa8a82f8a7a214a47ff32f46d9e893902d8.tar.gz libguestfs-f7e6ffa8a82f8a7a214a47ff32f46d9e893902d8.tar.xz libguestfs-f7e6ffa8a82f8a7a214a47ff32f46d9e893902d8.zip |
Autosync now runs umount-all; sync
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 8 | ||||
-rw-r--r-- | src/guestfs.c | 4 |
2 files changed, 9 insertions, 3 deletions
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. |