[PATCH 1/7] qemu_capabilities: Introduce QEMU_CAPS_THREAD_CONTEXT

Michal Privoznik mprivozn at redhat.com
Mon Nov 14 15:35:29 UTC 2022


In its commit v7.1.0-1429-g7208429223 QEMU gained new object
thread-context, which allows running specialized tasks with
affinity set to a given subset of host CPUs/NUMA nodes. Even
though only memory allocation task accepts this new object, it's
exactly what we aim to implement in libvirt. Therefore, introduce
a new capability to track whether QEMU is capable of this object.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_capabilities.c                     | 2 ++
 src/qemu/qemu_capabilities.h                     | 1 +
 tests/qemucapabilitiesdata/caps_7.2.0.x86_64.xml | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index d3ba8c85c9..965af45cb2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -678,6 +678,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
               "query-stats", /* QEMU_CAPS_QUERY_STATS */
               "query-stats-schemas", /* QEMU_CAPS_QUERY_STATS_SCHEMAS */
               "sgx-epc", /* QEMU_CAPS_SGX_EPC */
+              "thread-context", /* QEMU_CAPS_THREAD_CONTEXT */
     );
 
 
@@ -1384,6 +1385,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI },
     { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI },
     { "sgx-epc", QEMU_CAPS_SGX_EPC },
+    { "thread-context", QEMU_CAPS_THREAD_CONTEXT },
 };
 
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index dfa3d8cd9b..b70c02c05b 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -657,6 +657,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
     QEMU_CAPS_QUERY_STATS,  /* accepts query-stats */
     QEMU_CAPS_QUERY_STATS_SCHEMAS,  /* accepts query-stats-schemas */
     QEMU_CAPS_SGX_EPC, /* -object sgx-epc,... */
+    QEMU_CAPS_THREAD_CONTEXT, /* -object thread-context */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0.x86_64.xml
index 6a861eea24..b478c53502 100644
--- a/tests/qemucapabilitiesdata/caps_7.2.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_7.2.0.x86_64.xml
@@ -199,6 +199,7 @@
   <flag name='migration.blocked-reasons'/>
   <flag name='query-stats'/>
   <flag name='query-stats-schemas'/>
+  <flag name='thread-context'/>
   <version>7001050</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>43100245</microcodeVersion>
-- 
2.37.4



More information about the libvir-list mailing list