Add RPC implementation for virDomainOpenGraphicsFd

This commit is contained in:
Ján Tomko committed 2014-08-26 19:26:28 +02:00
1 parent 3ddc85440e
commit 408aae3849
6 files changed
+136 -1

No files matched your search

+44
View File
@@ -4398,6 +4398,50 @@ remoteDispatchDomainOpenGraphics(virNetServerPtr server ATTRIBUTE_UNUSED,
return rv;
}
static int
remoteDispatchDomainOpenGraphicsFd(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,
virNetMessagePtr msg,
virNetMessageErrorPtr rerr,
remote_domain_open_graphics_fd_args *args)
{
virDomainPtr dom = NULL;
int rv = -1;
int fd = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
if (!priv->conn) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
goto cleanup;
if (virDomainOpenGraphicsFD(dom,
args->idx,
&fd,
args->flags) < 0)
goto cleanup;
if (virNetMessageAddFD(msg, fd) < 0)
goto cleanup;
/* return 1 here to let virNetServerProgramDispatchCall know
* we are passing a FD */
rv = 1;
cleanup:
VIR_FORCE_CLOSE(fd);
if (rv < 0) {
virNetMessageSaveError(rerr);
}
if (dom)
virDomainFree(dom);
return rv;
}
static int
remoteDispatchDomainGetInterfaceParameters(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client ATTRIBUTE_UNUSED,