]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Add vcpu state information to monitor data
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Sep 2016 15:52:38 +0000 (17:52 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 14 Sep 2016 10:55:33 +0000 (12:55 +0200)
Return whether a vcpu entry is hotpluggable or online so that upper
layers don't have to infer the information from other data.

Advantage is that this code can be tested by unit tests.

src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-basic.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-1.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-2.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full.data
tests/qemumonitorjsontest.c

index 448999785a00c9bf790b9935c1544db5973cc219..6071c803df473336f45b53bb77bf87a67f4b72d1 100644 (file)
@@ -1773,6 +1773,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
     int order = 1;
     size_t totalvcpus = 0;
     size_t mastervcpu; /* this iterator is used for iterating hotpluggable entities */
+    size_t slavevcpu; /* this corresponds to subentries of a hotpluggable entry */
     size_t anyvcpu; /* this iterator is used for any vcpu entry in the result */
     size_t i;
     size_t j;
@@ -1816,6 +1817,9 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
      * logical vcpus in the guest */
     mastervcpu = 0;
     for (i = 0; i < nhotplugvcpus; i++) {
+        vcpus[mastervcpu].online = !!hotplugvcpus[i].qom_path;
+        vcpus[mastervcpu].hotpluggable = !!hotplugvcpus[i].alias ||
+                                         !vcpus[mastervcpu].online;
         vcpus[mastervcpu].socket_id = hotplugvcpus[i].socket_id;
         vcpus[mastervcpu].core_id = hotplugvcpus[i].core_id;
         vcpus[mastervcpu].thread_id = hotplugvcpus[i].thread_id;
@@ -1825,6 +1829,12 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
         VIR_STEAL_PTR(vcpus[mastervcpu].type, hotplugvcpus[i].type);
         vcpus[mastervcpu].id = hotplugvcpus[i].enable_id;
 
+        /* copy state information to slave vcpus */
+        for (slavevcpu = mastervcpu + 1; slavevcpu < mastervcpu + hotplugvcpus[i].vcpus; slavevcpu++) {
+            vcpus[slavevcpu].online = vcpus[mastervcpu].online;
+            vcpus[slavevcpu].hotpluggable = vcpus[mastervcpu].hotpluggable;
+        }
+
         /* calculate next master vcpu (hotpluggable unit) entry */
         mastervcpu += hotplugvcpus[i].vcpus;
     }
index 255fff2eae9dfc444d82848dc9de1ead1252f303..615ab3e940040a8fe79e5876dc18ef8ab4cec5c0 100644 (file)
@@ -422,6 +422,10 @@ struct _qemuMonitorCPUInfo {
     pid_t tid;
     int id; /* order of enabling of the given cpu */
 
+    /* state data */
+    bool online;
+    bool hotpluggable;
+
     /* topology info for hotplug purposes. Hotplug of given vcpu impossible if
      * all entries are -1 */
     int socket_id;
index 9fc81487211ffaaf9c20f58755c177584a1bbdc4..ae7c2f4b3b59a90b3e2b28ab0c19a31e74e2f9c7 100644 (file)
@@ -1,40 +1,88 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='21925'
     qemu-id='1'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[1]'
     topology: core='0' vcpus='8'
 [vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
     thread-id='21926'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
     thread-id='21927'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
     thread-id='21928'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
     thread-id='21930'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
     thread-id='21931'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
     thread-id='21932'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=no
     thread-id='21933'
 [vcpu libvirt-id='8']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='8' vcpus='8'
 [vcpu libvirt-id='9']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='10']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='11']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='12']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='13']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='14']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='15']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='16']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='16' vcpus='8'
 [vcpu libvirt-id='17']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='18']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='19']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='20']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='21']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='22']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='23']
+    online=no
+    hotpluggable=yes
index b0139b526e3293d040523e1b615b52dfe329dd61..5c0a6af0fcf7e7380216144fcf9645561e68ea0c 100644 (file)
@@ -1,24 +1,42 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='21925'
     qemu-id='1'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[1]'
     topology: core='0' vcpus='8'
 [vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
     thread-id='21926'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
     thread-id='21927'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
     thread-id='21928'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
     thread-id='21930'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
     thread-id='21931'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
     thread-id='21932'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=no
     thread-id='21933'
 [vcpu libvirt-id='8']
+    online=yes
+    hotpluggable=yes
     thread-id='22131'
     qemu-id='2'
     type='host-spapr-cpu-core'
     qom_path='/machine/peripheral/vcpu0'
     topology: core='8' vcpus='8'
 [vcpu libvirt-id='9']
+    online=yes
+    hotpluggable=yes
     thread-id='22132'
 [vcpu libvirt-id='10']
+    online=yes
+    hotpluggable=yes
     thread-id='22133'
 [vcpu libvirt-id='11']
+    online=yes
+    hotpluggable=yes
     thread-id='22134'
 [vcpu libvirt-id='12']
+    online=yes
+    hotpluggable=yes
     thread-id='22135'
 [vcpu libvirt-id='13']
+    online=yes
+    hotpluggable=yes
     thread-id='22136'
 [vcpu libvirt-id='14']
+    online=yes
+    hotpluggable=yes
     thread-id='22137'
 [vcpu libvirt-id='15']
+    online=yes
+    hotpluggable=yes
     thread-id='22138'
 [vcpu libvirt-id='16']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='16' vcpus='8'
 [vcpu libvirt-id='17']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='18']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='19']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='20']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='21']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='22']
+    online=no
+    hotpluggable=yes
 [vcpu libvirt-id='23']
+    online=no
+    hotpluggable=yes
index ea4b099c8fa8db5279546752687f922517469e1b..ba4044e449c1bab49c370ba7865b32831b7f7926 100644 (file)
@@ -1,24 +1,42 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='21925'
     qemu-id='1'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[1]'
     topology: core='0' vcpus='8'
 [vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
     thread-id='21926'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
     thread-id='21927'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
     thread-id='21928'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
     thread-id='21930'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
     thread-id='21931'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
     thread-id='21932'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=no
     thread-id='21933'
 [vcpu libvirt-id='8']
+    online=yes
+    hotpluggable=yes
     thread-id='22131'
     qemu-id='2'
     type='host-spapr-cpu-core'
     qom_path='/machine/peripheral/vcpu0'
     topology: core='8' vcpus='8'
 [vcpu libvirt-id='9']
+    online=yes
+    hotpluggable=yes
     thread-id='22132'
 [vcpu libvirt-id='10']
+    online=yes
+    hotpluggable=yes
     thread-id='22133'
 [vcpu libvirt-id='11']
+    online=yes
+    hotpluggable=yes
     thread-id='22134'
 [vcpu libvirt-id='12']
+    online=yes
+    hotpluggable=yes
     thread-id='22135'
 [vcpu libvirt-id='13']
+    online=yes
+    hotpluggable=yes
     thread-id='22136'
 [vcpu libvirt-id='14']
+    online=yes
+    hotpluggable=yes
     thread-id='22137'
 [vcpu libvirt-id='15']
+    online=yes
+    hotpluggable=yes
     thread-id='22138'
 [vcpu libvirt-id='16']
+    online=yes
+    hotpluggable=yes
     thread-id='22223'
     qemu-id='3'
     type='host-spapr-cpu-core'
     qom_path='/machine/peripheral/vcpu1'
     topology: core='16' vcpus='8'
 [vcpu libvirt-id='17']
+    online=yes
+    hotpluggable=yes
     thread-id='22224'
 [vcpu libvirt-id='18']
+    online=yes
+    hotpluggable=yes
     thread-id='22225'
 [vcpu libvirt-id='19']
+    online=yes
+    hotpluggable=yes
     thread-id='22226'
 [vcpu libvirt-id='20']
+    online=yes
+    hotpluggable=yes
     thread-id='22227'
 [vcpu libvirt-id='21']
+    online=yes
+    hotpluggable=yes
     thread-id='22228'
 [vcpu libvirt-id='22']
+    online=yes
+    hotpluggable=yes
     thread-id='22229'
 [vcpu libvirt-id='23']
+    online=yes
+    hotpluggable=yes
     thread-id='22230'
index 22a425d4afd12f47fa79bfb2a50f4046e9bb7150..d2c56ef989af14cd2448722530796a80eac518f4 100644 (file)
@@ -1,24 +1,42 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='21925'
     qemu-id='1'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[1]'
     topology: core='0' vcpus='8'
 [vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
     thread-id='21926'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
     thread-id='21927'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
     thread-id='21928'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
     thread-id='21930'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
     thread-id='21931'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
     thread-id='21932'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=no
     thread-id='21933'
 [vcpu libvirt-id='8']
+    online=yes
+    hotpluggable=yes
     thread-id='23170'
     qemu-id='3'
     type='host-spapr-cpu-core'
     qom_path='/machine/peripheral/vcpu0'
     topology: core='8' vcpus='8'
 [vcpu libvirt-id='9']
+    online=yes
+    hotpluggable=yes
     thread-id='23171'
 [vcpu libvirt-id='10']
+    online=yes
+    hotpluggable=yes
     thread-id='23172'
 [vcpu libvirt-id='11']
+    online=yes
+    hotpluggable=yes
     thread-id='23173'
 [vcpu libvirt-id='12']
+    online=yes
+    hotpluggable=yes
     thread-id='23174'
 [vcpu libvirt-id='13']
+    online=yes
+    hotpluggable=yes
     thread-id='23175'
 [vcpu libvirt-id='14']
+    online=yes
+    hotpluggable=yes
     thread-id='23176'
 [vcpu libvirt-id='15']
+    online=yes
+    hotpluggable=yes
     thread-id='23177'
 [vcpu libvirt-id='16']
+    online=yes
+    hotpluggable=yes
     thread-id='22741'
     qemu-id='2'
     type='host-spapr-cpu-core'
     qom_path='/machine/peripheral/vcpu1'
     topology: core='16' vcpus='8'
 [vcpu libvirt-id='17']
+    online=yes
+    hotpluggable=yes
     thread-id='22742'
 [vcpu libvirt-id='18']
+    online=yes
+    hotpluggable=yes
     thread-id='22743'
 [vcpu libvirt-id='19']
+    online=yes
+    hotpluggable=yes
     thread-id='22744'
 [vcpu libvirt-id='20']
+    online=yes
+    hotpluggable=yes
     thread-id='22745'
 [vcpu libvirt-id='21']
+    online=yes
+    hotpluggable=yes
     thread-id='22746'
 [vcpu libvirt-id='22']
+    online=yes
+    hotpluggable=yes
     thread-id='22747'
 [vcpu libvirt-id='23']
+    online=yes
+    hotpluggable=yes
     thread-id='22748'
index d7ab77b790f126eab49d8d8d827891e4e4ed3909..c2f541b3e6ea77b68d1d024434fe13fbe2469e2c 100644 (file)
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='35232'
     qemu-id='1'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[1]'
     topology: core='0' vcpus='1'
 [vcpu libvirt-id='1']
+    online=yes
+    hotpluggable=no
     thread-id='35233'
     qemu-id='2'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[2]'
     topology: core='8' vcpus='1'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=no
     thread-id='35234'
     qemu-id='3'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[3]'
     topology: core='16' vcpus='1'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=no
     thread-id='35235'
     qemu-id='4'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[4]'
     topology: core='24' vcpus='1'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=no
     thread-id='35236'
     qemu-id='5'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[5]'
     topology: core='32' vcpus='1'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=no
     thread-id='35237'
     qemu-id='6'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[6]'
     topology: core='40' vcpus='1'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=no
     thread-id='35238'
     qemu-id='7'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[7]'
     topology: core='48' vcpus='1'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=no
     thread-id='35239'
     qemu-id='8'
     type='host-spapr-cpu-core'
     qom_path='/machine/unattached/device[8]'
     topology: core='56' vcpus='1'
 [vcpu libvirt-id='8']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='64' vcpus='1'
 [vcpu libvirt-id='9']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='72' vcpus='1'
 [vcpu libvirt-id='10']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='80' vcpus='1'
 [vcpu libvirt-id='11']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='88' vcpus='1'
 [vcpu libvirt-id='12']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='96' vcpus='1'
 [vcpu libvirt-id='13']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='104' vcpus='1'
 [vcpu libvirt-id='14']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='112' vcpus='1'
 [vcpu libvirt-id='15']
+    online=no
+    hotpluggable=yes
     type='host-spapr-cpu-core'
     topology: core='120' vcpus='1'
index a367a090e2b2a271510880536ea149595838dca7..67dfc0197fc9ee43d5b9f80fdd6a55b9c35c6863 100644 (file)
@@ -1,39 +1,55 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='518291'
     qemu-id='1'
     type='qemu64-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='518292'
     qemu-id='2'
     type='qemu64-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='518294'
     qemu-id='3'
     type='qemu64-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='518295'
     qemu-id='4'
     type='qemu64-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='518296'
     qemu-id='5'
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[5]'
     topology: socket='1' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='5']
+    online=no
+    hotpluggable=yes
     type='qemu64-x86_64-cpu'
     topology: socket='1' core='0' thread='1' vcpus='1'
 [vcpu libvirt-id='6']
+    online=no
+    hotpluggable=yes
     type='qemu64-x86_64-cpu'
     topology: socket='1' core='1' thread='0' vcpus='1'
 [vcpu libvirt-id='7']
+    online=no
+    hotpluggable=yes
     type='qemu64-x86_64-cpu'
     topology: socket='1' core='1' thread='1' vcpus='1'
index a6c1069eda5ef304d6f0c9c5c2464287b29e28c4..dba37457a737cf7e68ca0f675c0c803e7c8a3579 100644 (file)
@@ -1,10 +1,14 @@
 [vcpu libvirt-id='0']
+    online=yes
+    hotpluggable=no
     thread-id='895040'
     qemu-id='1'
     type='Broadwell-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=yes
     thread-id='895056'
     qemu-id='2'
     type='Broadwell-x86_64-cpu'
@@ -12,6 +16,8 @@
     qom_path='/machine/peripheral/vcpu1'
     topology: socket='1' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='2']
+    online=yes
+    hotpluggable=yes
     thread-id='895057'
     qemu-id='3'
     type='Broadwell-x86_64-cpu'
@@ -19,6 +25,8 @@
     qom_path='/machine/peripheral/vcpu2'
     topology: socket='2' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='3']
+    online=yes
+    hotpluggable=yes
     thread-id='895058'
     qemu-id='4'
     type='Broadwell-x86_64-cpu'
@@ -26,6 +34,8 @@
     qom_path='/machine/peripheral/vcpu3'
     topology: socket='3' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='4']
+    online=yes
+    hotpluggable=yes
     thread-id='895059'
     qemu-id='5'
     type='Broadwell-x86_64-cpu'
@@ -33,6 +43,8 @@
     qom_path='/machine/peripheral/vcpu4'
     topology: socket='4' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='5']
+    online=yes
+    hotpluggable=yes
     thread-id='895060'
     qemu-id='6'
     type='Broadwell-x86_64-cpu'
@@ -40,6 +52,8 @@
     qom_path='/machine/peripheral/vcpu5'
     topology: socket='5' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='6']
+    online=yes
+    hotpluggable=yes
     thread-id='895061'
     qemu-id='7'
     type='Broadwell-x86_64-cpu'
@@ -47,6 +61,8 @@
     qom_path='/machine/peripheral/vcpu6'
     topology: socket='6' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='7']
+    online=yes
+    hotpluggable=yes
     thread-id='895062'
     qemu-id='8'
     type='Broadwell-x86_64-cpu'
@@ -54,6 +70,8 @@
     qom_path='/machine/peripheral/vcpu7'
     topology: socket='7' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='8']
+    online=yes
+    hotpluggable=yes
     thread-id='895063'
     qemu-id='9'
     type='Broadwell-x86_64-cpu'
@@ -61,6 +79,8 @@
     qom_path='/machine/peripheral/vcpu8'
     topology: socket='8' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='9']
+    online=yes
+    hotpluggable=yes
     thread-id='895064'
     qemu-id='10'
     type='Broadwell-x86_64-cpu'
@@ -68,6 +88,8 @@
     qom_path='/machine/peripheral/vcpu9'
     topology: socket='9' core='0' thread='0' vcpus='1'
 [vcpu libvirt-id='10']
+    online=yes
+    hotpluggable=yes
     thread-id='895065'
     qemu-id='11'
     type='Broadwell-x86_64-cpu'
index d3ec3b17205f59bce04e87c0f5c8e4d9481e0a5b..9e195d743cc76b5579bca5d6cdda261f4a30680f 100644 (file)
@@ -2357,6 +2357,9 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus,
         virBufferAsprintf(&buf, "[vcpu libvirt-id='%zu']\n", i);
         virBufferAdjustIndent(&buf, 4);
 
+        virBufferAsprintf(&buf, "online=%s\n", vcpu->online ? "yes" : "no");
+        virBufferAsprintf(&buf, "hotpluggable=%s\n", vcpu->hotpluggable ? "yes" : "no");
+
         if (vcpu->tid)
             virBufferAsprintf(&buf, "thread-id='%llu'\n",
                               (unsigned long long) vcpu->tid);