mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-04 21:47:16 +03:00
qemu: move out legacy USB controller formatting
Move out the code formatting "-usb" on the QEMU command line. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
c2a8256991
commit
a98c0a2fef
@ -3049,6 +3049,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd,
|
||||
const virDomainDef *def,
|
||||
int usbcontroller)
|
||||
{
|
||||
if (usbcontroller == 0 &&
|
||||
!qemuDomainIsQ35(def) &&
|
||||
!qemuDomainIsARMVirt(def) &&
|
||||
!qemuDomainIsRISCVVirt(def) &&
|
||||
!ARCH_IS_S390(def->os.arch)) {
|
||||
/* We haven't added any USB controller yet, but we haven't been asked
|
||||
* not to add one either. Add a legacy USB controller, unless we're
|
||||
* creating a kind of guest we want to keep legacy-free */
|
||||
virCommandAddArg(cmd, "-usb");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBuildSkipController:
|
||||
* @controller: Controller to check
|
||||
@ -3184,16 +3204,8 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd,
|
||||
}
|
||||
}
|
||||
|
||||
if (usbcontroller == 0 &&
|
||||
!qemuDomainIsQ35(def) &&
|
||||
!qemuDomainIsARMVirt(def) &&
|
||||
!qemuDomainIsRISCVVirt(def) &&
|
||||
!ARCH_IS_S390(def->os.arch)) {
|
||||
/* We haven't added any USB controller yet, but we haven't been asked
|
||||
* not to add one either. Add a legacy USB controller, unless we're
|
||||
* creating a kind of guest we want to keep legacy-free */
|
||||
virCommandAddArg(cmd, "-usb");
|
||||
}
|
||||
if (qemuBuildLegacyUSBControllerCommandLine(cmd, def, usbcontroller) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user