mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-11 05:24:44 -05:00
Implement RPC driver support for virDomainOpenGraphics
Since it needs to access file descriptors passed in the msg, the RPC driver for virDomainOpenGraphics needs to be manually implemented. * daemon/remote.c: RPC server dispatcher * src/remote/remote_driver.c: RPC client dispatcher * src/remote/remote_protocol.x: Define protocol
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "intprops.h"
|
||||
#include "virnetserverservice.h"
|
||||
#include "virnetserver.h"
|
||||
#include "virfile.h"
|
||||
|
||||
#include "remote_protocol.h"
|
||||
#include "qemu_protocol.h"
|
||||
@@ -3214,6 +3215,48 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchDomainOpenGraphics(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
virNetServerClientPtr client ATTRIBUTE_UNUSED,
|
||||
virNetMessagePtr msg,
|
||||
virNetMessageErrorPtr rerr,
|
||||
remote_domain_open_graphics_args *args)
|
||||
{
|
||||
virDomainPtr dom = NULL;
|
||||
int rv = -1;
|
||||
int fd = -1;
|
||||
struct daemonClientPrivate *priv =
|
||||
virNetServerClientGetPrivateData(client);
|
||||
|
||||
if (!priv->conn) {
|
||||
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
|
||||
goto cleanup;
|
||||
|
||||
if ((fd = virNetMessageDupFD(msg, 0)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainOpenGraphics(dom,
|
||||
args->idx,
|
||||
fd,
|
||||
args->flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
rv = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (dom)
|
||||
virDomainFree(dom);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/*----- Helpers. -----*/
|
||||
|
||||
/* get_nonnull_domain and get_nonnull_network turn an on-wire
|
||||
|
||||
Reference in New Issue
Block a user