[libvirt PATCH] tests: validate parsing of CPUs with dies > 1

Daniel P. Berrangé berrange at redhat.com
Mon Mar 16 14:16:52 UTC 2020


Add sample data files for validating handling of a QEMU guest started
with:

  -smp 7,maxcpus=16,sockets=2,dies=2,cores=2,threads=2

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 ...qemumonitorjson-cpuinfo-x86-dies-cpus.json |  95 ++++++++++
 ...umonitorjson-cpuinfo-x86-dies-hotplug.json | 171 ++++++++++++++++++
 .../qemumonitorjson-cpuinfo-x86-dies.data     | 108 +++++++++++
 tests/qemumonitorjsontest.c                   |   1 +
 4 files changed, 375 insertions(+)
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data

diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json
new file mode 100644
index 0000000000..f90e4ba175
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json
@@ -0,0 +1,95 @@
+{
+    "return": [
+        {
+            "arch": "x86",
+            "thread-id": 1538346,
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[0]",
+            "cpu-index": 0,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538347,
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[2]",
+            "cpu-index": 1,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538348,
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[3]",
+            "cpu-index": 2,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538349,
+            "props": {
+                "core-id": 1,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[4]",
+            "cpu-index": 3,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538350,
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[5]",
+            "cpu-index": 4,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538351,
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[6]",
+            "cpu-index": 5,
+            "target": "x86_64"
+        },
+        {
+            "arch": "x86",
+            "thread-id": 1538352,
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "qom-path": "/machine/unattached/device[7]",
+            "cpu-index": 6,
+            "target": "x86_64"
+        }
+    ]
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json
new file mode 100644
index 0000000000..294f470b91
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json
@@ -0,0 +1,171 @@
+{
+    "return": [
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 1,
+                "die-id": 1,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 1,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 1
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 1,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[7]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[6]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 1,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[5]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[4]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 1,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[3]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 1,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[2]",
+            "type": "host-x86_64-cpu"
+        },
+        {
+            "props": {
+                "core-id": 0,
+                "thread-id": 0,
+                "die-id": 0,
+                "socket-id": 0
+            },
+            "vcpus-count": 1,
+            "qom-path": "/machine/unattached/device[0]",
+            "type": "host-x86_64-cpu"
+        }
+    ]
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data
new file mode 100644
index 0000000000..9dfca1e625
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data
@@ -0,0 +1,108 @@
+[vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
+    thread-id='1538346'
+    enable-id='1'
+    query-cpus-id='0'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[0]'
+    topology: socket='0' core='0' thread='0' vcpus='1'
+[vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
+    thread-id='1538347'
+    enable-id='2'
+    query-cpus-id='1'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[2]'
+    topology: socket='0' core='0' thread='1' vcpus='1'
+[vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
+    thread-id='1538348'
+    enable-id='3'
+    query-cpus-id='2'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[3]'
+    topology: socket='0' core='1' thread='0' vcpus='1'
+[vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
+    thread-id='1538349'
+    enable-id='4'
+    query-cpus-id='3'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[4]'
+    topology: socket='0' core='1' thread='1' vcpus='1'
+[vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
+    thread-id='1538350'
+    enable-id='5'
+    query-cpus-id='4'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[5]'
+    topology: socket='0' core='0' thread='0' vcpus='1'
+[vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
+    thread-id='1538351'
+    enable-id='6'
+    query-cpus-id='5'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[6]'
+    topology: socket='0' core='0' thread='1' vcpus='1'
+[vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
+    thread-id='1538352'
+    enable-id='7'
+    query-cpus-id='6'
+    type='host-x86_64-cpu'
+    qom_path='/machine/unattached/device[7]'
+    topology: socket='0' core='1' thread='0' vcpus='1'
+[vcpu libvirt-id='7']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='0' core='1' thread='1' vcpus='1'
+[vcpu libvirt-id='8']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='0' thread='0' vcpus='1'
+[vcpu libvirt-id='9']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='0' thread='1' vcpus='1'
+[vcpu libvirt-id='10']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='1' thread='0' vcpus='1'
+[vcpu libvirt-id='11']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='1' thread='1' vcpus='1'
+[vcpu libvirt-id='12']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='0' thread='0' vcpus='1'
+[vcpu libvirt-id='13']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='0' thread='1' vcpus='1'
+[vcpu libvirt-id='14']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='1' thread='0' vcpus='1'
+[vcpu libvirt-id='15']
+    online=no
+    hotpluggable=yes
+    type='host-x86_64-cpu'
+    topology: socket='1' core='1' thread='1' vcpus='1'
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 0a6760a794..ba60a97e7c 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -3235,6 +3235,7 @@ mymain(void)
     DO_TEST_CPU_INFO("x86-full", 11);
     DO_TEST_CPU_INFO("x86-node-full", 8);
     DO_TEST_CPU_INFO_FAST("x86-full-fast", 11);
+    DO_TEST_CPU_INFO_FAST("x86-dies", 16);
 
     DO_TEST_CPU_INFO("ppc64-basic", 24);
     DO_TEST_CPU_INFO("ppc64-hotplug-1", 24);
-- 
2.24.1




More information about the libvir-list mailing list