mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 08:35:15 +00:00
Remote protocol impl for virDomainUpdateDeviceFlags
This defines the wire format for the new virDomainUpdateDeviceFlags() API, and implements the server & client side of the marshalling code. * daemon/remote.c: Server side dispatch for virDomainUpdateDeviceFlags * src/remote/remote_driver.c: Client side serialization for virDomainUpdateDeviceFlags * src/remote/remote_protocol.x: Define wire format for virDomainUpdateDeviceFlags * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h, daemon/remote_dispatch_table.h, src/remote/remote_protocol.c, src/remote/remote_protocol.h: Re-generate code
This commit is contained in:
parent
46a2ea3689
commit
ee9083aba5
@ -1117,6 +1117,32 @@ remoteDispatchDomainAttachDeviceFlags (struct qemud_server *server ATTRIBUTE_UNU
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainUpdateDeviceFlags (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
remote_domain_update_device_flags_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virDomainPtr dom;
|
||||
|
||||
dom = get_nonnull_domain (conn, args->dom);
|
||||
if (dom == NULL) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virDomainUpdateDeviceFlags (dom, args->xml, args->flags) == -1) {
|
||||
virDomainFree(dom);
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
virDomainFree(dom);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
|
@ -144,3 +144,4 @@
|
||||
remote_domain_migrate_set_max_downtime_args val_remote_domain_migrate_set_max_downtime_args;
|
||||
remote_domain_events_register_any_args val_remote_domain_events_register_any_args;
|
||||
remote_domain_events_deregister_any_args val_remote_domain_events_deregister_any_args;
|
||||
remote_domain_update_device_flags_args val_remote_domain_update_device_flags_args;
|
||||
|
@ -506,6 +506,14 @@ static int remoteDispatchDomainUndefine(
|
||||
remote_error *err,
|
||||
remote_domain_undefine_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchDomainUpdateDeviceFlags(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
remote_domain_update_device_flags_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchDomainXmlFromNative(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
|
@ -867,8 +867,13 @@
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* Async event DomainEventGraphics => 171 */
|
||||
{ /* Async event DomainEventGraphics => 173 */
|
||||
.fn = NULL,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* DomainUpdateDeviceFlags => 174 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainUpdateDeviceFlags,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_update_device_flags_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
|
@ -3156,6 +3156,32 @@ done:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDomainUpdateDeviceFlags (virDomainPtr domain, const char *xml,
|
||||
unsigned int flags)
|
||||
{
|
||||
int rv = -1;
|
||||
remote_domain_update_device_flags_args args;
|
||||
struct private_data *priv = domain->conn->privateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
make_nonnull_domain (&args.dom, domain);
|
||||
args.xml = (char *) xml;
|
||||
args.flags = flags;
|
||||
|
||||
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS,
|
||||
(xdrproc_t) xdr_remote_domain_update_device_flags_args, (char *) &args,
|
||||
(xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
goto done;
|
||||
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDomainGetAutostart (virDomainPtr domain, int *autostart)
|
||||
{
|
||||
@ -9460,7 +9486,7 @@ static virDriver remote_driver = {
|
||||
remoteDomainAttachDeviceFlags, /* domainAttachDeviceFlags */
|
||||
remoteDomainDetachDevice, /* domainDetachDevice */
|
||||
remoteDomainDetachDeviceFlags, /* domainDetachDeviceFlags */
|
||||
NULL, /* domainUpdateDeviceFlags */
|
||||
remoteDomainUpdateDeviceFlags, /* domainUpdateDeviceFlags */
|
||||
remoteDomainGetAutostart, /* domainGetAutostart */
|
||||
remoteDomainSetAutostart, /* domainSetAutostart */
|
||||
remoteDomainGetSchedulerType, /* domainGetSchedulerType */
|
||||
|
@ -1318,6 +1318,19 @@ xdr_remote_domain_detach_device_flags_args (XDR *xdrs, remote_domain_detach_devi
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain_update_device_flags_args (XDR *xdrs, remote_domain_update_device_flags_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
|
||||
return FALSE;
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->xml))
|
||||
return FALSE;
|
||||
if (!xdr_u_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain_get_autostart_args (XDR *xdrs, remote_domain_get_autostart_args *objp)
|
||||
{
|
||||
|
@ -739,6 +739,13 @@ struct remote_domain_detach_device_flags_args {
|
||||
};
|
||||
typedef struct remote_domain_detach_device_flags_args remote_domain_detach_device_flags_args;
|
||||
|
||||
struct remote_domain_update_device_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
remote_nonnull_string xml;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct remote_domain_update_device_flags_args remote_domain_update_device_flags_args;
|
||||
|
||||
struct remote_domain_get_autostart_args {
|
||||
remote_nonnull_domain dom;
|
||||
};
|
||||
@ -1956,6 +1963,7 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_EVENT_WATCHDOG = 171,
|
||||
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR = 172,
|
||||
REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173,
|
||||
REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174,
|
||||
};
|
||||
typedef enum remote_procedure remote_procedure;
|
||||
|
||||
@ -2097,6 +2105,7 @@ extern bool_t xdr_remote_domain_attach_device_args (XDR *, remote_domain_attach
|
||||
extern bool_t xdr_remote_domain_attach_device_flags_args (XDR *, remote_domain_attach_device_flags_args*);
|
||||
extern bool_t xdr_remote_domain_detach_device_args (XDR *, remote_domain_detach_device_args*);
|
||||
extern bool_t xdr_remote_domain_detach_device_flags_args (XDR *, remote_domain_detach_device_flags_args*);
|
||||
extern bool_t xdr_remote_domain_update_device_flags_args (XDR *, remote_domain_update_device_flags_args*);
|
||||
extern bool_t xdr_remote_domain_get_autostart_args (XDR *, remote_domain_get_autostart_args*);
|
||||
extern bool_t xdr_remote_domain_get_autostart_ret (XDR *, remote_domain_get_autostart_ret*);
|
||||
extern bool_t xdr_remote_domain_set_autostart_args (XDR *, remote_domain_set_autostart_args*);
|
||||
@ -2391,6 +2400,7 @@ extern bool_t xdr_remote_domain_attach_device_args ();
|
||||
extern bool_t xdr_remote_domain_attach_device_flags_args ();
|
||||
extern bool_t xdr_remote_domain_detach_device_args ();
|
||||
extern bool_t xdr_remote_domain_detach_device_flags_args ();
|
||||
extern bool_t xdr_remote_domain_update_device_flags_args ();
|
||||
extern bool_t xdr_remote_domain_get_autostart_args ();
|
||||
extern bool_t xdr_remote_domain_get_autostart_ret ();
|
||||
extern bool_t xdr_remote_domain_set_autostart_args ();
|
||||
|
@ -730,6 +730,12 @@ struct remote_domain_detach_device_flags_args {
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct remote_domain_update_device_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
remote_nonnull_string xml;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct remote_domain_get_autostart_args {
|
||||
remote_nonnull_domain dom;
|
||||
};
|
||||
@ -1775,7 +1781,8 @@ enum remote_procedure {
|
||||
|
||||
REMOTE_PROC_DOMAIN_EVENT_WATCHDOG = 171,
|
||||
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR = 172,
|
||||
REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173
|
||||
REMOTE_PROC_DOMAIN_EVENT_GRAPHICS = 173,
|
||||
REMOTE_PROC_DOMAIN_UPDATE_DEVICE_FLAGS = 174
|
||||
|
||||
/*
|
||||
* Notice how the entries are grouped in sets of 10 ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user