diff mbox series

[v2,5/8] qapi/misc: Restrict query-vm-generation-id command to machine code

Message ID 20200316000348.29692-6-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series user-mode: Prune build dependencies (part 2) | expand

Commit Message

Philippe Mathieu-Daudé March 16, 2020, 12:03 a.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 qapi/machine.json | 20 ++++++++++++++++++++
 qapi/misc.json    | 21 ---------------------
 hw/acpi/vmgenid.c |  2 +-
 stubs/vmgenid.c   |  2 +-
 4 files changed, 22 insertions(+), 23 deletions(-)

Comments

Igor Mammedov March 16, 2020, 12:45 p.m. UTC | #1
On Mon, 16 Mar 2020 01:03:45 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Acked-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  qapi/machine.json | 20 ++++++++++++++++++++
>  qapi/misc.json    | 21 ---------------------
>  hw/acpi/vmgenid.c |  2 +-
>  stubs/vmgenid.c   |  2 +-
>  4 files changed, 22 insertions(+), 23 deletions(-)
> 
> diff --git a/qapi/machine.json b/qapi/machine.json
> index c096efbea3..1a2a4b0d48 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -415,6 +415,26 @@
>  ##
>  { 'command': 'query-target', 'returns': 'TargetInfo' }
>  
> +##
> +# @GuidInfo:
> +#
> +# GUID information.
> +#
> +# @guid: the globally unique identifier
> +#
> +# Since: 2.9
> +##
> +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> +
> +##
> +# @query-vm-generation-id:
> +#
> +# Show Virtual Machine Generation ID
> +#
> +# Since: 2.9
> +##
> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> +
>  ##
>  # @LostTickPolicy:
>  #
> diff --git a/qapi/misc.json b/qapi/misc.json
> index f70025f34c..8c02870227 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -1383,24 +1383,3 @@
>  #
>  ##
>  { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
> -
> -##
> -# @GuidInfo:
> -#
> -# GUID information.
> -#
> -# @guid: the globally unique identifier
> -#
> -# Since: 2.9
> -##
> -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> -
> -##
> -# @query-vm-generation-id:
> -#
> -# Show Virtual Machine Generation ID
> -#
> -# Since: 2.9
> -##
> -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> -
> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
> index 2df7623d74..2b26bacaf8 100644
> --- a/hw/acpi/vmgenid.c
> +++ b/hw/acpi/vmgenid.c
> @@ -12,7 +12,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-commands-misc.h"
> +#include "qapi/qapi-commands-machine.h"
>  #include "qemu/module.h"
>  #include "hw/acpi/acpi.h"
>  #include "hw/acpi/aml-build.h"
> diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
> index 568e42b064..bfad656c6c 100644
> --- a/stubs/vmgenid.c
> +++ b/stubs/vmgenid.c
> @@ -1,6 +1,6 @@
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-commands-misc.h"
> +#include "qapi/qapi-commands-machine.h"
>  #include "qapi/qmp/qerror.h"
>  
>  GuidInfo *qmp_query_vm_generation_id(Error **errp)
Philippe Mathieu-Daudé March 17, 2020, 9:44 a.m. UTC | #2
On 3/16/20 1:45 PM, Igor Mammedov wrote:
> On Mon, 16 Mar 2020 01:03:45 +0100
> Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> 
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> Acked-by: Igor Mammedov <imammedo@redhat.com>
>> ---
>>   qapi/machine.json | 20 ++++++++++++++++++++
>>   qapi/misc.json    | 21 ---------------------
>>   hw/acpi/vmgenid.c |  2 +-
>>   stubs/vmgenid.c   |  2 +-
>>   4 files changed, 22 insertions(+), 23 deletions(-)
>>
>> diff --git a/qapi/machine.json b/qapi/machine.json
>> index c096efbea3..1a2a4b0d48 100644
>> --- a/qapi/machine.json
>> +++ b/qapi/machine.json
>> @@ -415,6 +415,26 @@
>>   ##
>>   { 'command': 'query-target', 'returns': 'TargetInfo' }
>>   
>> +##
>> +# @GuidInfo:
>> +#
>> +# GUID information.
>> +#
>> +# @guid: the globally unique identifier
>> +#
>> +# Since: 2.9
>> +##
>> +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
>> +
>> +##
>> +# @query-vm-generation-id:
>> +#
>> +# Show Virtual Machine Generation ID
>> +#
>> +# Since: 2.9
>> +##
>> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
>> +
>>   ##
>>   # @LostTickPolicy:
>>   #
>> diff --git a/qapi/misc.json b/qapi/misc.json
>> index f70025f34c..8c02870227 100644
>> --- a/qapi/misc.json
>> +++ b/qapi/misc.json
>> @@ -1383,24 +1383,3 @@
>>   #
>>   ##
>>   { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
>> -
>> -##
>> -# @GuidInfo:
>> -#
>> -# GUID information.
>> -#
>> -# @guid: the globally unique identifier
>> -#
>> -# Since: 2.9
>> -##
>> -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
>> -
>> -##
>> -# @query-vm-generation-id:
>> -#
>> -# Show Virtual Machine Generation ID
>> -#
>> -# Since: 2.9
>> -##
>> -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }

Daniel explained on IRC the GUID structure is "standardized by microsoft 
as a way to detect when a guest has certain operations applied" to a 
saved snapshot.

https://docs.microsoft.com/en-us/windows/win32/hyperv_v2/virtual-machine-generation-identifier 


So this one goes to qapi/block-core.json, right?

>> -
>> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
>> index 2df7623d74..2b26bacaf8 100644
>> --- a/hw/acpi/vmgenid.c
>> +++ b/hw/acpi/vmgenid.c
>> @@ -12,7 +12,7 @@
>>   
>>   #include "qemu/osdep.h"
>>   #include "qapi/error.h"
>> -#include "qapi/qapi-commands-misc.h"
>> +#include "qapi/qapi-commands-machine.h"
>>   #include "qemu/module.h"
>>   #include "hw/acpi/acpi.h"
>>   #include "hw/acpi/aml-build.h"
>> diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
>> index 568e42b064..bfad656c6c 100644
>> --- a/stubs/vmgenid.c
>> +++ b/stubs/vmgenid.c
>> @@ -1,6 +1,6 @@
>>   #include "qemu/osdep.h"
>>   #include "qapi/error.h"
>> -#include "qapi/qapi-commands-misc.h"
>> +#include "qapi/qapi-commands-machine.h"
>>   #include "qapi/qmp/qerror.h"
>>   
>>   GuidInfo *qmp_query_vm_generation_id(Error **errp)
>
Igor Mammedov March 17, 2020, 11:07 a.m. UTC | #3
On Tue, 17 Mar 2020 10:44:33 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> On 3/16/20 1:45 PM, Igor Mammedov wrote:
> > On Mon, 16 Mar 2020 01:03:45 +0100
> > Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> >   
> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>  
> > 
> > Acked-by: Igor Mammedov <imammedo@redhat.com>  
> >> ---
> >>   qapi/machine.json | 20 ++++++++++++++++++++
> >>   qapi/misc.json    | 21 ---------------------
> >>   hw/acpi/vmgenid.c |  2 +-
> >>   stubs/vmgenid.c   |  2 +-
> >>   4 files changed, 22 insertions(+), 23 deletions(-)
> >>
> >> diff --git a/qapi/machine.json b/qapi/machine.json
> >> index c096efbea3..1a2a4b0d48 100644
> >> --- a/qapi/machine.json
> >> +++ b/qapi/machine.json
> >> @@ -415,6 +415,26 @@
> >>   ##
> >>   { 'command': 'query-target', 'returns': 'TargetInfo' }
> >>   
> >> +##
> >> +# @GuidInfo:
> >> +#
> >> +# GUID information.
> >> +#
> >> +# @guid: the globally unique identifier
> >> +#
> >> +# Since: 2.9
> >> +##
> >> +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> >> +
> >> +##
> >> +# @query-vm-generation-id:
> >> +#
> >> +# Show Virtual Machine Generation ID
> >> +#
> >> +# Since: 2.9
> >> +##
> >> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> >> +
> >>   ##
> >>   # @LostTickPolicy:
> >>   #
> >> diff --git a/qapi/misc.json b/qapi/misc.json
> >> index f70025f34c..8c02870227 100644
> >> --- a/qapi/misc.json
> >> +++ b/qapi/misc.json
> >> @@ -1383,24 +1383,3 @@
> >>   #
> >>   ##
> >>   { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
> >> -
> >> -##
> >> -# @GuidInfo:
> >> -#
> >> -# GUID information.
> >> -#
> >> -# @guid: the globally unique identifier
> >> -#
> >> -# Since: 2.9
> >> -##
> >> -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
> >> -
> >> -##
> >> -# @query-vm-generation-id:
> >> -#
> >> -# Show Virtual Machine Generation ID
> >> -#
> >> -# Since: 2.9
> >> -##
> >> -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }  
> 
> Daniel explained on IRC the GUID structure is "standardized by microsoft 
> as a way to detect when a guest has certain operations applied" to a 
> saved snapshot.
> 
> https://docs.microsoft.com/en-us/windows/win32/hyperv_v2/virtual-machine-generation-identifier 
> 
> 
> So this one goes to qapi/block-core.json, right?

I think it belongs to machine

> 
> >> -
> >> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
> >> index 2df7623d74..2b26bacaf8 100644
> >> --- a/hw/acpi/vmgenid.c
> >> +++ b/hw/acpi/vmgenid.c
> >> @@ -12,7 +12,7 @@
> >>   
> >>   #include "qemu/osdep.h"
> >>   #include "qapi/error.h"
> >> -#include "qapi/qapi-commands-misc.h"
> >> +#include "qapi/qapi-commands-machine.h"
> >>   #include "qemu/module.h"
> >>   #include "hw/acpi/acpi.h"
> >>   #include "hw/acpi/aml-build.h"
> >> diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
> >> index 568e42b064..bfad656c6c 100644
> >> --- a/stubs/vmgenid.c
> >> +++ b/stubs/vmgenid.c
> >> @@ -1,6 +1,6 @@
> >>   #include "qemu/osdep.h"
> >>   #include "qapi/error.h"
> >> -#include "qapi/qapi-commands-misc.h"
> >> +#include "qapi/qapi-commands-machine.h"
> >>   #include "qapi/qmp/qerror.h"
> >>   
> >>   GuidInfo *qmp_query_vm_generation_id(Error **errp)  
> >   
>
diff mbox series

Patch

diff --git a/qapi/machine.json b/qapi/machine.json
index c096efbea3..1a2a4b0d48 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -415,6 +415,26 @@ 
 ##
 { 'command': 'query-target', 'returns': 'TargetInfo' }
 
+##
+# @GuidInfo:
+#
+# GUID information.
+#
+# @guid: the globally unique identifier
+#
+# Since: 2.9
+##
+{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
+
+##
+# @query-vm-generation-id:
+#
+# Show Virtual Machine Generation ID
+#
+# Since: 2.9
+##
+{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
+
 ##
 # @LostTickPolicy:
 #
diff --git a/qapi/misc.json b/qapi/misc.json
index f70025f34c..8c02870227 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1383,24 +1383,3 @@ 
 #
 ##
 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
-
-##
-# @GuidInfo:
-#
-# GUID information.
-#
-# @guid: the globally unique identifier
-#
-# Since: 2.9
-##
-{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
-
-##
-# @query-vm-generation-id:
-#
-# Show Virtual Machine Generation ID
-#
-# Since: 2.9
-##
-{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
-
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 2df7623d74..2b26bacaf8 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -12,7 +12,7 @@ 
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qemu/module.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/aml-build.h"
diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
index 568e42b064..bfad656c6c 100644
--- a/stubs/vmgenid.c
+++ b/stubs/vmgenid.c
@@ -1,6 +1,6 @@ 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-commands-machine.h"
 #include "qapi/qmp/qerror.h"
 
 GuidInfo *qmp_query_vm_generation_id(Error **errp)