Skip to content

Commit

Permalink
admin: Do not generate remoteAdminConnect{Open,Close}
Browse files Browse the repository at this point in the history
As we plan to add more and more logic to remote connecting methods,
these cannot be generated from admin_protocol.x anymore. Instead,
this patch implements these to methods explicitly.
  • Loading branch information
eskultety committed Nov 30, 2015
1 parent b86cf88 commit 0ecf9b3
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/admin/admin_protocol.x
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ enum admin_procedure {
* in the function parameter list.
*/
/**
* @generate: client
* @generate: none
*/
ADMIN_PROC_CONNECT_OPEN = 1,

/**
* @generate: client
* @generate: none
*/
ADMIN_PROC_CONNECT_CLOSE = 2
};
45 changes: 45 additions & 0 deletions src/admin/admin_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,51 @@ call(virAdmConnectPtr conn,

#include "admin_client.h"

static int
remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;
admin_connect_open_args args;

virObjectLock(priv);

args.flags = flags;

if (call(conn, 0, ADMIN_PROC_CONNECT_OPEN,
(xdrproc_t)xdr_admin_connect_open_args, (char *)&args,
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
goto done;
}

rv = 0;

done:
virObjectUnlock(priv);
return rv;
}

static int
remoteAdminConnectClose(virAdmConnectPtr conn)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;

virObjectLock(priv);

if (call(conn, 0, ADMIN_PROC_CONNECT_CLOSE,
(xdrproc_t)xdr_void, (char *)NULL,
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
goto done;
}

rv = 0;

done:
virObjectUnlock(priv);
return rv;
}

static void
remoteAdminPrivFree(void *opaque)
{
Expand Down

0 comments on commit 0ecf9b3

Please sign in to comment.