mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: don't assign a PCI address to 'none' USB controller
Adjust the usb-none test, since it gives the memballoon a lower PCI slot now. Add a test for 'none' controller on s390, which doesn't have PCI buses.
This commit is contained in:
parent
91d1911c2f
commit
a12475bd44
@ -1917,6 +1917,11 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
|
||||
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
|
||||
continue;
|
||||
|
||||
/* USB controller model 'none' doesn't need a PCI address */
|
||||
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||
def->controllers[i]->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE)
|
||||
continue;
|
||||
|
||||
/* FDC lives behind the ISA bridge; CCID is a usb device */
|
||||
if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_FDC ||
|
||||
def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_CCID)
|
||||
|
11
tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args
Normal file
11
tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args
Normal file
@ -0,0 +1,11 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
|
||||
/usr/bin/qemu-system-s390x -S -M s390-virtio -m 214 -smp 1 \
|
||||
-nographic -nodefconfig -nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi \
|
||||
-device virtio-serial-s390,id=virtio-serial0 \
|
||||
-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
|
||||
-device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||
-chardev pty,id=charconsole0 \
|
||||
-device virtconsole,chardev=charconsole0,id=console0 \
|
||||
-object rng-random,id=rng0,filename=/dev/hwrng -device virtio-rng-s390,rng=rng0
|
29
tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml
Normal file
29
tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<domain type='qemu'>
|
||||
<name>test</name>
|
||||
<memory>219100</memory>
|
||||
<currentMemory>219100</currentMemory>
|
||||
<os>
|
||||
<type arch='s390x' machine='s390-virtio'>hvm</type>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='virtio'/>
|
||||
<boot order='1'/>
|
||||
</disk>
|
||||
<console type='pty'>
|
||||
<target type='virtio'/>
|
||||
</console>
|
||||
<controller type='usb' index='0' model='none'/>
|
||||
<memballoon model='virtio'>
|
||||
</memballoon>
|
||||
<rng model='virtio'>
|
||||
<backend model='random'>/dev/hwrng</backend>
|
||||
</rng>
|
||||
</devices>
|
||||
</domain>
|
@ -2,4 +2,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
|
||||
-M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
|
||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
|
||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
||||
|
@ -955,6 +955,11 @@ mymain(void)
|
||||
QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_VIRTIO_RNG,
|
||||
QEMU_CAPS_OBJECT_RNG_RANDOM);
|
||||
|
||||
DO_TEST("s390-usb-none",
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
|
||||
QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390,
|
||||
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
|
||||
|
||||
DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
|
||||
|
||||
DO_TEST("tpm-passthrough", QEMU_CAPS_DEVICE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user