* [Qemu-devel] [resend][PATCH] qga: unset frozen state if no mount points are frozen
@ 2018-01-12 2:47 Chen Hanxiao
0 siblings, 0 replies; 4+ messages in thread
From: Chen Hanxiao @ 2018-01-12 2:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Chen Hanxiao, Michael Roth
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.
Call ga_unset_frozen in this senario.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
---
Rebase on master
qga/commands-posix.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index e809e382eb..9fd51f1d7a 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1273,6 +1273,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
}
free_fs_mount_list(&mounts);
+ /* We may not issue any FIFREEZE here when had mountpoints.
+ * Just unset ga_state here and ready for the next call.
+ */
+ if (has_mountpoints && i == 0) {
+ ga_unset_frozen(ga_state);
+ }
return i;
error:
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Resend][PATCH] qga: unset frozen state if no mount points are frozen
2018-02-15 18:41 ` Michael Roth
@ 2018-02-22 7:40 ` Chen Hanxiao
0 siblings, 0 replies; 4+ messages in thread
From: Chen Hanxiao @ 2018-02-22 7:40 UTC (permalink / raw)
To: Michael Roth; +Cc: qemu-devel
At 2018-02-16 02:41:25, "Michael Roth" <mdroth@linux.vnet.ibm.com> wrote:
>Quoting Chen Hanxiao (2018-02-08 19:35:42)
>> 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.
>> Call ga_unset_frozen in this senario.
>>
>> Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
>> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
>> ---
>> Rebase on master
>>
>> qga/commands-posix.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
>> index e809e382eb..9fd51f1d7a 100644
>> --- a/qga/commands-posix.c
>> +++ b/qga/commands-posix.c
>> @@ -1273,6 +1273,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
>> }
>>
>> free_fs_mount_list(&mounts);
>> + /* We may not issue any FIFREEZE here when had mountpoints.
>> + * Just unset ga_state here and ready for the next call.
>> + */
>> + if (has_mountpoints && i == 0) {
>> + ga_unset_frozen(ga_state);
>> + }
>
>It seems odd to special-case has_mountpoints. Wouldn't:
>
> if (i == 0) {
> ...
> }
>
>be more consistent? Then management could infer i==0 leaves qga in
>unfrozen state. Otherwise I'd rather just stick with expecting a
>gratuitous unfreeze() since it requires less special-casing on the
>management/ side.
>
>And if we do change this, we'd probably want to update
>qga/qapi-schema.json to reflect the behavior. I.e.:
>
>##
># @guest-fsfreeze-freeze:
>#
># Sync and freeze all freezable, local guest filesystems. If this
># command succeeded, you may call @guest-fsfreeze-thaw later to
># unfreeze.
>...
># 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.
>
Thanks for the review.
Will be fixed in v2.
Regards,
- Chen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Resend][PATCH] qga: unset frozen state if no mount points are frozen
2018-02-09 1:35 [Qemu-devel] [Resend][PATCH] " Chen Hanxiao
@ 2018-02-15 18:41 ` Michael Roth
2018-02-22 7:40 ` Chen Hanxiao
0 siblings, 1 reply; 4+ messages in thread
From: Michael Roth @ 2018-02-15 18:41 UTC (permalink / raw)
To: Chen Hanxiao; +Cc: qemu-devel
Quoting Chen Hanxiao (2018-02-08 19:35:42)
> 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.
> Call ga_unset_frozen in this senario.
>
> Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
> ---
> Rebase on master
>
> qga/commands-posix.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index e809e382eb..9fd51f1d7a 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -1273,6 +1273,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
> }
>
> free_fs_mount_list(&mounts);
> + /* We may not issue any FIFREEZE here when had mountpoints.
> + * Just unset ga_state here and ready for the next call.
> + */
> + if (has_mountpoints && i == 0) {
> + ga_unset_frozen(ga_state);
> + }
It seems odd to special-case has_mountpoints. Wouldn't:
if (i == 0) {
...
}
be more consistent? Then management could infer i==0 leaves qga in
unfrozen state. Otherwise I'd rather just stick with expecting a
gratuitous unfreeze() since it requires less special-casing on the
management/ side.
And if we do change this, we'd probably want to update
qga/qapi-schema.json to reflect the behavior. I.e.:
##
# @guest-fsfreeze-freeze:
#
# Sync and freeze all freezable, local guest filesystems. If this
# command succeeded, you may call @guest-fsfreeze-thaw later to
# unfreeze.
...
# 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.
> return i;
>
> error:
> --
> 2.14.3
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [Resend][PATCH] qga: unset frozen state if no mount points are frozen
@ 2018-02-09 1:35 Chen Hanxiao
2018-02-15 18:41 ` Michael Roth
0 siblings, 1 reply; 4+ messages in thread
From: Chen Hanxiao @ 2018-02-09 1:35 UTC (permalink / raw)
To: mdroth; +Cc: qemu-devel, Chen Hanxiao
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.
Call ga_unset_frozen in this senario.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
---
Rebase on master
qga/commands-posix.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index e809e382eb..9fd51f1d7a 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1273,6 +1273,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
}
free_fs_mount_list(&mounts);
+ /* We may not issue any FIFREEZE here when had mountpoints.
+ * Just unset ga_state here and ready for the next call.
+ */
+ if (has_mountpoints && i == 0) {
+ ga_unset_frozen(ga_state);
+ }
return i;
error:
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-22 7:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 2:47 [Qemu-devel] [resend][PATCH] qga: unset frozen state if no mount points are frozen Chen Hanxiao
2018-02-09 1:35 [Qemu-devel] [Resend][PATCH] " Chen Hanxiao
2018-02-15 18:41 ` Michael Roth
2018-02-22 7:40 ` Chen Hanxiao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.