From 09ab9dcc85ec1148ba4c039213a0184d76c5ee98 Mon Sep 17 00:00:00 2001 From: Stefan Zimmermann Date: Wed, 18 Feb 2015 16:44:17 +0100 Subject: [PATCH] Prevent default creation of usb controller on s390 and s390x Since s390 does not support usb the default creation of a usb controller for a domain should not occur. Also adjust s390 test cases by removing usb device instances since usb devices are no longer created by default for s390 the s390 test cases need to be adjusted. Signed-off-by: Stefan Zimmermann Reviewed-by: Boris Fiuczynski --- src/qemu/qemu_command.c | 4 +++- src/qemu/qemu_domain.c | 6 ++++++ tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args | 2 +- .../qemuxml2argv-s390-piix-controllers.args | 2 +- .../qemuxml2xmlout-s390-defaultconsole.xml | 1 - 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7853125c08..fb3d5ab259 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9006,7 +9006,9 @@ qemuBuildCommandLine(virConnectPtr conn, } } - if (usbcontroller == 0 && !qemuDomainMachineIsQ35(def)) + if (usbcontroller == 0 && + !qemuDomainMachineIsQ35(def) && + !ARCH_IS_S390(def->os.arch)) virCommandAddArg(cmd, "-usb"); for (i = 0; i < def->nhubs; i++) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 99c46d484f..bd9d4f26ec 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -979,6 +979,12 @@ qemuDomainDefPostParse(virDomainDefPtr def, case VIR_ARCH_SH4EB: addPCIRoot = true; break; + case VIR_ARCH_S390: + addDefaultUSB = false; + break; + case VIR_ARCH_S390X: + addDefaultUSB = false; + break; default: break; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args b/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args index 6aee214c41..4ea75de929 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args @@ -2,5 +2,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ /usr/bin/qemu \ -name QEMUGuest1 -S -M s390-virtio -m 214 -smp 1 -nographic \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi \ --boot c -usb -hda /dev/HostVG/QEMUGuest1 -net none -serial \ +-boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial \ none -parallel none diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args index 10aecea58e..e939be45f4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args @@ -3,7 +3,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -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 -usb -drive \ +-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 \ diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml index 9a609f8666..54bb364ee2 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml @@ -14,7 +14,6 @@ destroy /usr/bin/qemu-kvm - -- GitLab