mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
vcpupin: implement the remote protocol to address the new API
This patch implements the remote protocol for the new API (virDomainPinVcpuFlags).
This commit is contained in:
parent
6690150ddd
commit
b01e993656
@ -1276,6 +1276,48 @@ cleanup:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainPinVcpuFlags(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_pin_vcpu_flags_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virDomainPtr dom = NULL;
|
||||
int rv = -1;
|
||||
|
||||
if (!conn) {
|
||||
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
||||
goto cleanup;
|
||||
|
||||
if (args->cpumap.cpumap_len > REMOTE_CPUMAP_MAX) {
|
||||
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("cpumap_len > REMOTE_CPUMAP_MAX"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainPinVcpuFlags(dom,
|
||||
args->vcpu,
|
||||
(unsigned char *) args->cpumap.cpumap_val,
|
||||
args->cpumap.cpumap_len,
|
||||
args->flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
rv = 0;
|
||||
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
remoteDispatchError(rerr);
|
||||
if (dom)
|
||||
virDomainFree(dom);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
|
||||
ATTRIBUTE_UNUSED,
|
||||
|
@ -977,6 +977,9 @@ elsif ($opt_k) {
|
||||
} elsif ($call->{ProcName} eq "DomainPinVcpu") {
|
||||
push(@args_list, "unsigned char *$arg_name");
|
||||
push(@args_list, "int ${arg_name}len");
|
||||
} elsif ($call->{ProcName} eq "DomainPinVcpuFlags") {
|
||||
push(@args_list, "unsigned char *$arg_name");
|
||||
push(@args_list, "int ${arg_name}len");
|
||||
} else {
|
||||
push(@args_list, "const char *$arg_name");
|
||||
push(@args_list, "int ${arg_name}len");
|
||||
|
@ -6259,6 +6259,7 @@ static virDriver remote_driver = {
|
||||
.domainSetVcpusFlags = remoteDomainSetVcpusFlags, /* 0.8.5 */
|
||||
.domainGetVcpusFlags = remoteDomainGetVcpusFlags, /* 0.8.5 */
|
||||
.domainPinVcpu = remoteDomainPinVcpu, /* 0.3.0 */
|
||||
.domainPinVcpuFlags = remoteDomainPinVcpuFlags, /* 0.9.3 */
|
||||
.domainGetVcpus = remoteDomainGetVcpus, /* 0.3.0 */
|
||||
.domainGetMaxVcpus = remoteDomainGetMaxVcpus, /* 0.3.0 */
|
||||
.domainGetSecurityLabel = remoteDomainGetSecurityLabel, /* 0.6.1 */
|
||||
|
@ -837,6 +837,13 @@ struct remote_domain_pin_vcpu_args {
|
||||
opaque cpumap<REMOTE_CPUMAP_MAX>;
|
||||
};
|
||||
|
||||
struct remote_domain_pin_vcpu_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
unsigned int vcpu;
|
||||
opaque cpumap<REMOTE_CPUMAP_MAX>;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct remote_domain_get_vcpus_args {
|
||||
remote_nonnull_domain dom;
|
||||
int maxinfo;
|
||||
@ -2297,7 +2304,8 @@ enum remote_procedure {
|
||||
REMOTE_PROC_INTERFACE_CHANGE_COMMIT = 221, /* autogen autogen */
|
||||
REMOTE_PROC_INTERFACE_CHANGE_ROLLBACK = 222, /* autogen autogen */
|
||||
REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS_FLAGS = 223, /* skipgen autogen */
|
||||
REMOTE_PROC_DOMAIN_EVENT_CONTROL_ERROR = 224 /* skipgen skipgen */
|
||||
REMOTE_PROC_DOMAIN_EVENT_CONTROL_ERROR = 224, /* skipgen skipgen */
|
||||
REMOTE_PROC_DOMAIN_PIN_VCPU_FLAGS = 225 /* skipgen autogen */
|
||||
|
||||
/*
|
||||
* Notice how the entries are grouped in sets of 10 ?
|
||||
|
@ -529,6 +529,15 @@ struct remote_domain_pin_vcpu_args {
|
||||
char * cpumap_val;
|
||||
} cpumap;
|
||||
};
|
||||
struct remote_domain_pin_vcpu_flags_args {
|
||||
remote_nonnull_domain dom;
|
||||
u_int vcpu;
|
||||
struct {
|
||||
u_int cpumap_len;
|
||||
char * cpumap_val;
|
||||
} cpumap;
|
||||
u_int flags;
|
||||
};
|
||||
struct remote_domain_get_vcpus_args {
|
||||
remote_nonnull_domain dom;
|
||||
int maxinfo;
|
||||
|
Loading…
x
Reference in New Issue
Block a user