render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
6ae9ed
From c1cabe4130eaf51441aa6a3f5b688c2177218195 Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <c1cabe4130eaf51441aa6a3f5b688c2177218195@dist-git>
6ae9ed
From: Peter Krempa <pkrempa@redhat.com>
6ae9ed
Date: Wed, 24 Aug 2016 16:11:28 -0400
6ae9ed
Subject: [PATCH] tests: cpu-hotplug: Add data for ppc64 out-of-order hotplug
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1097930
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1224341
6ae9ed
6ae9ed
Test the algorithm that extracts the order in which the vcpu entries
6ae9ed
were plugged in on a sample of data created by plugging in vcpus
6ae9ed
arbitrarily.
6ae9ed
6ae9ed
(cherry picked from commit 1c455c4743796d2c977bfc1e999a233eeef1127f)
6ae9ed
---
6ae9ed
 ...mumonitorjson-cpuinfo-ppc64-hotplug-4-cpus.json | 221 +++++++++++++++++++++
6ae9ed
 ...onitorjson-cpuinfo-ppc64-hotplug-4-hotplug.json |  29 +++
6ae9ed
 .../qemumonitorjson-cpuinfo-ppc64-hotplug-4.data   |  62 ++++++
6ae9ed
 tests/qemumonitorjsontest.c                        |   1 +
6ae9ed
 4 files changed, 313 insertions(+)
6ae9ed
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-cpus.json
6ae9ed
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-hotplug.json
6ae9ed
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
6ae9ed
6ae9ed
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-cpus.json
6ae9ed
new file mode 100644
6ae9ed
index 0000000..bcb6eab
6ae9ed
--- /dev/null
6ae9ed
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-cpus.json
6ae9ed
@@ -0,0 +1,221 @@
6ae9ed
+{
6ae9ed
+  "return": [
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": true,
6ae9ed
+      "CPU": 0,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[0]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21925
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 1,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[1]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21926
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 2,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[2]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21927
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 3,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[3]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21928
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 4,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[4]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21930
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 5,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[5]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21931
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 6,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[6]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21932
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 7,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/unattached/device[1]/thread[7]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 21933
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 8,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[0]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22741
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 9,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[1]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22742
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 10,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[2]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22743
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 11,
6ae9ed
+      "nip": -4611686018419474700,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[3]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22744
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 12,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[4]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22745
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 13,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[5]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22746
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 14,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[6]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22747
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 15,
6ae9ed
+      "nip": -4611686018426772172,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu1/thread[7]",
6ae9ed
+      "halted": false,
6ae9ed
+      "thread_id": 22748
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 16,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[0]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23170
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 17,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[1]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23171
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 18,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[2]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23172
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 19,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[3]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23173
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 20,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[4]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23174
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 21,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[5]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23175
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 22,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[6]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23176
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "arch": "ppc",
6ae9ed
+      "current": false,
6ae9ed
+      "CPU": 23,
6ae9ed
+      "nip": 0,
6ae9ed
+      "qom_path": "/machine/peripheral/vcpu0/thread[7]",
6ae9ed
+      "halted": true,
6ae9ed
+      "thread_id": 23177
6ae9ed
+    }
6ae9ed
+  ],
6ae9ed
+  "id": "libvirt-37"
6ae9ed
+}
6ae9ed
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-hotplug.json
6ae9ed
new file mode 100644
6ae9ed
index 0000000..ded2054
6ae9ed
--- /dev/null
6ae9ed
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4-hotplug.json
6ae9ed
@@ -0,0 +1,29 @@
6ae9ed
+{
6ae9ed
+  "return": [
6ae9ed
+    {
6ae9ed
+      "props": {
6ae9ed
+        "core-id": 16
6ae9ed
+      },
6ae9ed
+      "vcpus-count": 8,
6ae9ed
+      "qom-path": "/machine/peripheral/vcpu1",
6ae9ed
+      "type": "host-spapr-cpu-core"
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "props": {
6ae9ed
+        "core-id": 8
6ae9ed
+      },
6ae9ed
+      "vcpus-count": 8,
6ae9ed
+      "qom-path": "/machine/peripheral/vcpu0",
6ae9ed
+      "type": "host-spapr-cpu-core"
6ae9ed
+    },
6ae9ed
+    {
6ae9ed
+      "props": {
6ae9ed
+        "core-id": 0
6ae9ed
+      },
6ae9ed
+      "vcpus-count": 8,
6ae9ed
+      "qom-path": "/machine/unattached/device[1]",
6ae9ed
+      "type": "host-spapr-cpu-core"
6ae9ed
+    }
6ae9ed
+  ],
6ae9ed
+  "id": "libvirt-38"
6ae9ed
+}
6ae9ed
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
6ae9ed
new file mode 100644
6ae9ed
index 0000000..22a425d
6ae9ed
--- /dev/null
6ae9ed
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
6ae9ed
@@ -0,0 +1,62 @@
6ae9ed
+[vcpu libvirt-id='0']
6ae9ed
+    thread-id='21925'
6ae9ed
+    qemu-id='1'
6ae9ed
+    type='host-spapr-cpu-core'
6ae9ed
+    qom_path='/machine/unattached/device[1]'
6ae9ed
+    topology: core='0' vcpus='8'
6ae9ed
+[vcpu libvirt-id='1']
6ae9ed
+    thread-id='21926'
6ae9ed
+[vcpu libvirt-id='2']
6ae9ed
+    thread-id='21927'
6ae9ed
+[vcpu libvirt-id='3']
6ae9ed
+    thread-id='21928'
6ae9ed
+[vcpu libvirt-id='4']
6ae9ed
+    thread-id='21930'
6ae9ed
+[vcpu libvirt-id='5']
6ae9ed
+    thread-id='21931'
6ae9ed
+[vcpu libvirt-id='6']
6ae9ed
+    thread-id='21932'
6ae9ed
+[vcpu libvirt-id='7']
6ae9ed
+    thread-id='21933'
6ae9ed
+[vcpu libvirt-id='8']
6ae9ed
+    thread-id='23170'
6ae9ed
+    qemu-id='3'
6ae9ed
+    type='host-spapr-cpu-core'
6ae9ed
+    alias='vcpu0'
6ae9ed
+    qom_path='/machine/peripheral/vcpu0'
6ae9ed
+    topology: core='8' vcpus='8'
6ae9ed
+[vcpu libvirt-id='9']
6ae9ed
+    thread-id='23171'
6ae9ed
+[vcpu libvirt-id='10']
6ae9ed
+    thread-id='23172'
6ae9ed
+[vcpu libvirt-id='11']
6ae9ed
+    thread-id='23173'
6ae9ed
+[vcpu libvirt-id='12']
6ae9ed
+    thread-id='23174'
6ae9ed
+[vcpu libvirt-id='13']
6ae9ed
+    thread-id='23175'
6ae9ed
+[vcpu libvirt-id='14']
6ae9ed
+    thread-id='23176'
6ae9ed
+[vcpu libvirt-id='15']
6ae9ed
+    thread-id='23177'
6ae9ed
+[vcpu libvirt-id='16']
6ae9ed
+    thread-id='22741'
6ae9ed
+    qemu-id='2'
6ae9ed
+    type='host-spapr-cpu-core'
6ae9ed
+    alias='vcpu1'
6ae9ed
+    qom_path='/machine/peripheral/vcpu1'
6ae9ed
+    topology: core='16' vcpus='8'
6ae9ed
+[vcpu libvirt-id='17']
6ae9ed
+    thread-id='22742'
6ae9ed
+[vcpu libvirt-id='18']
6ae9ed
+    thread-id='22743'
6ae9ed
+[vcpu libvirt-id='19']
6ae9ed
+    thread-id='22744'
6ae9ed
+[vcpu libvirt-id='20']
6ae9ed
+    thread-id='22745'
6ae9ed
+[vcpu libvirt-id='21']
6ae9ed
+    thread-id='22746'
6ae9ed
+[vcpu libvirt-id='22']
6ae9ed
+    thread-id='22747'
6ae9ed
+[vcpu libvirt-id='23']
6ae9ed
+    thread-id='22748'
6ae9ed
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
6ae9ed
index 3cb7083..ddcbd78 100644
6ae9ed
--- a/tests/qemumonitorjsontest.c
6ae9ed
+++ b/tests/qemumonitorjsontest.c
6ae9ed
@@ -2590,6 +2590,7 @@ mymain(void)
6ae9ed
     DO_TEST_CPU_INFO("ppc64-basic", 24);
6ae9ed
     DO_TEST_CPU_INFO("ppc64-hotplug-1", 24);
6ae9ed
     DO_TEST_CPU_INFO("ppc64-hotplug-2", 24);
6ae9ed
+    DO_TEST_CPU_INFO("ppc64-hotplug-4", 24);
6ae9ed
 
6ae9ed
     qemuTestDriverFree(&driver);
6ae9ed
 
6ae9ed
-- 
6ae9ed
2.10.0
6ae9ed