提交 78f66a12 编写于 作者: D Daniel P. Berrangé

qemu: drop support for agent connections on PTYs

Libvirt has never configured the QEMU agent to support
running on a PTY implicitly. In theory an end user may
have written such an XML config, but this is reasonably
unlikely since when a bare <channel> is provided, libvirt
will auto-expand it to a UNIX socket backend.

With this change a user who has use the PTY backend will
have to switch to the UNIX backend if they wish to use
libvirt APIs for interacting with the agent. This will
not have guest ABI impact.
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 7b62dfc7
...@@ -224,30 +224,6 @@ qemuAgentOpenUnix(const char *monitor) ...@@ -224,30 +224,6 @@ qemuAgentOpenUnix(const char *monitor)
return -1; return -1;
} }
static int
qemuAgentOpenPty(const char *monitor)
{
int monfd;
if ((monfd = open(monitor, O_RDWR | O_NONBLOCK)) < 0) {
virReportSystemError(errno,
_("Unable to open monitor path %s"), monitor);
return -1;
}
if (virSetCloseExec(monfd) < 0) {
virReportSystemError(errno, "%s",
_("Unable to set monitor close-on-exec flag"));
goto error;
}
return monfd;
error:
VIR_FORCE_CLOSE(monfd);
return -1;
}
static int static int
qemuAgentIOProcessEvent(qemuAgentPtr mon, qemuAgentIOProcessEvent(qemuAgentPtr mon,
...@@ -706,22 +682,14 @@ qemuAgentOpen(virDomainObjPtr vm, ...@@ -706,22 +682,14 @@ qemuAgentOpen(virDomainObjPtr vm,
mon->vm = vm; mon->vm = vm;
mon->cb = cb; mon->cb = cb;
switch (config->type) { if (config->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
case VIR_DOMAIN_CHR_TYPE_UNIX:
mon->fd = qemuAgentOpenUnix(config->data.nix.path);
break;
case VIR_DOMAIN_CHR_TYPE_PTY:
mon->fd = qemuAgentOpenPty(config->data.file.path);
break;
default:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"), _("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type)); virDomainChrTypeToString(config->type));
goto cleanup; goto cleanup;
} }
mon->fd = qemuAgentOpenUnix(config->data.nix.path);
if (mon->fd == -1) if (mon->fd == -1)
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册