In libvirt we already use `query-command-line-options` QMP command but
that is useless as it doesn't provide correct data for `-machine`
option. So we need a new and better way to get that data.

We already use `qom-list-properties` to get options for specific machine
types so we can reuse it to get options for special `none` machine type
as a generic arch independent machine type.

Signed-off-by: Pavel Hrdina <phrd...@redhat.com>
---
 src/qemu/qemu_capabilities.c | 10 ++++++++++
 src/qemu/qemu_capabilities.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 2b9ab9af60..da1ca34129 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -632,6 +632,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
               "input-linux",
               "virtio-gpu-gl-pci",
               "virtio-vga-gl",
+
+              /* 405 */
+              "confidential-guest-support",
     );
 
 
@@ -1756,6 +1759,10 @@ static struct virQEMUCapsStringFlags 
virQEMUCapsMachinePropsVirt[] = {
     { "iommu", QEMU_CAPS_MACHINE_VIRT_IOMMU },
 };
 
+static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsGeneric[] = {
+    { "confidential-guest-support", 
QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT },
+};
+
 static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] = {
     { "pseries", virQEMUCapsMachinePropsPSeries,
       G_N_ELEMENTS(virQEMUCapsMachinePropsPSeries),
@@ -1763,6 +1770,9 @@ static virQEMUCapsObjectTypeProps 
virQEMUCapsMachineProps[] = {
     { "virt", virQEMUCapsMachinePropsVirt,
       G_N_ELEMENTS(virQEMUCapsMachinePropsVirt),
       -1 },
+    { "none", virQEMUCapsMachinePropsGeneric,
+      G_N_ELEMENTS(virQEMUCapsMachinePropsGeneric),
+      -1 },
 };
 
 static void
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index eac3e099b1..8af5251f2e 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -613,6 +613,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
     QEMU_CAPS_VIRTIO_GPU_GL_PCI, /* -device virtio-gpu-gl-pci */
     QEMU_CAPS_VIRTIO_VGA_GL, /* -device virtio-vga-gl */
 
+    /* 405 */
+    QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT, /* -machine 
confidential-guest-support */
+
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
 
-- 
2.31.1

Reply via email to