qemuhotplugtest: Add also always-present capabilities

Use virQEMUCapsInitQMPBasicArch in qemuHotplugCreateObjects so that we
also add the always-present capabilities to the set of capabilities used
for the hotplug test and fix fallout.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa 2021-04-09 15:59:42 +02:00
parent 64ee4b2e45
commit 7d3ca9dbdd
24 changed files with 35 additions and 30 deletions

View File

@ -32,6 +32,9 @@
#include "virthread.h" #include "virthread.h"
#include "virfile.h" #include "virfile.h"
#define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW
#include "qemu/qemu_capspriv.h"
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE
static virQEMUDriver driver; static virQEMUDriver driver;
@ -71,6 +74,8 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt,
if (!(priv->qemuCaps = virQEMUCapsNew())) if (!(priv->qemuCaps = virQEMUCapsNew()))
return -1; return -1;
virQEMUCapsInitQMPBasicArch(priv->qemuCaps);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_CCW); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_CCW);

View File

@ -59,7 +59,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -67,7 +67,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -59,7 +59,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -67,7 +67,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -35,7 +35,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -43,7 +43,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -35,7 +35,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -43,7 +43,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -25,7 +25,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -33,7 +33,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<memballoon model='virtio'> <memballoon model='virtio'>
<alias name='balloon0'/> <alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</memballoon> </memballoon>
</devices> </devices>
</domain> </domain>

View File

@ -3,5 +3,5 @@
<server path='/var/lib/libvirt/shmem-shmem1-sock'/> <server path='/var/lib/libvirt/shmem-shmem1-sock'/>
<msi ioeventfd='on'/> <msi ioeventfd='on'/>
<alias name='shmem1'/> <alias name='shmem1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</shmem> </shmem>

View File

@ -2,5 +2,5 @@
<model type='ivshmem-plain'/> <model type='ivshmem-plain'/>
<size unit='M'>4</size> <size unit='M'>4</size>
<alias name='shmem0'/> <alias name='shmem0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</shmem> </shmem>

View File

@ -1,4 +1,4 @@
<watchdog model='i6300esb' action='poweroff'> <watchdog model='i6300esb' action='poweroff'>
<alias name='watchdog0'/> <alias name='watchdog0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</watchdog> </watchdog>

View File

@ -1,4 +1,4 @@
<watchdog model='i6300esb' action='poweroff'> <watchdog model='i6300esb' action='poweroff'>
<alias name='ua-UserWatchdog'/> <alias name='ua-UserWatchdog'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</watchdog> </watchdog>

View File

@ -27,7 +27,7 @@
<readonly/> <readonly/>
<shareable/> <shareable/>
<alias name='virtio-disk4'/> <alias name='virtio-disk4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</disk> </disk>
<controller type='usb' index='0'> <controller type='usb' index='0'>
<alias name='usb'/> <alias name='usb'/>

View File

@ -51,7 +51,7 @@
<address domain='0x0000' bus='0x06' slot='0x12' function='0x2'/> <address domain='0x0000' bus='0x06' slot='0x12' function='0x2'/>
</source> </source>
<alias name='hostdev0'/> <alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</hostdev> </hostdev>
<memballoon model='none'/> <memballoon model='none'/>
</devices> </devices>

View File

@ -43,7 +43,7 @@
<source dev='/dev/vhost-vdpa-0'/> <source dev='/dev/vhost-vdpa-0'/>
<model type='virtio'/> <model type='virtio'/>
<alias name='net0'/> <alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface> </interface>
<input type='mouse' bus='ps2'> <input type='mouse' bus='ps2'>
<alias name='input0'/> <alias name='input0'/>

View File

@ -50,14 +50,14 @@
<model type='ivshmem-plain'/> <model type='ivshmem-plain'/>
<size unit='M'>4</size> <size unit='M'>4</size>
<alias name='shmem0'/> <alias name='shmem0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</shmem> </shmem>
<shmem name='shmem1'> <shmem name='shmem1'>
<model type='ivshmem-doorbell'/> <model type='ivshmem-doorbell'/>
<server path='/var/lib/libvirt/shmem-shmem1-sock'/> <server path='/var/lib/libvirt/shmem-shmem1-sock'/>
<msi ioeventfd='on'/> <msi ioeventfd='on'/>
<alias name='shmem1'/> <alias name='shmem1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</shmem> </shmem>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -50,7 +50,7 @@
<model type='ivshmem-plain'/> <model type='ivshmem-plain'/>
<size unit='M'>4</size> <size unit='M'>4</size>
<alias name='shmem0'/> <alias name='shmem0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</shmem> </shmem>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -47,7 +47,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<watchdog model='i6300esb' action='poweroff'> <watchdog model='i6300esb' action='poweroff'>
<alias name='ua-UserWatchdog'/> <alias name='ua-UserWatchdog'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</watchdog> </watchdog>
<memballoon model='none'/> <memballoon model='none'/>
</devices> </devices>

View File

@ -47,7 +47,7 @@
<audio id='1' type='none'/> <audio id='1' type='none'/>
<watchdog model='i6300esb' action='poweroff'> <watchdog model='i6300esb' action='poweroff'>
<alias name='watchdog0'/> <alias name='watchdog0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</watchdog> </watchdog>
<memballoon model='none'/> <memballoon model='none'/>
</devices> </devices>

View File

@ -28,19 +28,19 @@
</controller> </controller>
<controller type='scsi' index='0' model='virtio-scsi'> <controller type='scsi' index='0' model='virtio-scsi'>
<alias name='scsi0'/> <alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='1' model='virtio-scsi'> <controller type='scsi' index='1' model='virtio-scsi'>
<alias name='scsi1'/> <alias name='scsi1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='2' model='virtio-scsi'> <controller type='scsi' index='2' model='virtio-scsi'>
<alias name='scsi2'/> <alias name='scsi2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='3' model='virtio-scsi'> <controller type='scsi' index='3' model='virtio-scsi'>
<alias name='scsi3'/> <alias name='scsi3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller> </controller>
<input type='mouse' bus='ps2'> <input type='mouse' bus='ps2'>
<alias name='input0'/> <alias name='input0'/>

View File

@ -38,19 +38,19 @@
</controller> </controller>
<controller type='scsi' index='0' model='virtio-scsi'> <controller type='scsi' index='0' model='virtio-scsi'>
<alias name='scsi0'/> <alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='1' model='virtio-scsi'> <controller type='scsi' index='1' model='virtio-scsi'>
<alias name='scsi1'/> <alias name='scsi1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='2' model='virtio-scsi'> <controller type='scsi' index='2' model='virtio-scsi'>
<alias name='scsi2'/> <alias name='scsi2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller> </controller>
<controller type='scsi' index='3' model='virtio-scsi'> <controller type='scsi' index='3' model='virtio-scsi'>
<alias name='scsi3'/> <alias name='scsi3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller> </controller>
<input type='mouse' bus='ps2'> <input type='mouse' bus='ps2'>
<alias name='input0'/> <alias name='input0'/>