eBPF objects stored in the hash table during runtime. eBPF objects cached encoded in base64 in the .xml cache file. Signed-off-by: Andrew Melnychenko <andrew@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 130 ++++++++++++ src/qemu/qemu_capabilities.h | 4 + .../caps_9.0.0_sparc.replies | 95 +++++---- .../qemucapabilitiesdata/caps_9.0.0_sparc.xml | 3 + .../caps_9.0.0_x86_64.replies | 199 ++++++++++-------- .../caps_9.0.0_x86_64.xml | 3 + .../caps_9.1.0_x86_64.replies | 199 ++++++++++-------- .../caps_9.1.0_x86_64.xml | 3 + 8 files changed, 412 insertions(+), 224 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 29dfe8d35a..2d2603e519 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -804,6 +804,9 @@ struct _virQEMUCaps { virQEMUCapsAccel kvm; virQEMUCapsAccel hvf; virQEMUCapsAccel tcg; + + /* Hash of ebpf objects encoded in base64 */ + GHashTable *ebpfObjects; }; static virClass *virQEMUCapsClass; @@ -845,6 +848,14 @@ const char *virQEMUCapsArchToString(virArch arch) } +const char * +virQEMUCapsGetEbpf(virQEMUCaps *qemuCaps, + const char *id) +{ + return virHashLookup(qemuCaps->ebpfObjects, id); +} + + /* Checks whether a domain with @guest arch can run natively on @host. */ bool @@ -1824,6 +1835,8 @@ virQEMUCapsNew(void) qemuCaps->invalidation = true; qemuCaps->flags = virBitmapNew(QEMU_CAPS_LAST); + qemuCaps->ebpfObjects = virHashNew(g_free); + return qemuCaps; } @@ -1966,6 +1979,9 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) { g_autoptr(virQEMUCaps) ret = virQEMUCapsNewBinary(qemuCaps->binary); size_t i; + GHashTableIter iter; + const char *key; + const char *value; ret->invalidation = qemuCaps->invalidation; ret->kvmSupportsNesting = qemuCaps->kvmSupportsNesting; @@ -2004,6 +2020,12 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) ret->hypervCapabilities = g_memdup(qemuCaps->hypervCapabilities, sizeof(virDomainCapsFeatureHyperv)); + ret->ebpfObjects = virHashNew(g_free); + g_hash_table_iter_init(&iter, qemuCaps->ebpfObjects); + while (g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &value)) { + g_hash_table_insert(ret->ebpfObjects, g_strdup(key), g_strdup(value)); + } + return g_steal_pointer(&ret); } @@ -2046,6 +2068,8 @@ void virQEMUCapsDispose(void *obj) g_free(qemuCaps->hypervCapabilities); + g_hash_table_destroy(qemuCaps->ebpfObjects); + virQEMUCapsAccelClear(&qemuCaps->kvm); virQEMUCapsAccelClear(&qemuCaps->hvf); virQEMUCapsAccelClear(&qemuCaps->tcg); @@ -4563,6 +4587,41 @@ virQEMUCapsValidateArch(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt) } +static int +virQEMUCapsParseEbpfObjects(virQEMUCaps *qemuCaps, + xmlXPathContextPtr ctxt) +{ + g_autofree xmlNodePtr *nodes = NULL; + size_t i; + int n; + + if ((n = virXPathNodeSet("./ebpf/object", ctxt, &nodes)) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to parse qemu cached eBPF object")); + return -1; + } + + for (i = 0; i < n; i++) { + g_autofree char *id = NULL; + g_autofree char *ebpf = NULL; + + if (!(id = virXMLPropStringRequired(nodes[i], "id"))) + return -1; + + if (!(ebpf = virXMLPropStringRequired(nodes[i], "data"))) + return -1; + + if (virHashAddEntry(qemuCaps->ebpfObjects, id, ebpf) < 0) + return -1; + + /* steal the ebpf if it was added to the hash without issues */ + g_steal_pointer(&ebpf); + } + + return 0; +} + + /* * Parsing a doc that looks like * @@ -4710,6 +4769,9 @@ virQEMUCapsLoadCache(virArch hostArch, if (skipInvalidation) qemuCaps->invalidation = false; + if (virQEMUCapsParseEbpfObjects(qemuCaps, ctxt) < 0) + return -1; + return 0; } @@ -4947,6 +5009,18 @@ virQEMUCapsFormatHypervCapabilities(virQEMUCaps *qemuCaps, } +static int +virQEMUCapsFormatEbpfObjectsIterator(void *payload, + const char *name, + void *opaque) +{ + virBuffer *buf = opaque; + + virBufferAsprintf(buf, "<object id='%s' data='%s'/>\n", name, (const char *)payload); + + return 0; +} + char * virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) { @@ -5037,6 +5111,14 @@ virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) if (qemuCaps->kvmSupportsSecureGuest) virBufferAddLit(&buf, "<kvmSupportsSecureGuest/>\n"); + if (virHashSize(qemuCaps->ebpfObjects) > 0) { + virBufferAddLit(&buf, "<ebpf>\n"); + virBufferAdjustIndent(&buf, 2); + virHashForEachSorted(qemuCaps->ebpfObjects, virQEMUCapsFormatEbpfObjectsIterator, &buf); + virBufferAdjustIndent(&buf, -2); + virBufferAddLit(&buf, "</ebpf>\n"); + } + virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</qemuCaps>\n"); @@ -5453,6 +5535,51 @@ virQEMUCapsInitProcessCaps(virQEMUCaps *qemuCaps) } +static int +virQEMUCapsProbeQMPEbpfObject(virQEMUCaps *qemuCaps, + const char *id, + qemuMonitor *mon) +{ + const char *ebpfObject = NULL; + + ebpfObject = qemuMonitorGetEbpf(mon, id); + if (ebpfObject == NULL) + return -1; + + return virHashAddEntry(qemuCaps->ebpfObjects, id, (void *)ebpfObject); +} + + +static int +virQEMUCapsProbeQMPSchemaEbpf(virQEMUCaps *qemuCaps, + GHashTable *schema, + qemuMonitor *mon) +{ + virJSONValue *ebpfIdsArray; + virJSONValue *ebpfIdsSchema; + size_t i; + + if (virQEMUQAPISchemaPathGet("request-ebpf/arg-type/id", schema, &ebpfIdsSchema) != 1) + return 0; + + if (!(ebpfIdsArray = virJSONValueObjectGetArray(ebpfIdsSchema, "values"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("malformed QMP schema of 'request-ebpf'")); + return -1; + } + + /* Try to request every eBPF */ + for (i = 0; i < virJSONValueArraySize(ebpfIdsArray); i++) { + virJSONValue *id = virJSONValueArrayGet(ebpfIdsArray, i); + + if (virQEMUCapsProbeQMPEbpfObject(qemuCaps, virJSONValueGetString(id), mon) < 0) + return -1; + } + + return 0; +} + + static int virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *qemuCaps, qemuMonitor *mon) @@ -5486,6 +5613,9 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *qemuCaps, virQEMUQAPISchemaPathExists("block-stream/arg-type/backing-mask-protocol", schema)) virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL); + if (virQEMUCapsProbeQMPSchemaEbpf(qemuCaps, schema, mon) < 0) + return -1; + return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 51d951771d..2c53236132 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -917,3 +917,7 @@ int virQEMUCapsProbeQMPMachineTypes(virQEMUCaps *qemuCaps, virDomainVirtType virtType, qemuMonitor *mon); + +const char * +virQEMUCapsGetEbpf(virQEMUCaps *qemuCaps, + const char *id); diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.replies b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.replies index 9ddfcfae21..e1f46336c9 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.replies +++ b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.replies @@ -23356,21 +23356,36 @@ } { - "execute": "query-kvm", + "execute": "request-ebpf", + "arguments": { + "id": "rss" + }, "id": "libvirt-5" } +{ + "return": { + "object": "Test data" + }, + "id": "libvirt-5" +} + +{ + "execute": "query-kvm", + "id": "libvirt-6" +} + { "return": { "enabled": false, "present": false }, - "id": "libvirt-5" + "id": "libvirt-6" } { "execute": "qom-list-types", - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -23976,7 +23991,7 @@ "parent": "base-sysbus-fdc" } ], - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -23984,11 +23999,11 @@ "arguments": { "typename": "virtio-blk-pci" }, - "id": "libvirt-7" + "id": "libvirt-8" } { - "id": "libvirt-7", + "id": "libvirt-8", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-pci' not found" @@ -24000,7 +24015,7 @@ "arguments": { "typename": "scsi-hd" }, - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -24201,7 +24216,7 @@ "type": "int32" } ], - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -24209,11 +24224,11 @@ "arguments": { "typename": "ide-hd" }, - "id": "libvirt-9" + "id": "libvirt-10" } { - "id": "libvirt-9", + "id": "libvirt-10", "error": { "class": "DeviceNotFound", "desc": "Device 'ide-hd' not found" @@ -24225,11 +24240,11 @@ "arguments": { "typename": "PIIX4_PM" }, - "id": "libvirt-10" + "id": "libvirt-11" } { - "id": "libvirt-10", + "id": "libvirt-11", "error": { "class": "DeviceNotFound", "desc": "Device 'PIIX4_PM' not found" @@ -24241,11 +24256,11 @@ "arguments": { "typename": "kvm-pit" }, - "id": "libvirt-11" + "id": "libvirt-12" } { - "id": "libvirt-11", + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'kvm-pit' not found" @@ -24257,11 +24272,11 @@ "arguments": { "typename": "ICH9-LPC" }, - "id": "libvirt-12" + "id": "libvirt-13" } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -24273,11 +24288,11 @@ "arguments": { "typename": "virtio-balloon-pci" }, - "id": "libvirt-13" + "id": "libvirt-14" } { - "id": "libvirt-13", + "id": "libvirt-14", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-pci' not found" @@ -24289,11 +24304,11 @@ "arguments": { "typename": "virtio-balloon-ccw" }, - "id": "libvirt-14" + "id": "libvirt-15" } { - "id": "libvirt-14", + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -24305,11 +24320,11 @@ "arguments": { "typename": "virtio-balloon-device" }, - "id": "libvirt-15" + "id": "libvirt-16" } { - "id": "libvirt-15", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -24321,11 +24336,11 @@ "arguments": { "typename": "usb-host" }, - "id": "libvirt-16" + "id": "libvirt-17" } { - "id": "libvirt-16", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-host' not found" @@ -24337,7 +24352,7 @@ "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -24431,7 +24446,7 @@ "type": "bool" } ], - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -24439,7 +24454,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-18" + "id": "libvirt-19" } { @@ -24518,12 +24533,12 @@ "type": "int" } ], - "id": "libvirt-18" + "id": "libvirt-19" } { "execute": "query-machines", - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -24639,7 +24654,7 @@ "default-ram-id": "ram" } ], - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -24647,7 +24662,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-20" + "id": "libvirt-21" } { @@ -24760,32 +24775,32 @@ "type": "child<container>" } ], - "id": "libvirt-20" + "id": "libvirt-21" } { "execute": "query-tpm-models", - "id": "libvirt-21" + "id": "libvirt-22" } { "return": [], - "id": "libvirt-21" + "id": "libvirt-22" } { "execute": "query-tpm-types", - "id": "libvirt-22" + "id": "libvirt-23" } { "return": [], - "id": "libvirt-22" + "id": "libvirt-23" } { "execute": "query-command-line-options", - "id": "libvirt-23" + "id": "libvirt-24" } { @@ -26118,12 +26133,12 @@ "option": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-24" } { "execute": "query-migrate-capabilities", - "id": "libvirt-24" + "id": "libvirt-25" } { @@ -26225,5 +26240,5 @@ "capability": "mapped-ram" } ], - "id": "libvirt-24" + "id": "libvirt-25" } diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml index 7fe971fc3a..3fbc83124a 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml +++ b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml @@ -93,4 +93,7 @@ <machine type='tcg' name='SS-600MP' maxCpus='4' defaultCPU='TI-SuperSparc-II-sparc-cpu' defaultRAMid='sun4m.ram' acpi='no'/> <machine type='tcg' name='SS-10' maxCpus='4' defaultCPU='TI-SuperSparc-II-sparc-cpu' defaultRAMid='sun4m.ram' acpi='no'/> <machine type='tcg' name='Voyager' maxCpus='1' defaultCPU='Fujitsu-MB86904-sparc-cpu' defaultRAMid='sun4m.ram' acpi='no'/> + <ebpf> + <object id='rss' data='Test data'/> + </ebpf> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.replies b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.replies index 5d36853ce3..b94625904b 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.replies @@ -23654,21 +23654,36 @@ } { - "execute": "query-kvm", + "execute": "request-ebpf", + "arguments": { + "id": "rss" + }, + "id": "libvirt-5" +} + +{ + "return": { + "object": "Test data" + }, "id": "libvirt-5" } +{ + "execute": "query-kvm", + "id": "libvirt-6" +} + { "return": { "enabled": true, "present": true }, - "id": "libvirt-5" + "id": "libvirt-6" } { "execute": "qom-list-types", - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -26378,7 +26393,7 @@ "parent": "x86_64-cpu" } ], - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -26386,7 +26401,7 @@ "arguments": { "typename": "virtio-blk-pci" }, - "id": "libvirt-7" + "id": "libvirt-8" } { @@ -26801,7 +26816,7 @@ "type": "bool" } ], - "id": "libvirt-7" + "id": "libvirt-8" } { @@ -26809,7 +26824,7 @@ "arguments": { "typename": "virtio-net-pci" }, - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -27268,7 +27283,7 @@ "type": "bool" } ], - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -27276,7 +27291,7 @@ "arguments": { "typename": "virtio-scsi-pci" }, - "id": "libvirt-9" + "id": "libvirt-10" } { @@ -27542,7 +27557,7 @@ "type": "child<virtio-scsi-device>" } ], - "id": "libvirt-9" + "id": "libvirt-10" } { @@ -27550,11 +27565,11 @@ "arguments": { "typename": "virtio-net-ccw" }, - "id": "libvirt-10" + "id": "libvirt-11" } { - "id": "libvirt-10", + "id": "libvirt-11", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -27566,11 +27581,11 @@ "arguments": { "typename": "virtio-scsi-ccw" }, - "id": "libvirt-11" + "id": "libvirt-12" } { - "id": "libvirt-11", + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-scsi-ccw' not found" @@ -27582,7 +27597,7 @@ "arguments": { "typename": "vfio-pci" }, - "id": "libvirt-12" + "id": "libvirt-13" } { @@ -27800,7 +27815,7 @@ "type": "int32" } ], - "id": "libvirt-12" + "id": "libvirt-13" } { @@ -27808,7 +27823,7 @@ "arguments": { "typename": "scsi-hd" }, - "id": "libvirt-13" + "id": "libvirt-14" } { @@ -28009,7 +28024,7 @@ "type": "int32" } ], - "id": "libvirt-13" + "id": "libvirt-14" } { @@ -28017,7 +28032,7 @@ "arguments": { "typename": "ide-hd" }, - "id": "libvirt-14" + "id": "libvirt-15" } { @@ -28168,7 +28183,7 @@ "type": "int32" } ], - "id": "libvirt-14" + "id": "libvirt-15" } { @@ -28176,7 +28191,7 @@ "arguments": { "typename": "PIIX4_PM" }, - "id": "libvirt-15" + "id": "libvirt-16" } { @@ -28299,7 +28314,7 @@ "type": "link<irq>" } ], - "id": "libvirt-15" + "id": "libvirt-16" } { @@ -28307,7 +28322,7 @@ "arguments": { "typename": "usb-redir" }, - "id": "libvirt-16" + "id": "libvirt-17" } { @@ -28363,7 +28378,7 @@ "type": "bool" } ], - "id": "libvirt-16" + "id": "libvirt-17" } { @@ -28371,7 +28386,7 @@ "arguments": { "typename": "usb-storage" }, - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -28486,7 +28501,7 @@ "type": "bool" } ], - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -28494,7 +28509,7 @@ "arguments": { "typename": "kvm-pit" }, - "id": "libvirt-18" + "id": "libvirt-19" } { @@ -28510,7 +28525,7 @@ "type": "LostTickPolicy" } ], - "id": "libvirt-18" + "id": "libvirt-19" } { @@ -28518,7 +28533,7 @@ "arguments": { "typename": "VGA" }, - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -28640,7 +28655,7 @@ "type": "uint32" } ], - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -28648,7 +28663,7 @@ "arguments": { "typename": "vmware-svga" }, - "id": "libvirt-20" + "id": "libvirt-21" } { @@ -28723,7 +28738,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-21" } { @@ -28731,7 +28746,7 @@ "arguments": { "typename": "qxl" }, - "id": "libvirt-21" + "id": "libvirt-22" } { @@ -28871,7 +28886,7 @@ "type": "int32" } ], - "id": "libvirt-21" + "id": "libvirt-22" } { @@ -28879,7 +28894,7 @@ "arguments": { "typename": "virtio-gpu-pci" }, - "id": "libvirt-22" + "id": "libvirt-23" } { @@ -29141,7 +29156,7 @@ "type": "child<virtio-gpu-device>" } ], - "id": "libvirt-22" + "id": "libvirt-23" } { @@ -29149,7 +29164,7 @@ "arguments": { "typename": "virtio-gpu-device" }, - "id": "libvirt-23" + "id": "libvirt-24" } { @@ -29249,7 +29264,7 @@ "type": "size" } ], - "id": "libvirt-23" + "id": "libvirt-24" } { @@ -29257,7 +29272,7 @@ "arguments": { "typename": "ICH9-LPC" }, - "id": "libvirt-24" + "id": "libvirt-25" } { @@ -29515,7 +29530,7 @@ "type": "link<irq>" } ], - "id": "libvirt-24" + "id": "libvirt-25" } { @@ -29523,7 +29538,7 @@ "arguments": { "typename": "virtio-balloon-pci" }, - "id": "libvirt-25" + "id": "libvirt-26" } { @@ -29778,7 +29793,7 @@ "type": "child<virtio-balloon-device>" } ], - "id": "libvirt-25" + "id": "libvirt-26" } { @@ -29786,11 +29801,11 @@ "arguments": { "typename": "virtio-balloon-ccw" }, - "id": "libvirt-26" + "id": "libvirt-27" } { - "id": "libvirt-26", + "id": "libvirt-27", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -29802,7 +29817,7 @@ "arguments": { "typename": "virtio-balloon-device" }, - "id": "libvirt-27" + "id": "libvirt-28" } { @@ -29906,7 +29921,7 @@ "type": "guest statistics" } ], - "id": "libvirt-27" + "id": "libvirt-28" } { @@ -29914,7 +29929,7 @@ "arguments": { "typename": "intel-iommu" }, - "id": "libvirt-28" + "id": "libvirt-29" } { @@ -29987,7 +30002,7 @@ "type": "bool" } ], - "id": "libvirt-28" + "id": "libvirt-29" } { @@ -29995,7 +30010,7 @@ "arguments": { "typename": "mch" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -30070,7 +30085,7 @@ "type": "uint16" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -30078,7 +30093,7 @@ "arguments": { "typename": "nvdimm" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -30120,7 +30135,7 @@ "type": "uint64" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -30128,7 +30143,7 @@ "arguments": { "typename": "pcie-root-port" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -30281,7 +30296,7 @@ "type": "size" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -30289,7 +30304,7 @@ "arguments": { "typename": "usb-host" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -30385,7 +30400,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -30393,7 +30408,7 @@ "arguments": { "typename": "vhost-user-fs-device" }, - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -30479,7 +30494,7 @@ "type": "int32" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -30487,7 +30502,7 @@ "arguments": { "typename": "virtio-mem-pci" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -30748,7 +30763,7 @@ "type": "child<virtio-mem>" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -30756,7 +30771,7 @@ "arguments": { "typename": "virtio-iommu-pci" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -31000,7 +31015,7 @@ "type": "child<virtio-iommu-device>" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -31008,7 +31023,7 @@ "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -31102,7 +31117,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -31110,7 +31125,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -31189,7 +31204,7 @@ "type": "int" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -31197,7 +31212,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -33114,12 +33129,12 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-machines", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -33755,7 +33770,7 @@ "default-ram-id": "pc.ram" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -33763,7 +33778,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -33876,12 +33891,12 @@ "type": "child<container>" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-cpu-definitions", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -36263,12 +36278,12 @@ "deprecated": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-tpm-models", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -36276,12 +36291,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-tpm-types", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -36289,12 +36304,12 @@ "passthrough", "emulator" ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-command-line-options", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -37769,12 +37784,12 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-migrate-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -37876,16 +37891,16 @@ "capability": "mapped-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } { "execute": "query-sev-capabilities", - "id": "libvirt-46" + "id": "libvirt-47" } { - "id": "libvirt-46", + "id": "libvirt-47", "error": { "class": "GenericError", "desc": "SEV: Failed to open /dev/sev: No such file or directory" @@ -37894,11 +37909,11 @@ { "execute": "query-sgx-capabilities", - "id": "libvirt-47" + "id": "libvirt-48" } { - "id": "libvirt-47", + "id": "libvirt-48", "error": { "class": "GenericError", "desc": "SGX is not enabled in KVM" @@ -37913,7 +37928,7 @@ "name": "host" } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -38281,7 +38296,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -38295,7 +38310,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -38663,7 +38678,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -38678,7 +38693,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } { @@ -39152,7 +39167,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } { diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml index b646377dec..dbe015d287 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml @@ -3693,4 +3693,7 @@ <cap name='ipi'/> <cap name='avic'/> </hypervCapabilities> + <ebpf> + <object id='rss' data='Test data'/> + </ebpf> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.replies b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.replies index 96a8a8ed2b..019e2f26d9 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.replies @@ -23660,21 +23660,36 @@ } { - "execute": "query-kvm", + "execute": "request-ebpf", + "arguments": { + "id": "rss" + }, + "id": "libvirt-5" +} + +{ + "return": { + "object": "Test data" + }, "id": "libvirt-5" } +{ + "execute": "query-kvm", + "id": "libvirt-6" +} + { "return": { "enabled": true, "present": true }, - "id": "libvirt-5" + "id": "libvirt-6" } { "execute": "qom-list-types", - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -26404,7 +26419,7 @@ "parent": "x86_64-cpu" } ], - "id": "libvirt-6" + "id": "libvirt-7" } { @@ -26412,7 +26427,7 @@ "arguments": { "typename": "virtio-blk-pci" }, - "id": "libvirt-7" + "id": "libvirt-8" } { @@ -26821,7 +26836,7 @@ "type": "bool" } ], - "id": "libvirt-7" + "id": "libvirt-8" } { @@ -26829,7 +26844,7 @@ "arguments": { "typename": "virtio-net-pci" }, - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -27288,7 +27303,7 @@ "type": "bool" } ], - "id": "libvirt-8" + "id": "libvirt-9" } { @@ -27296,7 +27311,7 @@ "arguments": { "typename": "virtio-scsi-pci" }, - "id": "libvirt-9" + "id": "libvirt-10" } { @@ -27562,7 +27577,7 @@ "type": "child<virtio-scsi-device>" } ], - "id": "libvirt-9" + "id": "libvirt-10" } { @@ -27570,11 +27585,11 @@ "arguments": { "typename": "virtio-net-ccw" }, - "id": "libvirt-10" + "id": "libvirt-11" } { - "id": "libvirt-10", + "id": "libvirt-11", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -27586,11 +27601,11 @@ "arguments": { "typename": "virtio-scsi-ccw" }, - "id": "libvirt-11" + "id": "libvirt-12" } { - "id": "libvirt-11", + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-scsi-ccw' not found" @@ -27602,7 +27617,7 @@ "arguments": { "typename": "vfio-pci" }, - "id": "libvirt-12" + "id": "libvirt-13" } { @@ -27830,7 +27845,7 @@ "type": "int32" } ], - "id": "libvirt-12" + "id": "libvirt-13" } { @@ -27838,7 +27853,7 @@ "arguments": { "typename": "scsi-hd" }, - "id": "libvirt-13" + "id": "libvirt-14" } { @@ -28039,7 +28054,7 @@ "type": "int32" } ], - "id": "libvirt-13" + "id": "libvirt-14" } { @@ -28047,7 +28062,7 @@ "arguments": { "typename": "ide-hd" }, - "id": "libvirt-14" + "id": "libvirt-15" } { @@ -28198,7 +28213,7 @@ "type": "int32" } ], - "id": "libvirt-14" + "id": "libvirt-15" } { @@ -28206,7 +28221,7 @@ "arguments": { "typename": "PIIX4_PM" }, - "id": "libvirt-15" + "id": "libvirt-16" } { @@ -28329,7 +28344,7 @@ "type": "link<irq>" } ], - "id": "libvirt-15" + "id": "libvirt-16" } { @@ -28337,7 +28352,7 @@ "arguments": { "typename": "usb-redir" }, - "id": "libvirt-16" + "id": "libvirt-17" } { @@ -28393,7 +28408,7 @@ "type": "bool" } ], - "id": "libvirt-16" + "id": "libvirt-17" } { @@ -28401,7 +28416,7 @@ "arguments": { "typename": "usb-storage" }, - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -28516,7 +28531,7 @@ "type": "bool" } ], - "id": "libvirt-17" + "id": "libvirt-18" } { @@ -28524,7 +28539,7 @@ "arguments": { "typename": "kvm-pit" }, - "id": "libvirt-18" + "id": "libvirt-19" } { @@ -28540,7 +28555,7 @@ "type": "LostTickPolicy" } ], - "id": "libvirt-18" + "id": "libvirt-19" } { @@ -28548,7 +28563,7 @@ "arguments": { "typename": "VGA" }, - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -28670,7 +28685,7 @@ "type": "uint32" } ], - "id": "libvirt-19" + "id": "libvirt-20" } { @@ -28678,7 +28693,7 @@ "arguments": { "typename": "vmware-svga" }, - "id": "libvirt-20" + "id": "libvirt-21" } { @@ -28753,7 +28768,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-21" } { @@ -28761,7 +28776,7 @@ "arguments": { "typename": "qxl" }, - "id": "libvirt-21" + "id": "libvirt-22" } { @@ -28901,7 +28916,7 @@ "type": "int32" } ], - "id": "libvirt-21" + "id": "libvirt-22" } { @@ -28909,7 +28924,7 @@ "arguments": { "typename": "virtio-gpu-pci" }, - "id": "libvirt-22" + "id": "libvirt-23" } { @@ -29176,7 +29191,7 @@ "type": "child<virtio-gpu-device>" } ], - "id": "libvirt-22" + "id": "libvirt-23" } { @@ -29184,7 +29199,7 @@ "arguments": { "typename": "virtio-gpu-device" }, - "id": "libvirt-23" + "id": "libvirt-24" } { @@ -29289,7 +29304,7 @@ "type": "size" } ], - "id": "libvirt-23" + "id": "libvirt-24" } { @@ -29297,7 +29312,7 @@ "arguments": { "typename": "ICH9-LPC" }, - "id": "libvirt-24" + "id": "libvirt-25" } { @@ -29555,7 +29570,7 @@ "type": "link<irq>" } ], - "id": "libvirt-24" + "id": "libvirt-25" } { @@ -29563,7 +29578,7 @@ "arguments": { "typename": "virtio-balloon-pci" }, - "id": "libvirt-25" + "id": "libvirt-26" } { @@ -29818,7 +29833,7 @@ "type": "child<virtio-balloon-device>" } ], - "id": "libvirt-25" + "id": "libvirt-26" } { @@ -29826,11 +29841,11 @@ "arguments": { "typename": "virtio-balloon-ccw" }, - "id": "libvirt-26" + "id": "libvirt-27" } { - "id": "libvirt-26", + "id": "libvirt-27", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -29842,7 +29857,7 @@ "arguments": { "typename": "virtio-balloon-device" }, - "id": "libvirt-27" + "id": "libvirt-28" } { @@ -29946,7 +29961,7 @@ "type": "guest statistics" } ], - "id": "libvirt-27" + "id": "libvirt-28" } { @@ -29954,7 +29969,7 @@ "arguments": { "typename": "intel-iommu" }, - "id": "libvirt-28" + "id": "libvirt-29" } { @@ -30027,7 +30042,7 @@ "type": "bool" } ], - "id": "libvirt-28" + "id": "libvirt-29" } { @@ -30035,7 +30050,7 @@ "arguments": { "typename": "mch" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -30110,7 +30125,7 @@ "type": "uint16" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -30118,7 +30133,7 @@ "arguments": { "typename": "nvdimm" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -30160,7 +30175,7 @@ "type": "uint64" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -30168,7 +30183,7 @@ "arguments": { "typename": "pcie-root-port" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -30321,7 +30336,7 @@ "type": "size" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -30329,7 +30344,7 @@ "arguments": { "typename": "usb-host" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -30425,7 +30440,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -30433,7 +30448,7 @@ "arguments": { "typename": "vhost-user-fs-device" }, - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -30519,7 +30534,7 @@ "type": "int32" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -30527,7 +30542,7 @@ "arguments": { "typename": "virtio-mem-pci" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -30788,7 +30803,7 @@ "type": "child<virtio-mem>" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -30796,7 +30811,7 @@ "arguments": { "typename": "virtio-iommu-pci" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -31040,7 +31055,7 @@ "type": "child<virtio-iommu-device>" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -31048,7 +31063,7 @@ "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -31142,7 +31157,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -31150,7 +31165,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -31229,7 +31244,7 @@ "type": "int" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -31237,7 +31252,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -33282,12 +33297,12 @@ "type": "bool" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-machines", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -33943,7 +33958,7 @@ "default-ram-id": "pc.ram" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -33951,7 +33966,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -34064,12 +34079,12 @@ "type": "child<container>" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-cpu-definitions", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -36620,12 +36635,12 @@ "deprecated": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-tpm-models", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -36633,12 +36648,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-tpm-types", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -36646,12 +36661,12 @@ "passthrough", "emulator" ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-command-line-options", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -38134,12 +38149,12 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-migrate-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -38233,16 +38248,16 @@ "capability": "mapped-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } { "execute": "query-sev-capabilities", - "id": "libvirt-46" + "id": "libvirt-47" } { - "id": "libvirt-46", + "id": "libvirt-47", "error": { "class": "GenericError", "desc": "SEV is not configured" @@ -38251,11 +38266,11 @@ { "execute": "query-sgx-capabilities", - "id": "libvirt-47" + "id": "libvirt-48" } { - "id": "libvirt-47", + "id": "libvirt-48", "error": { "class": "GenericError", "desc": "SGX is not enabled in KVM" @@ -38270,7 +38285,7 @@ "name": "host" } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -38647,7 +38662,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -38661,7 +38676,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -39038,7 +39053,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -39053,7 +39068,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } { @@ -39540,7 +39555,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } { diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml index dc548583a5..b0c16a0440 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml @@ -3955,4 +3955,7 @@ <cap name='ipi'/> <cap name='avic'/> </hypervCapabilities> + <ebpf> + <object id='rss' data='Test data'/> + </ebpf> </qemuCaps> -- 2.45.2