diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0aec49449c..8c85446c3d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5641,9 +5641,14 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, * * See qemuBuildControllersCommandLine() */ - /* Default USB controller is piix3-uhci if available. */ + /* Default USB controller is piix3-uhci if available. Fall back to + * 'pci-ohci' otherwise which is the default for non-x86 machines + * which honour -usb */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + else if (!ARCH_IS_X86(def->os.arch) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) + cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; if (ARCH_IS_S390(def->os.arch)) { if (cont->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args index 8a9bc370af..c89656699a 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --usb \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml index 3899a4ecb1..7e74642ba5 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-mac99ppc.ppc-latest.xml @@ -19,7 +19,7 @@ restart /usr/bin/qemu-system-ppc - +
diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args index d7bad74061..a05a413290 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --usb \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml index ebea79c6d0..d934c3e842 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-versatilepb-armv7l.armv7l-latest.xml @@ -18,7 +18,7 @@ /usr/bin/qemu-system-armv7l - +