aboutsummaryrefslogtreecommitdiff
path: root/qga/qapi-schema.json
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-10-21 09:15:20 +0200
committerMichael Roth <michael.roth@amd.com>2020-11-02 08:14:36 -0600
commit0083124b3adb67bb740f1f06c2360335a5ce1533 (patch)
tree9684afe4afe62b5ae134542b86c359ff7c13b59d /qga/qapi-schema.json
parent939caddc2c24a9f4840e5d9d52eb0465deed1c47 (diff)
qga: Flatten simple union GuestDeviceId
Simple unions are simpler than flat unions in the schema, but more complicated in C and on the QMP wire: there's extra indirection in C and extra nesting on the wire, both pointless. They should be avoided in new code. GuestDeviceId was recently added for guest-get-devices. Convert it to a flat union. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Michael Roth <michael.roth@amd.com>
Diffstat (limited to 'qga/qapi-schema.json')
-rw-r--r--qga/qapi-schema.json8
1 files changed, 8 insertions, 0 deletions
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index c7bfb8bf6a..fe10631e4c 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1257,6 +1257,12 @@
'returns': 'GuestOSInfo' }
##
+# @GuestDeviceType:
+##
+{ 'enum': 'GuestDeviceType',
+ 'data': [ 'pci' ] }
+
+##
# @GuestDeviceIdPCI:
#
# @vendor-id: vendor ID
@@ -1276,6 +1282,8 @@
# Since: 5.2
##
{ 'union': 'GuestDeviceId',
+ 'base': { 'type': 'GuestDeviceType' },
+ 'discriminator': 'type',
'data': { 'pci': 'GuestDeviceIdPCI' } }
##