Blob Blame History Raw
From ff8d12140ce541923021e2669e6be8a324114ad5 Mon Sep 17 00:00:00 2001
Message-Id: <ff8d12140ce541923021e2669e6be8a324114ad5@dist-git>
From: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Date: Thu, 3 Aug 2017 10:11:47 +0200
Subject: [PATCH] qemu: capabilitity: Introduce
 QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE

The patch adds a capability for spapr-pci-host-bridge.numa_node.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 11b2ebf3e152ac27191f539334afcb660100ecc9)

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1474327

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_capabilities.c                       |   8 ++
 src/qemu/qemu_capabilities.h                       |   1 +
 .../caps_2.6.0.ppc64le.replies                     |  66 +++++++++++--
 .../caps_2.9.0.ppc64le.replies                     | 106 +++++++++++++++++++--
 tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml  |   1 +
 5 files changed, 162 insertions(+), 20 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index daf0c42c9a..a34206bd8a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -377,6 +377,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "virtio.iommu_platform",
               "virtio.ats",
               "spapr-pci-host-bridge",
+              "spapr-pci-host-bridge.numa_node",
     );
 
 
@@ -1644,6 +1645,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = {
     { "host_mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU },
 };
 
+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSpaprPCIHostBridge[] = {
+    { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE },
+};
+
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = {
     { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD },
 };
@@ -1844,6 +1849,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
     { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU),
       QEMU_CAPS_DEVICE_INTEL_IOMMU},
+    { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
+      QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
 };
 
 struct virQEMUCapsPropTypeObjects {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index f0739117d2..b4d1e35da2 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -416,6 +416,7 @@ typedef enum {
     QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */
     QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */
     QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, /* -device spapr-pci-host-bridge */
+    QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE, /* spapr-pci-host-bridge.numa_node= */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies
index 6350269684..2e4fa72daa 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies
@@ -3812,6 +3812,52 @@
 {
   "return": [
     {
+      "name": "dynamic-reconfiguration",
+      "type": "bool"
+    },
+    {
+      "name": "dma_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "dma_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "io_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "mem_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "buid",
+      "type": "uint64"
+    },
+    {
+      "name": "io_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "liobn",
+      "type": "uint32"
+    },
+    {
+      "name": "mem_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "index",
+      "type": "uint32"
+    }
+  ],
+  "id": "libvirt-41"
+}
+
+{
+  "return": [
+    {
       "name": "ref405ep",
       "cpu-max": 1
     },
@@ -3878,7 +3924,7 @@
       "cpu-max": 255
     }
   ],
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
@@ -5180,12 +5226,6 @@
       "name": "MPC8541E_v11"
     }
   ],
-  "id": "libvirt-42"
-}
-
-{
-  "return": [
-  ],
   "id": "libvirt-43"
 }
 
@@ -5197,6 +5237,12 @@
 
 {
   "return": [
+  ],
+  "id": "libvirt-45"
+}
+
+{
+  "return": [
     {
       "parameters": [
         {
@@ -6159,7 +6205,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-45"
+  "id": "libvirt-46"
 }
 
 {
@@ -6193,7 +6239,7 @@
       "capability": "postcopy-ram"
     }
   ],
-  "id": "libvirt-46"
+  "id": "libvirt-47"
 }
 
 {
@@ -14198,7 +14244,7 @@
       "meta-type": "array"
     }
   ],
-  "id": "libvirt-47"
+  "id": "libvirt-48"
 }
 
 {
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies
index 0c85f9ed45..0b286dc967 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies
@@ -4274,6 +4274,92 @@
 {
   "return": [
     {
+      "name": "dynamic-reconfiguration",
+      "type": "bool"
+    },
+    {
+      "name": "ddw",
+      "type": "bool"
+    },
+    {
+      "name": "dma_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "numa_node",
+      "type": "uint32"
+    },
+    {
+      "name": "pre-2.8-migration",
+      "type": "bool"
+    },
+    {
+      "name": "mem64_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "pgsz",
+      "type": "uint64"
+    },
+    {
+      "name": "liobn64",
+      "type": "uint32"
+    },
+    {
+      "name": "dma_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "io_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "mem_win_size",
+      "type": "uint64"
+    },
+    {
+      "name": "buid",
+      "type": "uint64"
+    },
+    {
+      "name": "dma64_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "mem64_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "pcie-extended-configuration-space",
+      "type": "bool"
+    },
+    {
+      "name": "io_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "liobn",
+      "type": "uint32"
+    },
+    {
+      "name": "mem_win_addr",
+      "type": "uint64"
+    },
+    {
+      "name": "mem64_win_pciaddr",
+      "type": "uint64"
+    },
+    {
+      "name": "index",
+      "type": "uint32"
+    }
+  ],
+  "id": "libvirt-41"
+}
+
+{
+  "return": [
+    {
       "hotpluggable-cpus": false,
       "name": "ref405ep",
       "cpu-max": 1
@@ -4381,7 +4467,7 @@
       "cpu-max": 1
     }
   ],
-  "id": "libvirt-41"
+  "id": "libvirt-42"
 }
 
 {
@@ -6557,12 +6643,6 @@
       "static": false
     }
   ],
-  "id": "libvirt-42"
-}
-
-{
-  "return": [
-  ],
   "id": "libvirt-43"
 }
 
@@ -6574,6 +6654,12 @@
 
 {
   "return": [
+  ],
+  "id": "libvirt-45"
+}
+
+{
+  "return": [
     {
       "parameters": [
         {
@@ -7679,7 +7765,7 @@
       "option": "drive"
     }
   ],
-  "id": "libvirt-45"
+  "id": "libvirt-46"
 }
 
 {
@@ -7721,7 +7807,7 @@
       "capability": "release-ram"
     }
   ],
-  "id": "libvirt-46"
+  "id": "libvirt-47"
 }
 
 {
@@ -17007,7 +17093,7 @@
       "meta-type": "object"
     }
   ],
-  "id": "libvirt-47"
+  "id": "libvirt-48"
 }
 
 {
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml
index 29721b04f0..ba22878fe2 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml
@@ -168,6 +168,7 @@
   <flag name='virtio.iommu_platform'/>
   <flag name='virtio.ats'/>
   <flag name='spapr-pci-host-bridge'/>
+  <flag name='spapr-pci-host-bridge.numa_node'/>
   <version>2009000</version>
   <kvmVersion>0</kvmVersion>
   <package> (v2.9.0)</package>
-- 
2.13.3