[Qemu-devel] [PATCH resend v2] qga: unset frozen state if no mount points are frozen

Chen Hanxiao posted 1 patch 5 years, 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180402061548.29145-1-chen_han_xiao@126.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test s390x passed
qga/commands-posix.c | 6 ++++++
qga/qapi-schema.json | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH resend v2] qga: unset frozen state if no mount points are frozen
Posted by Chen Hanxiao 5 years, 12 months ago
From: Chen Hanxiao <chenhanxiao@gmail.com>

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>

---
v2:
  remove has_mountpoints special case
  add qapi-schema.json section

 qga/commands-posix.c | 6 ++++++
 qga/qapi-schema.json | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 0dc219dbcf..93bfc5b4ab 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -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:
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 17884c7c70..1045cef386 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -435,7 +435,9 @@
 # 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
 ##
-- 
2.14.3


Re: [Qemu-devel] [PATCH resend v2] qga: unset frozen state if no mount points are frozen
Posted by Chen Hanxiao 5 years, 11 months ago
At 2018-04-02 14:15:48, "Chen Hanxiao" <chen_han_xiao@126.com> wrote:
>From: Chen Hanxiao <chenhanxiao@gmail.com>
>
>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>
>

Any comments?

Regards,
- Chen