diff mbox series

[v3,3/3] qapi: Allow introspecting fix for savevm's cooperation with blockdev

Message ID be94d24847d38cb5a1172ed22d0f86e7c0ec8562.1570705279.git.pkrempa@redhat.com (mailing list archive)
State New, archived
Headers show
Series qapi: Add detection for the 'savevm' fix for blockdev | expand

Commit Message

Peter Krempa Oct. 10, 2019, 11:05 a.m. UTC
'savevm' was buggy as it considered all monitor-owned block device nodes
for snapshot. With introduction of -blockdev the common usage made all
nodes including protocol and backing file nodes monitor-owned and thus
considered for snapshot.

This is a problem since the 'file' protocol nodes can't have internal
snapshots and it does not make sense to take snapshot of nodes
representing backing files.

This was fixed by commit 05f4aced658a02b02 clients need to be able to
detect whether this fix is present.

Since savevm does not have an QMP alternative, add the feature for the
'human-monitor-command' backdoor which is used to call this command in
modern use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 qapi/misc.json | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Markus Armbruster Oct. 10, 2019, 1:52 p.m. UTC | #1
Peter Krempa <pkrempa@redhat.com> writes:

> 'savevm' was buggy as it considered all monitor-owned block device nodes
> for snapshot. With introduction of -blockdev the common usage made all
> nodes including protocol and backing file nodes monitor-owned and thus
> considered for snapshot.
>
> This is a problem since the 'file' protocol nodes can't have internal
> snapshots and it does not make sense to take snapshot of nodes
> representing backing files.
>
> This was fixed by commit 05f4aced658a02b02 clients need to be able to
> detect whether this fix is present.

05f4aced658a02b02.  Clients

>
> Since savevm does not have an QMP alternative, add the feature for the
> 'human-monitor-command' backdoor which is used to call this command in
> modern use.
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>

Preferrably with the commit message tweak:
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Eric Blake Oct. 10, 2019, 6:11 p.m. UTC | #2
On 10/10/19 6:05 AM, Peter Krempa wrote:

In addition to Markus' review,

> 'savevm' was buggy as it considered all monitor-owned block device nodes
> for snapshot. With introduction of -blockdev the common usage made all

With the introduction of -blockdev, the common usage

> nodes including protocol and backing file nodes monitor-owned and thus

nodes be monitor-owned

> considered for snapshot.
> 
> This is a problem since the 'file' protocol nodes can't have internal
> snapshots and it does not make sense to take snapshot of nodes
> representing backing files.
> 
> This was fixed by commit 05f4aced658a02b02 clients need to be able to
> detect whether this fix is present.
> 
> Since savevm does not have an QMP alternative, add the feature for the
> 'human-monitor-command' backdoor which is used to call this command in
> modern use.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>   qapi/misc.json | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 6bd11f50e6..5d0070aa43 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -1020,6 +1020,12 @@
>   #
>   # @cpu-index: The CPU to use for commands that require an implicit CPU
>   #
> +# Features:
> +# @savevm-blockdev-monitor-nodes: If present, the HMP command savevm only
> +#                                 snapshots monitor-owned nodes if they have no
> +#                                 parents. This allows to use 'savevm' with
> +#                                 -blockdev. (since 4.2)

s/to use/the use of/

> +#
>   # Returns: the output of the command as a string
>   #
>   # Since: 0.14.0
> @@ -1047,7 +1053,8 @@
>   ##
>   { 'command': 'human-monitor-command',
>     'data': {'command-line': 'str', '*cpu-index': 'int'},
> -  'returns': 'str' }
> +  'returns': 'str',
> +  'features': [ 'savevm-blockdev-monitor-nodes' ] }
> 
>   ##
>   # @change:
>
diff mbox series

Patch

diff --git a/qapi/misc.json b/qapi/misc.json
index 6bd11f50e6..5d0070aa43 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1020,6 +1020,12 @@ 
 #
 # @cpu-index: The CPU to use for commands that require an implicit CPU
 #
+# Features:
+# @savevm-blockdev-monitor-nodes: If present, the HMP command savevm only
+#                                 snapshots monitor-owned nodes if they have no
+#                                 parents. This allows to use 'savevm' with
+#                                 -blockdev. (since 4.2)
+#
 # Returns: the output of the command as a string
 #
 # Since: 0.14.0
@@ -1047,7 +1053,8 @@ 
 ##
 { 'command': 'human-monitor-command',
   'data': {'command-line': 'str', '*cpu-index': 'int'},
-  'returns': 'str' }
+  'returns': 'str',
+  'features': [ 'savevm-blockdev-monitor-nodes' ] }

 ##
 # @change: