implement the remote protocol

* daemon/remote.c
* daemon/remote_dispatch_args.h
* daemon/remote_dispatch_prototypes.h
* daemon/remote_dispatch_ret.h
* daemon/remote_dispatch_table.h
* src/remote/remote_driver.c
* src/remote/remote_protocol.c
* src/remote/remote_protocol.h
* src/remote/remote_protocol.x
* src/remote_protocol-structs
This commit is contained in:
Osier Yang 2010-11-15 11:23:34 +08:00 committed by Eric Blake
parent 20a017df68
commit 313215e15f
10 changed files with 116 additions and 2 deletions

View File

@ -5965,6 +5965,34 @@ static int remoteDispatchDomainIsPersistent(struct qemud_server *server ATTRIBUT
return 0;
}
static int remoteDispatchDomainIsUpdated(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
remote_message_header *hdr ATTRIBUTE_UNUSED,
remote_error *err,
remote_domain_is_updated_args *args,
remote_domain_is_updated_ret *ret)
{
virDomainPtr domain;
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(err, conn);
return -1;
}
ret->updated = virDomainIsUpdated(domain);
if (ret->updated < 0) {
virDomainFree(domain);
remoteDispatchConnError(err, conn);
return -1;
}
virDomainFree(domain);
return 0;
}
static int remoteDispatchInterfaceIsActive(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,

View File

@ -170,3 +170,4 @@
remote_domain_set_vcpus_flags_args val_remote_domain_set_vcpus_flags_args;
remote_domain_get_vcpus_flags_args val_remote_domain_get_vcpus_flags_args;
remote_domain_open_console_args val_remote_domain_open_console_args;
remote_domain_is_updated_args val_remote_domain_is_updated_args;

View File

@ -354,6 +354,14 @@ static int remoteDispatchDomainIsPersistent(
remote_error *err,
remote_domain_is_persistent_args *args,
remote_domain_is_persistent_ret *ret);
static int remoteDispatchDomainIsUpdated(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_is_updated_args *args,
remote_domain_is_updated_ret *ret);
static int remoteDispatchDomainLookupById(
struct qemud_server *server,
struct qemud_client *client,

View File

@ -137,3 +137,4 @@
remote_domain_create_with_flags_ret val_remote_domain_create_with_flags_ret;
remote_domain_get_memory_parameters_ret val_remote_domain_get_memory_parameters_ret;
remote_domain_get_vcpus_flags_ret val_remote_domain_get_vcpus_flags_ret;
remote_domain_is_updated_ret val_remote_domain_is_updated_ret;

View File

@ -1012,3 +1012,8 @@
.args_filter = (xdrproc_t) xdr_remote_domain_open_console_args,
.ret_filter = (xdrproc_t) xdr_void,
},
{ /* DomainIsUpdated => 202 */
.fn = (dispatch_fn) remoteDispatchDomainIsUpdated,
.args_filter = (xdrproc_t) xdr_remote_domain_is_updated_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_is_updated_ret,
},

View File

@ -1983,6 +1983,30 @@ done:
return rv;
}
static int
remoteDomainIsUpdated(virDomainPtr domain)
{
int rv = -1;
remote_domain_is_updated_args args;
remote_domain_is_updated_ret ret;
struct private_data *priv = domain->conn->privateData;
remoteDriverLock(priv);
make_nonnull_domain (&args.dom, domain);
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_UPDATED,
(xdrproc_t) xdr_remote_domain_is_updated_args, (char *) &args,
(xdrproc_t) xdr_remote_domain_is_updated_ret, (char *) &ret) == -1)
goto done;
rv = ret.updated;
done:
remoteDriverUnlock(priv);
return rv;
}
static virDomainPtr
remoteDomainCreateXML (virConnectPtr conn,
const char *xmlDesc,
@ -10734,7 +10758,7 @@ static virDriver remote_driver = {
remoteIsSecure, /* isSecure */
remoteDomainIsActive, /* domainIsActive */
remoteDomainIsPersistent, /* domainIsPersistent */
NULL, /* domainIsUpdated */
remoteDomainIsUpdated, /* domainIsUpdated */
remoteCPUCompare, /* cpuCompare */
remoteCPUBaseline, /* cpuBaseline */
remoteDomainGetJobInfo, /* domainGetJobInfo */

View File

@ -3176,6 +3176,24 @@ xdr_remote_domain_is_persistent_ret (XDR *xdrs, remote_domain_is_persistent_ret
return TRUE;
}
bool_t
xdr_remote_domain_is_updated_args (XDR *xdrs, remote_domain_is_updated_args *objp)
{
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_is_updated_ret (XDR *xdrs, remote_domain_is_updated_ret *objp)
{
if (!xdr_int (xdrs, &objp->updated))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_network_is_active_args (XDR *xdrs, remote_network_is_active_args *objp)
{

View File

@ -1801,6 +1801,16 @@ struct remote_domain_is_persistent_ret {
};
typedef struct remote_domain_is_persistent_ret remote_domain_is_persistent_ret;
struct remote_domain_is_updated_args {
remote_nonnull_domain dom;
};
typedef struct remote_domain_is_updated_args remote_domain_is_updated_args;
struct remote_domain_is_updated_ret {
int updated;
};
typedef struct remote_domain_is_updated_ret remote_domain_is_updated_ret;
struct remote_network_is_active_args {
remote_nonnull_network net;
};
@ -2309,6 +2319,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS = 199,
REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS = 200,
REMOTE_PROC_DOMAIN_OPEN_CONSOLE = 201,
REMOTE_PROC_DOMAIN_IS_UPDATED = 202,
};
typedef enum remote_procedure remote_procedure;
@ -2630,6 +2641,8 @@ extern bool_t xdr_remote_domain_is_active_args (XDR *, remote_domain_is_active_
extern bool_t xdr_remote_domain_is_active_ret (XDR *, remote_domain_is_active_ret*);
extern bool_t xdr_remote_domain_is_persistent_args (XDR *, remote_domain_is_persistent_args*);
extern bool_t xdr_remote_domain_is_persistent_ret (XDR *, remote_domain_is_persistent_ret*);
extern bool_t xdr_remote_domain_is_updated_args (XDR *, remote_domain_is_updated_args*);
extern bool_t xdr_remote_domain_is_updated_ret (XDR *, remote_domain_is_updated_ret*);
extern bool_t xdr_remote_network_is_active_args (XDR *, remote_network_is_active_args*);
extern bool_t xdr_remote_network_is_active_ret (XDR *, remote_network_is_active_ret*);
extern bool_t xdr_remote_network_is_persistent_args (XDR *, remote_network_is_persistent_args*);
@ -2974,6 +2987,8 @@ extern bool_t xdr_remote_domain_is_active_args ();
extern bool_t xdr_remote_domain_is_active_ret ();
extern bool_t xdr_remote_domain_is_persistent_args ();
extern bool_t xdr_remote_domain_is_persistent_ret ();
extern bool_t xdr_remote_domain_is_updated_args ();
extern bool_t xdr_remote_domain_is_updated_ret ();
extern bool_t xdr_remote_network_is_active_args ();
extern bool_t xdr_remote_network_is_active_ret ();
extern bool_t xdr_remote_network_is_persistent_args ();

View File

@ -1600,6 +1600,13 @@ struct remote_domain_is_persistent_ret {
int persistent;
};
struct remote_domain_is_updated_args {
remote_nonnull_domain dom;
};
struct remote_domain_is_updated_ret {
int updated;
};
struct remote_network_is_active_args {
remote_nonnull_network net;
@ -2086,7 +2093,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS = 199,
REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS = 200,
REMOTE_PROC_DOMAIN_OPEN_CONSOLE = 201
REMOTE_PROC_DOMAIN_OPEN_CONSOLE = 201,
REMOTE_PROC_DOMAIN_IS_UPDATED = 202
/*
* Notice how the entries are grouped in sets of 10 ?

View File

@ -1152,6 +1152,12 @@ struct remote_domain_is_persistent_args {
struct remote_domain_is_persistent_ret {
int persistent;
};
struct remote_domain_is_updated_args {
remote_nonnull_domain dom;
};
struct remote_domain_is_updated_ret {
int updated;
};
struct remote_network_is_active_args {
remote_nonnull_network net;
};