render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
c1c534
From 92a9394006873d494610bad839255363c36e65c3 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <92a9394006873d494610bad839255363c36e65c3@dist-git>
c1c534
From: Michal Privoznik <mprivozn@redhat.com>
c1c534
Date: Mon, 4 Dec 2017 13:38:51 +0100
c1c534
Subject: [PATCH] qemu_capabilities: Introcude QEMU_CAPS_NUMA_DIST
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1454889
c1c534
c1c534
This capability says if qemu is capable of specifying distances
c1c534
between NUMA nodes on the command line. Unfortunately, there's no
c1c534
real way to check this and thus we have to go with version check.
c1c534
QEMU introduced this in 0f203430dd8 (and friend) which was
c1c534
released in 2.10.0.
c1c534
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Reviewed-by: John Ferlan <jferlan@redhat.com>
c1c534
(cherry picked from commit 13e148ebda9ef0a064aa811aa14bcbb35c157ceb)
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
c1c534
 Conflicts:
c1c534
	src/qemu/qemu_capabilities.c
c1c534
	src/qemu/qemu_capabilities.h
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
c1c534
        - Context as some capabilities are not backported.
c1c534
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_capabilities.c                      | 6 +++++-
c1c534
 src/qemu/qemu_capabilities.h                      | 2 +-
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml  | 1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml  | 1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
c1c534
 5 files changed, 9 insertions(+), 2 deletions(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
c1c534
index ae5448eaaa..d1677144b7 100644
c1c534
--- a/src/qemu/qemu_capabilities.c
c1c534
+++ b/src/qemu/qemu_capabilities.c
c1c534
@@ -449,7 +449,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
c1c534
 
c1c534
               /* 275 */
c1c534
               "sclplmconsole",
c1c534
-
c1c534
+              "numa.dist",
c1c534
               "disk-share-rw",
c1c534
 
c1c534
               "isa-serial",
c1c534
@@ -4808,6 +4808,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
c1c534
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
c1c534
     }
c1c534
 
c1c534
+    /* no way to query for -numa dist */
c1c534
+    if (qemuCaps->version >= 2010000)
c1c534
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST);
c1c534
+
c1c534
     if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
c1c534
         goto cleanup;
c1c534
 
c1c534
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
c1c534
index c809f83404..3e016b7c79 100644
c1c534
--- a/src/qemu/qemu_capabilities.h
c1c534
+++ b/src/qemu/qemu_capabilities.h
c1c534
@@ -435,7 +435,7 @@ typedef enum {
c1c534
 
c1c534
     /* 275 */
c1c534
     QEMU_CAPS_DEVICE_SCLPLMCONSOLE, /* -device sclplmconsole */
c1c534
-
c1c534
+    QEMU_CAPS_NUMA_DIST, /* -numa dist */
c1c534
     QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */
c1c534
 
c1c534
     QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
index 23356f4092..09cce92067 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
@@ -179,6 +179,7 @@
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
   <flag name='machine.pseries.resize-hpt'/>
c1c534
   <flag name='spapr-vty'/>
c1c534
+  <flag name='numa.dist'/>
c1c534
   <flag name='disk-share-rw'/>
c1c534
   <flag name='isa-serial'/>
c1c534
   <version>2010000</version>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
index 463c30c77a..00fe1cffa7 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
@@ -142,6 +142,7 @@
c1c534
   <flag name='vxhs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
   <flag name='sclplmconsole'/>
c1c534
+  <flag name='numa.dist'/>
c1c534
   <flag name='disk-share-rw'/>
c1c534
   <version>2010000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
index e04e530b95..2417251678 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
@@ -224,6 +224,7 @@
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='vxhs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='numa.dist'/>
c1c534
   <flag name='disk-share-rw'/>
c1c534
   <flag name='isa-serial'/>
c1c534
   <version>2010000</version>
c1c534
-- 
c1c534
2.15.1
c1c534