We assign the USB controller model without first checking
whether the corresponding QEMU device is available, and that
results in a late error instead of an early one.
Be consistent with how we do things in all other cases and
check the presence of the capability before attempting to set
the model.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
if (STREQ(def->os.machine, "versatilepb") ||
STRPREFIX(def->os.machine, "realview")) {
addDefaultUSB = true;
- usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI))
+ usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI;
}
if (qemuDomainIsARMVirt(def))
-unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary
+internal error: Unable to determine model for USB controller idx=0
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
- <controller type='usb' index='0' model='pci-ohci'/>
+ <controller type='usb' index='0'/>
<audio id='1' type='none'/>
<memballoon model='none'/>
</devices>
-unsupported configuration: USB controller model 'pci-ohci' not supported in this QEMU binary
+internal error: Unable to determine model for USB controller idx=0
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-armv7l</emulator>
- <controller type='usb' index='0' model='pci-ohci'>
+ <controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>