mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: simplify addition of USB controller in qemuParseCommandLine
virDomainDefAddUSBController() does everything that the multiple lines of code were doing.
This commit is contained in:
parent
4aeb1d5158
commit
9cdac8afc9
@ -2371,14 +2371,8 @@ qemuParseCommandLine(virCapsPtr caps,
|
||||
WANT_VALUE();
|
||||
/* ignore, generted on the fly */
|
||||
} else if (STREQ(arg, "-usb")) {
|
||||
virDomainControllerDefPtr ctldef;
|
||||
ctldef = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB);
|
||||
if (!ctldef)
|
||||
if (virDomainDefAddUSBController(def, -1, -1) < 0)
|
||||
goto error;
|
||||
if (virDomainControllerInsert(def, ctldef) < 0) {
|
||||
virDomainControllerDefFree(ctldef);
|
||||
goto error;
|
||||
}
|
||||
} else if (STREQ(arg, "-pidfile")) {
|
||||
WANT_VALUE();
|
||||
if (pidfile)
|
||||
|
Loading…
Reference in New Issue
Block a user