提交 118dd7d0 编写于 作者: D Daniel P. Berrange

Wire up virDomainMigrateSetSpeed for the remote RPC driver

* src/remote/remote_protocol.x: Define wire protocol
* daemon/remote.c, src/remote/remote_driver.c: Add new
  functions for virDomainMigrateSetSpeed API
* src/remote/remote_protocol.c, src/remote/remote_protocol.h,
  daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
  daemon/remote_dispatch_table.h: Re-generate files
上级 cb4aba9b
......@@ -6562,6 +6562,34 @@ remoteDispatchDomainMigrateSetMaxDowntime(struct qemud_server *server ATTRIBUTE_
return 0;
}
static int
remoteDispatchDomainMigrateSetMaxSpeed(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_migrate_set_max_speed_args *args,
void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom;
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
return -1;
}
if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) == -1) {
virDomainFree(dom);
remoteDispatchConnError(rerr, conn);
return -1;
}
virDomainFree(dom);
return 0;
}
static int
remoteDispatchDomainSnapshotCreateXml (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
......
......@@ -175,3 +175,4 @@
remote_domain_set_memory_flags_args val_remote_domain_set_memory_flags_args;
remote_domain_set_blkio_parameters_args val_remote_domain_set_blkio_parameters_args;
remote_domain_get_blkio_parameters_args val_remote_domain_get_blkio_parameters_args;
remote_domain_migrate_set_max_speed_args val_remote_domain_migrate_set_max_speed_args;
......@@ -482,6 +482,14 @@ static int remoteDispatchDomainMigrateSetMaxDowntime(
remote_error *err,
remote_domain_migrate_set_max_downtime_args *args,
void *ret);
static int remoteDispatchDomainMigrateSetMaxSpeed(
struct qemud_server *server,
struct qemud_client *client,
virConnectPtr conn,
remote_message_header *hdr,
remote_error *err,
remote_domain_migrate_set_max_speed_args *args,
void *ret);
static int remoteDispatchDomainOpenConsole(
struct qemud_server *server,
struct qemud_client *client,
......
......@@ -1037,3 +1037,8 @@
.args_filter = (xdrproc_t) xdr_remote_domain_get_blkio_parameters_args,
.ret_filter = (xdrproc_t) xdr_remote_domain_get_blkio_parameters_ret,
},
{ /* DomainMigrateSetMaxSpeed => 207 */
.fn = (dispatch_fn) remoteDispatchDomainMigrateSetMaxSpeed,
.args_filter = (xdrproc_t) xdr_remote_domain_migrate_set_max_speed_args,
.ret_filter = (xdrproc_t) xdr_void,
},
......@@ -9183,6 +9183,35 @@ done:
return rv;
}
static int
remoteDomainMigrateSetMaxSpeed(virDomainPtr domain,
unsigned long bandwidth,
unsigned int flags)
{
struct private_data *priv = domain->conn->privateData;
remote_domain_migrate_set_max_speed_args args;
int rv = -1;
remoteDriverLock(priv);
make_nonnull_domain(&args.dom, domain);
args.bandwidth = bandwidth;
args.flags = flags;
if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED,
(xdrproc_t) xdr_remote_domain_migrate_set_max_speed_args,
(char *) &args,
(xdrproc_t) xdr_void,
(char *) NULL) == -1)
goto done;
rv = 0;
done:
remoteDriverUnlock(priv);
return rv;
}
static virDomainSnapshotPtr
remoteDomainSnapshotCreateXML(virDomainPtr domain,
const char *xmlDesc,
......@@ -11156,7 +11185,7 @@ static virDriver remote_driver = {
remoteDomainGetJobInfo, /* domainGetJobInfo */
remoteDomainAbortJob, /* domainFinishJob */
remoteDomainMigrateSetMaxDowntime, /* domainMigrateSetMaxDowntime */
NULL, /* domainMigrateSetMaxSpeed */
remoteDomainMigrateSetMaxSpeed, /* domainMigrateSetMaxSpeed */
remoteDomainEventRegisterAny, /* domainEventRegisterAny */
remoteDomainEventDeregisterAny, /* domainEventDeregisterAny */
remoteDomainManagedSave, /* domainManagedSave */
......
......@@ -3507,6 +3507,19 @@ xdr_remote_domain_migrate_set_max_downtime_args (XDR *xdrs, remote_domain_migrat
return TRUE;
}
bool_t
xdr_remote_domain_migrate_set_max_speed_args (XDR *xdrs, remote_domain_migrate_set_max_speed_args *objp)
{
if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
return FALSE;
if (!xdr_uint64_t (xdrs, &objp->bandwidth))
return FALSE;
if (!xdr_u_int (xdrs, &objp->flags))
return FALSE;
return TRUE;
}
bool_t
xdr_remote_domain_events_register_any_args (XDR *xdrs, remote_domain_events_register_any_args *objp)
{
......
......@@ -1982,6 +1982,13 @@ struct remote_domain_migrate_set_max_downtime_args {
};
typedef struct remote_domain_migrate_set_max_downtime_args remote_domain_migrate_set_max_downtime_args;
struct remote_domain_migrate_set_max_speed_args {
remote_nonnull_domain dom;
uint64_t bandwidth;
u_int flags;
};
typedef struct remote_domain_migrate_set_max_speed_args remote_domain_migrate_set_max_speed_args;
struct remote_domain_events_register_any_args {
int eventID;
};
......@@ -2387,6 +2394,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204,
REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205,
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206,
REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207,
};
typedef enum remote_procedure remote_procedure;
......@@ -2736,6 +2744,7 @@ extern bool_t xdr_remote_domain_get_job_info_args (XDR *, remote_domain_get_job
extern bool_t xdr_remote_domain_get_job_info_ret (XDR *, remote_domain_get_job_info_ret*);
extern bool_t xdr_remote_domain_abort_job_args (XDR *, remote_domain_abort_job_args*);
extern bool_t xdr_remote_domain_migrate_set_max_downtime_args (XDR *, remote_domain_migrate_set_max_downtime_args*);
extern bool_t xdr_remote_domain_migrate_set_max_speed_args (XDR *, remote_domain_migrate_set_max_speed_args*);
extern bool_t xdr_remote_domain_events_register_any_args (XDR *, remote_domain_events_register_any_args*);
extern bool_t xdr_remote_domain_events_deregister_any_args (XDR *, remote_domain_events_deregister_any_args*);
extern bool_t xdr_remote_domain_event_reboot_msg (XDR *, remote_domain_event_reboot_msg*);
......@@ -3090,6 +3099,7 @@ extern bool_t xdr_remote_domain_get_job_info_args ();
extern bool_t xdr_remote_domain_get_job_info_ret ();
extern bool_t xdr_remote_domain_abort_job_args ();
extern bool_t xdr_remote_domain_migrate_set_max_downtime_args ();
extern bool_t xdr_remote_domain_migrate_set_max_speed_args ();
extern bool_t xdr_remote_domain_events_register_any_args ();
extern bool_t xdr_remote_domain_events_deregister_any_args ();
extern bool_t xdr_remote_domain_event_reboot_msg ();
......
......@@ -1760,6 +1760,12 @@ struct remote_domain_migrate_set_max_downtime_args {
unsigned flags;
};
struct remote_domain_migrate_set_max_speed_args {
remote_nonnull_domain dom;
unsigned hyper bandwidth;
unsigned flags;
};
struct remote_domain_events_register_any_args {
int eventID;
};
......@@ -2152,7 +2158,8 @@ enum remote_procedure {
REMOTE_PROC_GET_SYSINFO = 203,
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204,
REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205,
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206,
REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207
/*
* Notice how the entries are grouped in sets of 10 ?
......
......@@ -1276,6 +1276,11 @@ struct remote_domain_migrate_set_max_downtime_args {
uint64_t downtime;
u_int flags;
};
struct remote_domain_migrate_set_max_speed_args {
remote_nonnull_domain dom;
uint64_t bandwidth;
u_int flags;
};
struct remote_domain_events_register_any_args {
int eventID;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册