提交 952f8a73 编写于 作者: J Ján Tomko

Fix error message on redirdev caps detection

上级 cafb934d
......@@ -9512,8 +9512,12 @@ qemuBuildCommandLine(virConnectPtr conn,
virCommandAddArg(cmd, devstr);
VIR_FREE(devstr);
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("redirected devices are not supported by this QEMU"));
goto error;
}
virCommandAddArg(cmd, "-device");
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
......
......@@ -1358,13 +1358,17 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
virDomainDefPtr def = vm->def;
char *devstr = NULL;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
goto error;
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
goto error;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("redirected devices are not supported by this QEMU"));
goto error;
}
if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
goto error;
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
goto error;
if (VIR_REALLOC_N(vm->def->redirdevs, vm->def->nredirdevs+1) < 0)
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册