提交 9cdac8af 编写于 作者: L Laine Stump

qemu: simplify addition of USB controller in qemuParseCommandLine

virDomainDefAddUSBController() does everything that the multiple lines
of code were doing.
上级 4aeb1d51
...@@ -2371,14 +2371,8 @@ qemuParseCommandLine(virCapsPtr caps, ...@@ -2371,14 +2371,8 @@ qemuParseCommandLine(virCapsPtr caps,
WANT_VALUE(); WANT_VALUE();
/* ignore, generted on the fly */ /* ignore, generted on the fly */
} else if (STREQ(arg, "-usb")) { } else if (STREQ(arg, "-usb")) {
virDomainControllerDefPtr ctldef; if (virDomainDefAddUSBController(def, -1, -1) < 0)
ctldef = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB);
if (!ctldef)
goto error; goto error;
if (virDomainControllerInsert(def, ctldef) < 0) {
virDomainControllerDefFree(ctldef);
goto error;
}
} else if (STREQ(arg, "-pidfile")) { } else if (STREQ(arg, "-pidfile")) {
WANT_VALUE(); WANT_VALUE();
if (pidfile) if (pidfile)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册