提交 6692ba73 编写于 作者: P Peter Krempa

qemu: process: report useful error if alias formatting fails

When retrieving the paths for PTY devices the alias gets formatted into
a static string. If it doesn't fit we wouldn't report an error.
上级 507ea951
......@@ -1879,8 +1879,12 @@ qemuProcessLookupPTYs(virDomainDefPtr def,
if (snprintf(id, sizeof(id), "%s%s",
chardevfmt ? "char" : "",
chr->info.alias) >= sizeof(id))
chr->info.alias) >= sizeof(id)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to format device alias "
"for PTY retrieval"));
return -1;
}
path = (const char *) virHashLookup(paths, id);
if (path == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册