[PATCH 2/2] tests: Fix aliases for pSeries buses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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                                      | 8 ++++++++
 src/qemu/qemu_capspriv.h                                          | 4 ++++
 .../qemuxml2argv-memory-hotplug-ppc64-nonuma.args                 | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args                  | 2 +-
 .../qemuxml2argv-ppc64-usb-controller-legacy.args                 | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args     | 4 ++--
 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args           | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args      | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args          | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args        | 4 ++--
 tests/qemuxml2argvtest.c                                          | 5 +++++
 11 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 17964a1..6e41509 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -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;
diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h
index 38b971e..c1d36db 100644
--- a/src/qemu/qemu_capspriv.h
+++ b/src/qemu/qemu_capspriv.h
@@ -70,6 +70,10 @@ virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps,
                    virArch arch);
 
 void
+virQEMUCapsSetVersion(virQEMUCapsPtr qemuCaps,
+                      unsigned int version);
+
+void
 virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
                             virCapsPtr caps);
 #endif
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args
index 475b721..781f30d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args
index b1e7410..58c1526 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args
index bed5045..9226c5e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
index 2ec2231..157f5d9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
index 7dba956..d623836 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
index 251e786..56e3552 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
index 8451283..1a672c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
@@ -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
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
index 50e273b..7273891 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args
@@ -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
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3284f40..b03644b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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;
 
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux