]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Fix aliases for pSeries buses
authorAndrea Bolognani <abologna@redhat.com>
Thu, 2 Mar 2017 14:51:44 +0000 (15:51 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 3 Mar 2017 11:55:13 +0000 (12:55 +0100)
virQEMUCapsHasPCIMultiBus() performs a version check on
the QEMU binary to figure out whether multiple buses are
supported, so to get the correct aliases assigned when
dealing with pSeries guests we need to spoof the version
accordingly in the test suite.

src/qemu/qemu_capabilities.c
src/qemu/qemu_capspriv.h
tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args
tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args
tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args
tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
tests/qemuxml2argvtest.c

index 17964a1ad6c9ac570b7399cd88084709d315dbd6..6e41509fc660bdfb6d5e265b0e5b2ef7c07dc0b9 100644 (file)
@@ -2341,6 +2341,14 @@ virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps)
 }
 
 
+void
+virQEMUCapsSetVersion(virQEMUCapsPtr qemuCaps,
+                      unsigned int version)
+{
+    qemuCaps->version = version;
+}
+
+
 unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps)
 {
     return qemuCaps->version;
index 38b971e0e0b849250eaa69504af287656dfd7126..c1d36dba9be010b27267ace9a323b9e81a467f59 100644 (file)
@@ -69,6 +69,10 @@ void
 virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
                    virArch arch);
 
+void
+virQEMUCapsSetVersion(virQEMUCapsPtr qemuCaps,
+                      unsigned int version);
+
 void
 virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
                             virCapsPtr caps);
index 475b7214ecae8233255772069364f097588c650e..781f30db0d9ea44c2c10ace428949426ad4dae01 100644 (file)
@@ -25,4 +25,4 @@ QEMU_AUDIO_DRV=none \
 -append 'root=/dev/ram rw console=ttyS0,115200' \
 -usb \
 -serial pty \
--device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x2
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
index b1e7410732942c64420346d08273145dbd9671a0..58c1526cd0a1ca20bca25ed8a7d9902ff46396c3 100644 (file)
@@ -22,4 +22,4 @@ QEMU_AUDIO_DRV=none \
 -dtb /media/ram/test.dtb \
 -usb \
 -serial pty \
--device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x2
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
index bed5045fb7262bd1da39610d988a4c46f4774e7d..9226c5e89f4ddeb7d9fa219fd0a9c7d0171be468 100644 (file)
@@ -16,4 +16,4 @@ QEMU_AUDIO_DRV=none \
 -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
 -boot c \
 -usb \
--device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x6
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
index 2ec223108cdc233ef52fe744a100ef732a03e25e..157f5d9d4e656ce775718dcab16c8388d422ca8e 100644 (file)
@@ -15,5 +15,5 @@ QEMU_AUDIO_DRV=none \
 -nodefaults \
 -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
 -boot c \
--device pci-ohci,id=usb,bus=pci,addr=0x1 \
--device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x6
+-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
index 7dba956b418647edd626da289acdc7bccb96eac4..d623836026157e68da196e2af775cf7b94477196 100644 (file)
@@ -23,4 +23,4 @@ server,nowait \
 -append 'root=/dev/ram rw console=ttyS0,115200' \
 -usb \
 -serial pty \
--device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x2
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2
index 251e786e62f8d10879d09bb453709786fc64982c..56e3552a8e9be8e8435fdcfe0ddbd09db8a9af54 100644 (file)
@@ -19,6 +19,6 @@ server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=readline \
 -no-acpi \
 -boot c \
--device pci-ohci,id=usb,bus=pci,addr=0x1 \
+-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
 -chardev pty,id=charserial0 \
 -device spapr-vty,chardev=charserial0,reg=0x30000000
index 845128344fb79f710c90488256207456b2df90d1..1a672c62ab39fc12a4f0b84e3bbf2ce0ef6d5f52 100644 (file)
@@ -19,7 +19,7 @@ server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=readline \
 -no-acpi \
 -boot c \
--device pci-ohci,id=usb,bus=pci,addr=0x1 \
+-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
 -chardev pty,id=charserial0 \
 -device spapr-vty,chardev=charserial0,reg=0x30000000 \
 -device usb-kbd,id=input0,bus=usb.0,port=1
index 50e273b42fc0f696eebd0ef7cac97e5f2731a02a..7273891025f177f6bef86146a13ec3e2260fccab 100644 (file)
@@ -19,7 +19,7 @@ server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=readline \
 -no-acpi \
 -boot c \
--device piix3-usb-uhci,id=usb,bus=pci,addr=0x1 \
--device pci-ohci,id=usb1,bus=pci,addr=0x2 \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1 \
+-device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \
 -chardev pty,id=charserial0 \
 -device spapr-vty,chardev=charserial0,reg=0x30000000
index 3284f40922779418440e0d56e2b3d63463c852aa..b03644bdfa6fb1cc8217cebd5e2834dd4dec28af 100644 (file)
@@ -381,6 +381,11 @@ testUpdateQEMUCaps(const struct testInfo *info,
 
     virQEMUCapsSetArch(info->qemuCaps, vm->def->os.arch);
 
+    /* We need to pretend QEMU 2.0.0 is in use so that pSeries guests
+     * will get the correct alias assigned to their buses.
+     * See virQEMUCapsHasPCIMultiBus() */
+    virQEMUCapsSetVersion(info->qemuCaps, 2000000);
+
     if (testAddCPUModels(info->qemuCaps, info->skipLegacyCPUs) < 0)
         goto cleanup;