Add async unplug coverage for the setvcpu path.

The x86 case covers removal of a single hotpluggable vCPU entity, while the
ppc64 case covers removal of a grouped hotpluggable entity. Both cases verify
the pending XML before DEVICE_DELETED, the final XML after completion, and the
expected vcpu-removed events.

Signed-off-by: Akash Kulhalli <[email protected]>
---
 tests/qemuhotplugtest.c                       |   4 +
 ...c64-modern-individual-del-async-domain.xml |  68 ++++++
 ...4-modern-individual-del-async-monitor.json | 227 ++++++++++++++++++
 ...odern-individual-del-async-result-conf.xml |  68 ++++++
 ...odern-individual-del-async-result-live.xml |  71 ++++++
 ...dividual-del-async-result-pending-live.xml |  71 ++++++
 ...x86-modern-individual-del-async-domain.xml |  42 ++++
 ...6-modern-individual-del-async-monitor.json | 186 ++++++++++++++
 ...odern-individual-del-async-result-conf.xml |  42 ++++
 ...odern-individual-del-async-result-live.xml |  50 ++++
 ...dividual-del-async-result-pending-live.xml |  50 ++++
 11 files changed, 879 insertions(+)
 create mode 100644 
tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-domain.xml
 create mode 100644 
tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-monitor.json
 create mode 100644 
tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-conf.xml
 create mode 100644 
tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-live.xml
 create mode 100644 
tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-pending-live.xml
 create mode 100644 
tests/qemuhotplugtestcpus/x86-modern-individual-del-async-domain.xml
 create mode 100644 
tests/qemuhotplugtestcpus/x86-modern-individual-del-async-monitor.json
 create mode 100644 
tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-conf.xml
 create mode 100644 
tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-live.xml
 create mode 100644 
tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-pending-live.xml

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 9696448e5b4e..402f58cbfc19 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -1171,10 +1171,14 @@ mymain(void)
     DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", true, 
false);
     DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "6,7", true, 
true);
     DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", false, 
true);
+    DO_TEST_CPU_INDIVIDUAL_ASYNC("x86_64", "x86-modern-individual-del-async",
+                                 "7", "vcpu7", "7");
 
     DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-23", true, 
false);
     DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-22", true, 
true);
     DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "17", true, 
true);
+    DO_TEST_CPU_INDIVIDUAL_ASYNC("ppc64", "ppc64-modern-individual-del-async",
+                                 "16-23", "vcpu16", "16-23");
 
     qemuTestDriverFree(&driver);
     virObjectUnref(data.vm);
diff --git 
a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-domain.xml 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-domain.xml
new file mode 100644
index 000000000000..29f1a5ac45dc
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-domain.xml
@@ -0,0 +1,68 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='16'>32</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='yes' hotpluggable='no'/>
+    <vcpu id='6' enabled='yes' hotpluggable='no'/>
+    <vcpu id='7' enabled='yes' hotpluggable='no'/>
+    <vcpu id='8' enabled='no' hotpluggable='yes'/>
+    <vcpu id='9' enabled='no' hotpluggable='yes'/>
+    <vcpu id='10' enabled='no' hotpluggable='yes'/>
+    <vcpu id='11' enabled='no' hotpluggable='yes'/>
+    <vcpu id='12' enabled='no' hotpluggable='yes'/>
+    <vcpu id='13' enabled='no' hotpluggable='yes'/>
+    <vcpu id='14' enabled='no' hotpluggable='yes'/>
+    <vcpu id='15' enabled='no' hotpluggable='yes'/>
+    <vcpu id='16' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='17' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='18' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='19' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='20' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='21' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='22' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='23' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='24' enabled='no' hotpluggable='yes'/>
+    <vcpu id='25' enabled='no' hotpluggable='yes'/>
+    <vcpu id='26' enabled='no' hotpluggable='yes'/>
+    <vcpu id='27' enabled='no' hotpluggable='yes'/>
+    <vcpu id='28' enabled='no' hotpluggable='yes'/>
+    <vcpu id='29' enabled='no' hotpluggable='yes'/>
+    <vcpu id='30' enabled='no' hotpluggable='yes'/>
+    <vcpu id='31' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>POWER9</model>
+    <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-monitor.json 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-monitor.json
new file mode 100644
index 000000000000..c4b0a4b45d01
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-monitor.json
@@ -0,0 +1,227 @@
+{"execute":"query-hotpluggable-cpus","id":"libvirt-1"}
+
+{
+  "return": [
+    {
+      "props": {
+        "core-id": 24
+      },
+      "vcpus-count": 8,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 16
+      },
+      "vcpus-count": 8,
+      "qom-path": "/machine/peripheral/vcpu16",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 8
+      },
+      "vcpus-count": 8,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 0
+      },
+      "vcpus-count": 8,
+      "qom-path": "/machine/unattached/device[1]",
+      "type": "host-spapr-cpu-core"
+    }
+  ],
+  "id": "libvirt-15"
+}
+
+{"execute":"query-cpus-fast","id":"libvirt-2"}
+
+{
+  "return": [
+    {
+      "target": "ppc",
+      "current": true,
+      "cpu-index": 0,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[0]",
+      "halted": false,
+      "thread-id": 21925
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 1,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[1]",
+      "halted": false,
+      "thread-id": 21926
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 2,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[2]",
+      "halted": false,
+      "thread-id": 21927
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 3,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[3]",
+      "halted": false,
+      "thread-id": 21928
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 4,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[4]",
+      "halted": false,
+      "thread-id": 21930
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 5,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[5]",
+      "halted": false,
+      "thread-id": 21931
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 6,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[6]",
+      "halted": false,
+      "thread-id": 21932
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 7,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/unattached/device[1]/thread[7]",
+      "halted": false,
+      "thread-id": 21933
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 8,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[0]",
+      "halted": false,
+      "thread-id": 22131
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 9,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[1]",
+      "halted": false,
+      "thread-id": 22132
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 10,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[2]",
+      "halted": false,
+      "thread-id": 22133
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 11,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[3]",
+      "halted": false,
+      "thread-id": 22134
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 12,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[4]",
+      "halted": false,
+      "thread-id": 22135
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 13,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[5]",
+      "halted": false,
+      "thread-id": 22136
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 14,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[6]",
+      "halted": false,
+      "thread-id": 22137
+    },
+    {
+      "target": "ppc",
+      "current": false,
+      "cpu-index": 15,
+      "nip": -4611686018426772172,
+      "qom-path": "/machine/peripheral/vcpu16/thread[7]",
+      "halted": false,
+      "thread-id": 22138
+    }
+  ],
+  "id": "libvirt-14"
+}
+
+{
+    "execute": "device_del",
+    "arguments": {
+        "id": "vcpu16"
+    },
+    "id": "libvirt-3"
+}
+
+{"return": {}}
+
+{"execute":"query-hotpluggable-cpus","id":"libvirt-4"}
+
+{
+  "return": [
+    
{"props":{"core-id":0},"vcpus-count":8,"qom-path":"/machine/unattached/device[1]","type":"host-spapr-cpu-core"},
+    {"props":{"core-id":8},"vcpus-count":8,"type":"host-spapr-cpu-core"},
+    {"props":{"core-id":16},"vcpus-count":8,"type":"host-spapr-cpu-core"},
+    {"props":{"core-id":24},"vcpus-count":8,"type":"host-spapr-cpu-core"}
+  ],
+  "id": "libvirt-4"
+}
+
+{"execute":"query-cpus-fast","id":"libvirt-5"}
+
+{
+  "return": [
+    
{"target":"ppc","current":true,"cpu-index":0,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[0]","halted":false,"thread-id":21925},
+    
{"target":"ppc","current":false,"cpu-index":1,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[1]","halted":false,"thread-id":21926},
+    
{"target":"ppc","current":false,"cpu-index":2,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[2]","halted":false,"thread-id":21927},
+    
{"target":"ppc","current":false,"cpu-index":3,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[3]","halted":false,"thread-id":21928},
+    
{"target":"ppc","current":false,"cpu-index":4,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[4]","halted":false,"thread-id":21930},
+    
{"target":"ppc","current":false,"cpu-index":5,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[5]","halted":false,"thread-id":21931},
+    
{"target":"ppc","current":false,"cpu-index":6,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[6]","halted":false,"thread-id":21932},
+    
{"target":"ppc","current":false,"cpu-index":7,"nip":-4611686018426772172,"qom-path":"/machine/unattached/device[1]/thread[7]","halted":false,"thread-id":21933}
+  ],
+  "id": "libvirt-5"
+}
diff --git 
a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-conf.xml 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-conf.xml
new file mode 100644
index 000000000000..dac1f476d45d
--- /dev/null
+++ 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-conf.xml
@@ -0,0 +1,68 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='8'>32</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='yes' hotpluggable='no'/>
+    <vcpu id='6' enabled='yes' hotpluggable='no'/>
+    <vcpu id='7' enabled='yes' hotpluggable='no'/>
+    <vcpu id='8' enabled='no' hotpluggable='yes'/>
+    <vcpu id='9' enabled='no' hotpluggable='yes'/>
+    <vcpu id='10' enabled='no' hotpluggable='yes'/>
+    <vcpu id='11' enabled='no' hotpluggable='yes'/>
+    <vcpu id='12' enabled='no' hotpluggable='yes'/>
+    <vcpu id='13' enabled='no' hotpluggable='yes'/>
+    <vcpu id='14' enabled='no' hotpluggable='yes'/>
+    <vcpu id='15' enabled='no' hotpluggable='yes'/>
+    <vcpu id='16' enabled='no' hotpluggable='yes'/>
+    <vcpu id='17' enabled='no' hotpluggable='yes'/>
+    <vcpu id='18' enabled='no' hotpluggable='yes'/>
+    <vcpu id='19' enabled='no' hotpluggable='yes'/>
+    <vcpu id='20' enabled='no' hotpluggable='yes'/>
+    <vcpu id='21' enabled='no' hotpluggable='yes'/>
+    <vcpu id='22' enabled='no' hotpluggable='yes'/>
+    <vcpu id='23' enabled='no' hotpluggable='yes'/>
+    <vcpu id='24' enabled='no' hotpluggable='yes'/>
+    <vcpu id='25' enabled='no' hotpluggable='yes'/>
+    <vcpu id='26' enabled='no' hotpluggable='yes'/>
+    <vcpu id='27' enabled='no' hotpluggable='yes'/>
+    <vcpu id='28' enabled='no' hotpluggable='yes'/>
+    <vcpu id='29' enabled='no' hotpluggable='yes'/>
+    <vcpu id='30' enabled='no' hotpluggable='yes'/>
+    <vcpu id='31' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>POWER9</model>
+    <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-live.xml 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-live.xml
new file mode 100644
index 000000000000..1e5d4b030263
--- /dev/null
+++ 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-live.xml
@@ -0,0 +1,71 @@
+<domain type='qemu' id='7'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='8'>32</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='yes' hotpluggable='no'/>
+    <vcpu id='6' enabled='yes' hotpluggable='no'/>
+    <vcpu id='7' enabled='yes' hotpluggable='no'/>
+    <vcpu id='8' enabled='no' hotpluggable='yes'/>
+    <vcpu id='9' enabled='no' hotpluggable='yes'/>
+    <vcpu id='10' enabled='no' hotpluggable='yes'/>
+    <vcpu id='11' enabled='no' hotpluggable='yes'/>
+    <vcpu id='12' enabled='no' hotpluggable='yes'/>
+    <vcpu id='13' enabled='no' hotpluggable='yes'/>
+    <vcpu id='14' enabled='no' hotpluggable='yes'/>
+    <vcpu id='15' enabled='no' hotpluggable='yes'/>
+    <vcpu id='16' enabled='no' hotpluggable='yes'/>
+    <vcpu id='17' enabled='no' hotpluggable='yes'/>
+    <vcpu id='18' enabled='no' hotpluggable='yes'/>
+    <vcpu id='19' enabled='no' hotpluggable='yes'/>
+    <vcpu id='20' enabled='no' hotpluggable='yes'/>
+    <vcpu id='21' enabled='no' hotpluggable='yes'/>
+    <vcpu id='22' enabled='no' hotpluggable='yes'/>
+    <vcpu id='23' enabled='no' hotpluggable='yes'/>
+    <vcpu id='24' enabled='no' hotpluggable='yes'/>
+    <vcpu id='25' enabled='no' hotpluggable='yes'/>
+    <vcpu id='26' enabled='no' hotpluggable='yes'/>
+    <vcpu id='27' enabled='no' hotpluggable='yes'/>
+    <vcpu id='28' enabled='no' hotpluggable='yes'/>
+    <vcpu id='29' enabled='no' hotpluggable='yes'/>
+    <vcpu id='30' enabled='no' hotpluggable='yes'/>
+    <vcpu id='31' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>POWER9</model>
+    <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+      <alias name='pci.0'/>
+    </controller>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <alias name='balloon0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-pending-live.xml
 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-pending-live.xml
new file mode 100644
index 000000000000..afa196de15f4
--- /dev/null
+++ 
b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-result-pending-live.xml
@@ -0,0 +1,71 @@
+<domain type='qemu' id='7'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='16'>32</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='yes' hotpluggable='no'/>
+    <vcpu id='6' enabled='yes' hotpluggable='no'/>
+    <vcpu id='7' enabled='yes' hotpluggable='no'/>
+    <vcpu id='8' enabled='no' hotpluggable='yes'/>
+    <vcpu id='9' enabled='no' hotpluggable='yes'/>
+    <vcpu id='10' enabled='no' hotpluggable='yes'/>
+    <vcpu id='11' enabled='no' hotpluggable='yes'/>
+    <vcpu id='12' enabled='no' hotpluggable='yes'/>
+    <vcpu id='13' enabled='no' hotpluggable='yes'/>
+    <vcpu id='14' enabled='no' hotpluggable='yes'/>
+    <vcpu id='15' enabled='no' hotpluggable='yes'/>
+    <vcpu id='16' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='17' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='18' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='19' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='20' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='21' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='22' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='23' enabled='yes' hotpluggable='yes'/>
+    <vcpu id='24' enabled='no' hotpluggable='yes'/>
+    <vcpu id='25' enabled='no' hotpluggable='yes'/>
+    <vcpu id='26' enabled='no' hotpluggable='yes'/>
+    <vcpu id='27' enabled='no' hotpluggable='yes'/>
+    <vcpu id='28' enabled='no' hotpluggable='yes'/>
+    <vcpu id='29' enabled='no' hotpluggable='yes'/>
+    <vcpu id='30' enabled='no' hotpluggable='yes'/>
+    <vcpu id='31' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>POWER9</model>
+    <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+      <alias name='pci.0'/>
+    </controller>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <alias name='balloon0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-domain.xml 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-domain.xml
new file mode 100644
index 000000000000..539f607818cd
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-domain.xml
@@ -0,0 +1,42 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='6'>8</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='no' hotpluggable='yes'/>
+    <vcpu id='6' enabled='no' hotpluggable='yes'/>
+    <vcpu id='7' enabled='yes' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-monitor.json 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-monitor.json
new file mode 100644
index 000000000000..6e96775c18b9
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-monitor.json
@@ -0,0 +1,186 @@
+{"execute":"query-hotpluggable-cpus","id":"libvirt-1"}
+
+{
+  "return": [
+    {
+      "props": {
+        "core-id": 1,
+        "thread-id": 1,
+        "socket-id": 1
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/peripheral/vcpu7",
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 1,
+        "thread-id": 0,
+        "socket-id": 1
+      },
+      "vcpus-count": 1,
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 0,
+        "thread-id": 1,
+        "socket-id": 1
+      },
+      "vcpus-count": 1,
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 0,
+        "thread-id": 0,
+        "socket-id": 1
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[5]",
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 1,
+        "thread-id": 1,
+        "socket-id": 0
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[4]",
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 1,
+        "thread-id": 0,
+        "socket-id": 0
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[3]",
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 0,
+        "thread-id": 1,
+        "socket-id": 0
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[2]",
+      "type": "qemu64-x86_64-cpu"
+    },
+    {
+      "props": {
+        "core-id": 0,
+        "thread-id": 0,
+        "socket-id": 0
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[0]",
+      "type": "qemu64-x86_64-cpu"
+    }
+  ],
+  "id": "libvirt-23"
+}
+
+{"execute":"query-cpus-fast","id":"libvirt-2"}
+
+{
+  "return": [
+    {
+      "target": "x86",
+      "current": true,
+      "cpu-index": 0,
+      "qom-path": "/machine/unattached/device[0]",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518291
+    },
+    {
+      "target": "x86",
+      "current": false,
+      "cpu-index": 1,
+      "qom-path": "/machine/unattached/device[2]",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518292
+    },
+    {
+      "target": "x86",
+      "current": false,
+      "cpu-index": 2,
+      "qom-path": "/machine/unattached/device[3]",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518294
+    },
+    {
+      "target": "x86",
+      "current": false,
+      "cpu-index": 3,
+      "qom-path": "/machine/unattached/device[4]",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518295
+    },
+    {
+      "target": "x86",
+      "current": false,
+      "cpu-index": 4,
+      "qom-path": "/machine/unattached/device[5]",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518296
+    },
+    {
+      "target": "x86",
+      "current": false,
+      "cpu-index": 5,
+      "qom-path": "/machine/peripheral/vcpu7",
+      "pc": -2130415978,
+      "halted": true,
+      "thread-id": 518297
+    }
+  ],
+  "id": "libvirt-22"
+}
+
+{
+    "execute": "device_del",
+    "arguments": {
+        "id": "vcpu7"
+    },
+    "id": "libvirt-3"
+}
+
+{"return": {}}
+
+{"execute":"query-hotpluggable-cpus","id":"libvirt-4"}
+
+{
+  "return": [
+    
{"props":{"socket-id":0,"core-id":0,"thread-id":0},"vcpus-count":1,"qom-path":"/machine/unattached/device[0]","type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":0,"core-id":0,"thread-id":1},"vcpus-count":1,"qom-path":"/machine/unattached/device[2]","type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":0,"core-id":1,"thread-id":0},"vcpus-count":1,"qom-path":"/machine/unattached/device[3]","type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":0,"core-id":1,"thread-id":1},"vcpus-count":1,"qom-path":"/machine/unattached/device[4]","type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":1,"core-id":0,"thread-id":0},"vcpus-count":1,"qom-path":"/machine/unattached/device[5]","type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":1,"core-id":0,"thread-id":1},"vcpus-count":1,"type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":1,"core-id":1,"thread-id":0},"vcpus-count":1,"type":"qemu64-x86_64-cpu"},
+    
{"props":{"socket-id":1,"core-id":1,"thread-id":1},"vcpus-count":1,"type":"qemu64-x86_64-cpu"}
+  ],
+  "id": "libvirt-4"
+}
+
+{"execute":"query-cpus-fast","id":"libvirt-5"}
+
+{
+  "return": [
+    
{"target":"x86","current":true,"cpu-index":0,"qom-path":"/machine/unattached/device[0]","pc":-2130415978,"halted":true,"thread-id":518291},
+    
{"target":"x86","current":false,"cpu-index":1,"qom-path":"/machine/unattached/device[2]","pc":-2130415978,"halted":true,"thread-id":518292},
+    
{"target":"x86","current":false,"cpu-index":2,"qom-path":"/machine/unattached/device[3]","pc":-2130415978,"halted":true,"thread-id":518294},
+    
{"target":"x86","current":false,"cpu-index":3,"qom-path":"/machine/unattached/device[4]","pc":-2130415978,"halted":true,"thread-id":518295},
+    
{"target":"x86","current":false,"cpu-index":4,"qom-path":"/machine/unattached/device[5]","pc":-2130415978,"halted":true,"thread-id":518296}
+  ],
+  "id": "libvirt-5"
+}
diff --git 
a/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-conf.xml 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-conf.xml
new file mode 100644
index 000000000000..f13f75d8d373
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-conf.xml
@@ -0,0 +1,42 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='5'>8</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='no' hotpluggable='yes'/>
+    <vcpu id='6' enabled='no' hotpluggable='yes'/>
+    <vcpu id='7' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-live.xml 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-live.xml
new file mode 100644
index 000000000000..be9c15e6c119
--- /dev/null
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-live.xml
@@ -0,0 +1,50 @@
+<domain type='qemu' id='7'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='5'>8</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='no' hotpluggable='yes'/>
+    <vcpu id='6' enabled='no' hotpluggable='yes'/>
+    <vcpu id='7' enabled='no' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci.0'/>
+    </controller>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <alias name='balloon0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git 
a/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-pending-live.xml
 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-pending-live.xml
new file mode 100644
index 000000000000..6a6c20e29031
--- /dev/null
+++ 
b/tests/qemuhotplugtestcpus/x86-modern-individual-del-async-result-pending-live.xml
@@ -0,0 +1,50 @@
+<domain type='qemu' id='7'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='6'>8</vcpu>
+  <vcpus>
+    <vcpu id='0' enabled='yes' hotpluggable='no'/>
+    <vcpu id='1' enabled='yes' hotpluggable='no'/>
+    <vcpu id='2' enabled='yes' hotpluggable='no'/>
+    <vcpu id='3' enabled='yes' hotpluggable='no'/>
+    <vcpu id='4' enabled='yes' hotpluggable='no'/>
+    <vcpu id='5' enabled='no' hotpluggable='yes'/>
+    <vcpu id='6' enabled='no' hotpluggable='yes'/>
+    <vcpu id='7' enabled='yes' hotpluggable='yes'/>
+  </vcpus>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+    <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci.0'/>
+    </controller>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <alias name='balloon0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
-- 
2.47.3

Reply via email to