libvirt/qemu-capabilities-Introduce-QEMU_CAPS_OBJECT_QAPIFIE.patch
yezengruan ab887478b0 update patch with openeuler !58
qemuMonitorJSONSetMigrationParams: Take double pointer for @params
qemuMonitorJSONAddObject: Take double pointer for @props
:qemuMonitorJSONMakeCommandInternal: Clear @arguments when stolen
qemuMonitorAddObject: Fix semantics of @alias
qemuMonitorAddObject: Refactor cleanup
util: json: Replace virJSONValueObjectSteal by virJSONValueObjectRemoveKey
qemu: command: Generate commandline of 'masterKey0' secret via JSON
qemu: command: Generate commandline of 'sev0' sev-guest object via JSON
qemu: command: Generate commandline of iothread objects JSON
qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED
qemu: monitor: Make wrapping of 'props' of 'object-add' optional
qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps
qemu: monitor: Don't add 'props' wrapper if qemu has QEMU_CAPS_OBJECT_QAPIFIED
qemu: command: Use JSON for QAPIfied -object directly
tests: qemuxml2argv: Validate generation of JSON props for object-add
qemu: capabilities: Enable detection of QEMU_CAPS_OBJECT_QAPIFIED

Signed-off-by: yezengruan <yezengruan@huawei.com>
(cherry picked from commit da25da87c49d1b576b48fd58614ff43833a04f37)
2022-03-24 16:20:58 +08:00

57 lines
2.1 KiB
Diff

From a604b93e9f9f6033d5fe251f84591fb6474e2386 Mon Sep 17 00:00:00 2001
From: Yan Wang <wangyan122@huawei.com>
Date: Thu, 24 Mar 2022 12:41:43 +0800
Subject: [PATCH 10/16] qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED
Starting from qemu-6.0 the parameters of -object/object-add are formally
described by the QAPI schema. Additionally this changes the nesting of
the properties as the 'props' nested object will be flattened to the
parent.
We'll need to detect whether qemu switched to this new approach to
generate the objects with proper nesting and also allow testing.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
---
src/qemu/qemu_capabilities.c | 8 +++++---
src/qemu/qemu_capabilities.h | 2 ++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0fb3e74c77..e232a37b79 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -569,9 +569,11 @@ VIR_ENUM_IMPL(virQEMUCaps,
"blockdev-reopen",
"storage.werror",
- "migration-param.bandwidth",
- "migration-param.downtime",
- "migration-param.xbzrle-cache-size",
+ "migration-param.bandwidth",
+ "migration-param.downtime",
+ "migration-param.xbzrle-cache-size",
+
+ "object.qapified",
);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 10a6ce50e7..ffb366f84a 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -554,6 +554,8 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_MIGRATION_PARAM_DOWNTIME, /* downtime-limit field in migrate-set-parameters */
QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE, /* xbzrle-cache-size field in migrate-set-parameters */
+ QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */
+
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
--
2.27.0