]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_capabilities: introduce confidential-guest-support capability
authorPavel Hrdina <phrdina@redhat.com>
Mon, 14 Jun 2021 12:36:08 +0000 (14:36 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 15 Jun 2021 09:32:41 +0000 (11:32 +0200)
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 <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h

index 2b9ab9af606fc62fcacb1d734003a08e26fa8e34..da1ca34129459d3ca2484066db5d081750ee1405 100644 (file)
@@ -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
index eac3e099b1ea9342f7f5fc2c0702e6c9863716a4..8af5251f2ebe5c18bb4843c1d607276b76b93ec0 100644 (file)
@@ -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;