提交 6ffb8fff 编写于 作者: D Daniel P. Berrangé

qemu: sanity check vhost user FD before passing to QEMU

Ensure that the FD we're passing to QEMU is actually open, so we get a
sane error message upfront instead of telling QEMU to use a closed FD.
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 227925a2
......@@ -4704,6 +4704,12 @@ qemuBuildVhostUserChardevStr(const char *alias,
{
char *chardev = NULL;
if (*fd == -1) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Attempt to pass closed vhostuser FD"));
return NULL;
}
if (virAsprintf(&chardev, "socket,id=chr-vu-%s,fd=%d", alias, *fd) < 0)
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册