[PATCH] qemu: Add I/O thread support info into domain capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 docs/schemas/domaincaps.rng                           |  9 +++++++++
 src/conf/domain_capabilities.c                        |  3 +++
 src/conf/domain_capabilities.h                        |  1 +
 src/qemu/qemu_capabilities.c                          | 11 +++++++++++
 .../domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml |  1 +
 tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml      |  1 +
 tests/domaincapsschemadata/qemu_2.12.0.s390x.xml      |  1 +
 tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml     |  1 +
 .../domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml  |  1 +
 tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml     |  1 +
 tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml       |  1 +
 tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml      |  1 +
 tests/domaincapsschemadata/qemu_2.7.0.s390x.xml       |  1 +
 tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsschemadata/qemu_2.8.0.s390x.xml       |  1 +
 tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml      |  1 +
 tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml  |  1 +
 tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml  |  1 +
 tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml      |  1 +
 19 files changed, 39 insertions(+)

diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng
index 39053181eb9a..dca5fa1c8fa0 100644
--- a/docs/schemas/domaincaps.rng
+++ b/docs/schemas/domaincaps.rng
@@ -28,6 +28,9 @@
         <optional>
           <ref name='vcpu'/>
         </optional>
+        <optional>
+          <ref name='iothreads'/>
+        </optional>
         <optional>
           <ref name='os'/>
         </optional>
@@ -53,6 +56,12 @@
     </element>
   </define>
 
+  <define name='iothreads'>
+    <element name='iothreads'>
+      <empty/>
+    </element>
+  </define>
+
   <define name='loader'>
     <element name='loader'>
       <ref name='supported'/>
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index bebbaf44d00e..87a2ce34542d 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -562,6 +562,9 @@ virDomainCapsFormat(virDomainCapsPtr const caps)
     if (caps->maxvcpus)
         virBufferAsprintf(&buf, "<vcpu max='%d'/>\n", caps->maxvcpus);
 
+    if (caps->iothreads)
+        virBufferAddLit(&buf, "<iothreads/>\n");
+
     virDomainCapsOSFormat(&buf, &caps->os);
     virDomainCapsCPUFormat(&buf, &caps->cpu);
 
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index fa4c1e442f57..3b5ce214d636 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -147,6 +147,7 @@ struct _virDomainCaps {
 
     /* Some machine specific info */
     int maxvcpus;
+    bool iothreads;  /* Whether I/O threads are supported or not. */
 
     virDomainCapsOS os;
     virDomainCapsCPU cpu;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 833c75514c25..00634abb1649 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4632,6 +4632,16 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
 }
 
 
+static int
+virQEMUCapsFillDomainIOThreadCaps(virQEMUCapsPtr qemuCaps,
+                                  virDomainCapsPtr domCaps)
+{
+    domCaps->iothreads = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD);
+
+    return 0;
+}
+
+
 static int
 virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
                                     const char *machine,
@@ -4866,6 +4876,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps,
 
     if (virQEMUCapsFillDomainOSCaps(os, firmwares, nfirmwares) < 0 ||
         virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps) < 0 ||
+        virQEMUCapsFillDomainIOThreadCaps(qemuCaps, domCaps) < 0 ||
         virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps,
                                             domCaps->machine, disk) < 0 ||
         virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 ||
diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
index 9cba942fbf8e..47eb0ca571f9 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
@@ -4,6 +4,7 @@
   <machine>virt-2.12</machine>
   <arch>aarch64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
index 4029e9e386a9..559e8c37a82f 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
@@ -4,6 +4,7 @@
   <machine>pseries-2.12</machine>
   <arch>ppc64</arch>
   <vcpu max='1024'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
index 50680c1ef8d2..a437209e45b1 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
@@ -4,6 +4,7 @@
   <machine>s390-ccw-virtio-2.12</machine>
   <arch>s390x</arch>
   <vcpu max='248'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
index 851d914bc9c6..5a3cc5bd1dac 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.12</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
index 7c019b230868..0a5d54f3fde6 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
@@ -4,6 +4,7 @@
   <machine>virt-2.6</machine>
   <arch>aarch64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
index 3b142806217b..6311425bd3d9 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
@@ -4,6 +4,7 @@
   <machine>integratorcp</machine>
   <arch>aarch64</arch>
   <vcpu max='1'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
index 98c72d36de04..5f228bac6924 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
@@ -4,6 +4,7 @@
   <machine>pseries-2.6</machine>
   <arch>ppc64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
index de81886237ee..0fe1f61e7716 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.6</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
index b93d00ece197..73436b69ea7f 100644
--- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
@@ -4,6 +4,7 @@
   <machine>s390-ccw-virtio-2.7</machine>
   <arch>s390x</arch>
   <vcpu max='248'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
index d860cd833fed..f2d728b0f72e 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.8</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
index ee40d1e84ec3..1f22724912c5 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
@@ -4,6 +4,7 @@
   <machine>s390-ccw-virtio-2.8</machine>
   <arch>s390x</arch>
   <vcpu max='248'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
index 33161f7b8234..94f6acb100cf 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.8</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
index 07e1db641a76..8fe95efad421 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-q35-2.9</machine>
   <arch>x86_64</arch>
   <vcpu max='288'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
index 6c2bbac190c7..4dd15fd0dddc 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.9</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
index 2fc3b721389d..f7077d2b75b1 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
@@ -4,6 +4,7 @@
   <machine>pc-i440fx-2.9</machine>
   <arch>x86_64</arch>
   <vcpu max='255'/>
+  <iothreads/>
   <os supported='yes'>
     <loader supported='yes'>
       <value>/usr/share/AAVMF/AAVMF_CODE.fd</value>
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux