diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index fb8d3d8045b89515f7eb8bb24e0749791da9bebd..4fafdf266ac6bbeb43af2f29f9c48042fd832fde 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -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)