mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-20 04:59:49 +00:00
qemu: exit early if USB_CONTROLLER_MODEL_NONE is present
This removes the need to mark it in the 'usbcontroller' variable. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
a98c0a2fef
commit
79c7cbaf46
@ -3054,6 +3054,19 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
int usbcontroller)
|
int usbcontroller)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < def->ncontrollers; i++) {
|
||||||
|
virDomainControllerDefPtr cont = def->controllers[i];
|
||||||
|
|
||||||
|
if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_USB)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* If we have mode='none', there are no other USB controllers */
|
||||||
|
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (usbcontroller == 0 &&
|
if (usbcontroller == 0 &&
|
||||||
!qemuDomainIsQ35(def) &&
|
!qemuDomainIsQ35(def) &&
|
||||||
!qemuDomainIsARMVirt(def) &&
|
!qemuDomainIsARMVirt(def) &&
|
||||||
@ -3155,7 +3168,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
|
|||||||
/* skip USB controllers with type none.*/
|
/* skip USB controllers with type none.*/
|
||||||
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||||
cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
|
cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
|
||||||
usbcontroller = -1; /* mark we don't want a controller */
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user