mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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:
parent
20a017df68
commit
313215e15f
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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 ();
|
||||
|
@ -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 ?
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user