virCgroupPtr cgroup)
{
if (def->cputune.sharesSpecified) {
- unsigned long long val;
- if (virCgroupSetupCpuShares(cgroup, def->cputune.shares, &val) < 0)
+ if (virCgroupSetCpuShares(cgroup, def->cputune.shares) < 0)
return -1;
- def->cputune.shares = val;
}
return virCgroupSetupCpuPeriodQuota(cgroup, def->cputune.period,
if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_CPU_SHARES)) {
if (def) {
- unsigned long long val;
- if (virCgroupSetupCpuShares(priv->cgroup, params[i].value.ul,
- &val) < 0)
+ if (virCgroupSetCpuShares(priv->cgroup, params[i].value.ul) < 0)
goto endjob;
- def->cputune.shares = val;
+ def->cputune.shares = params[i].value.ul;
def->cputune.sharesSpecified = true;
}
qemuSetupCpuCgroup(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- virObjectEventPtr event = NULL;
- virTypedParameterPtr eventParams = NULL;
- int eventNparams = 0;
- int eventMaxparams = 0;
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) {
if (vm->def->cputune.sharesSpecified) {
}
if (vm->def->cputune.sharesSpecified) {
- unsigned long long val;
- if (virCgroupSetupCpuShares(priv->cgroup, vm->def->cputune.shares,
- &val) < 0)
+ if (virCgroupSetCpuShares(priv->cgroup, vm->def->cputune.shares) < 0)
return -1;
-
- if (vm->def->cputune.shares != val) {
- vm->def->cputune.shares = val;
- if (virTypedParamsAddULLong(&eventParams, &eventNparams,
- &eventMaxparams,
- VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES,
- val) < 0)
- return -1;
-
- event = virDomainEventTunableNewFromObj(vm, eventParams, eventNparams);
- }
-
- virObjectEventStateQueue(priv->driver->domainEventState, event);
}
return 0;
if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_CPU_SHARES)) {
if (def) {
- unsigned long long val;
- if (virCgroupSetupCpuShares(priv->cgroup, value_ul, &val) < 0)
+ if (virCgroupSetCpuShares(priv->cgroup, value_ul) < 0)
goto endjob;
- def->cputune.shares = val;
+ def->cputune.shares = value_ul;
def->cputune.sharesSpecified = true;
if (virTypedParamsAddULLong(&eventParams, &eventNparams,
&eventMaxNparams,
VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES,
- val) < 0)
+ value_ul) < 0)
goto endjob;
}