mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
Fix error message on redirdev caps detection
This commit is contained in:
parent
cafb934db8
commit
952f8a7394
@ -9512,8 +9512,12 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(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;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
|
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
|
||||||
|
@ -1358,12 +1358,16 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
|
|||||||
virDomainDefPtr def = vm->def;
|
virDomainDefPtr def = vm->def;
|
||||||
char *devstr = NULL;
|
char *devstr = NULL;
|
||||||
|
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
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)
|
if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
|
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->redirdevs, vm->def->nredirdevs+1) < 0)
|
if (VIR_REALLOC_N(vm->def->redirdevs, vm->def->nredirdevs+1) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user