summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c4
1 files changed, 3 insertions, 1 deletions
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.