libxl: fix param assignment in domainGetSchedulerParameters

Due to a copy and paste error, the scheduler 'cap' parameter
was over-writing the 'weight' parameter when preparing the
return parameters in libxlDomainGetSchedulerParametersFlags.
As a result, the scheduler weight was never shown when getting
schedinfo and setting the weight failed as well

virsh  schedinfo testvm
Scheduler      : credit
cap            : 0

virsh  schedinfo testvm --cap 50 --weight 500
Scheduler      : credit
error: invalid scheduler option: weight

The obvious fix is to assign the 'caps' parameter to the correct
item in the parameter list.

Reported-by: Volo M. <vm@vovs.net>
This commit is contained in:
Jim Fehlig 2016-09-27 22:18:50 -06:00
parent bff2f781ab
commit 4c600de755

View File

@ -4571,7 +4571,7 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
goto cleanup; goto cleanup;
if (*nparams > 1) { if (*nparams > 1) {
if (virTypedParameterAssign(&params[0], VIR_DOMAIN_SCHEDULER_CAP, if (virTypedParameterAssign(&params[1], VIR_DOMAIN_SCHEDULER_CAP,
VIR_TYPED_PARAM_UINT, sc_info.cap) < 0) VIR_TYPED_PARAM_UINT, sc_info.cap) < 0)
goto cleanup; goto cleanup;
} }