From 9cdac8afc91431620bb13a1e7ff299fbdb037e99 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Tue, 10 May 2016 12:07:54 -0400 Subject: [PATCH] qemu: simplify addition of USB controller in qemuParseCommandLine virDomainDefAddUSBController() does everything that the multiple lines of code were doing. --- src/qemu/qemu_parse_command.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index fb8d3d8045..4fafdf266a 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)