提交 1aeac2af 编写于 作者: J Ján Tomko 提交者: Cole Robinson

Display nicer error message for unsupported chardev hotplug

Use the device type name if we know it instead of its number,
even if we can't hotplug it:
qemuMonitorJSONAttachCharDevCommand:6094 : operation failed: Unsupported
char device type '10'

(cherry picked from commit cce8e5f7)
上级 35b06ceb
......@@ -5657,9 +5657,15 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_NMDM:
case VIR_DOMAIN_CHR_TYPE_LAST:
virReportError(VIR_ERR_OPERATION_FAILED,
_("Unsupported char device type '%d'"),
chr->type);
if (virDomainChrTypeToString(chr->type)) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Hotplug unsupported for char device type '%s'"),
virDomainChrTypeToString(chr->type));
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Hotplug unsupported for char device type '%d'"),
chr->type);
}
goto error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册