+/* Older versions of libguestfs used to issue separate 'umount_all'
+ * and 'sync' commands just before closing the handle. Since
+ * libguestfs 1.9.7 the library issues this 'internal_autosync'
+ * internal operation instead, allowing more control in the daemon.
+ */
+int
+do_internal_autosync (void)
+{
+ int r = 0;
+
+ if (autosync_umount)
+ r = do_umount_all ();
+
+ sync_disks ();
+
+ return r;
+}
+