admin: Do not generate remoteAdminConnect{Open,Close}

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.
This commit is contained in:
Erik Skultety 2015-10-12 17:08:29 +02:00
parent b86cf8821b
commit 0ecf9b3e09
2 changed files with 47 additions and 2 deletions

View File

@ -64,12 +64,12 @@ enum admin_procedure {
* in the function parameter list. * in the function parameter list.
*/ */
/** /**
* @generate: client * @generate: none
*/ */
ADMIN_PROC_CONNECT_OPEN = 1, ADMIN_PROC_CONNECT_OPEN = 1,
/** /**
* @generate: client * @generate: none
*/ */
ADMIN_PROC_CONNECT_CLOSE = 2 ADMIN_PROC_CONNECT_CLOSE = 2
}; };

View File

@ -101,6 +101,51 @@ call(virAdmConnectPtr conn,
#include "admin_client.h" #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 static void
remoteAdminPrivFree(void *opaque) remoteAdminPrivFree(void *opaque)
{ {