]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qga: unset frozen state if no mount points are frozen
authorChen Hanxiao <chenhanxiao@gmail.com>
Thu, 14 Jun 2018 08:10:13 +0000 (16:10 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 3 Jul 2018 15:55:18 +0000 (10:55 -0500)
If we set mountpoints to qmp_guest_fsfreeze_freeze_list,
we may got nothing to freeze as all mountpoints are
not valid.
So call ga_unset_frozen in this senario.

Also, if we return 0 frozen fs, there is no need to call
guest-fsfreeze-thaw.

Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-posix.c
qga/qapi-schema.json

index eae817191bdbb62978a79fd272f85e041bacab9f..594d21ef3e35c2dd3f3117a7cd5d7b2849b5c5f7 100644 (file)
@@ -1274,6 +1274,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
     }
 
     free_fs_mount_list(&mounts);
+    /* We may not issue any FIFREEZE here.
+     * Just unset ga_state here and ready for the next call.
+     */
+    if (i == 0) {
+        ga_unset_frozen(ga_state);
+    }
     return i;
 
 error:
index 17884c7c709ef64e44bd6ef95ff15d8900590ceb..1045cef386ec158bec164b7a9b5ba20d2171901f 100644 (file)
 # for up to 10 seconds by VSS.
 #
 # Returns: Number of file systems currently frozen. On error, all filesystems
-# will be thawed.
+# will be thawed. If no filesystems are frozen as a result of this call,
+# then @guest-fsfreeze-status will remain "thawed" and calling
+# @guest-fsfreeze-thaw is not necessary.
 #
 # Since: 0.15.0
 ##