mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
esx: allow getting < max typed parameters
Allow the user to call with nparams too small, per API documentation. * src/esx/esx_driver.c (esxDomainGetMemoryParameters): Drop redundant check. (esxDomainGetSchedulerParametersFlags): Allow fewer than max.
This commit is contained in:
parent
319992d4b6
commit
6b98a4b2e6
@ -3635,12 +3635,6 @@ esxDomainGetSchedulerParametersFlags(virDomainPtr domain,
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (*nparams < 3) {
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("Parameter array must have space for 3 items"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||
return -1;
|
||||
}
|
||||
@ -3656,7 +3650,7 @@ esxDomainGetSchedulerParametersFlags(virDomainPtr domain,
|
||||
}
|
||||
|
||||
for (dynamicProperty = virtualMachine->propSet;
|
||||
dynamicProperty != NULL && mask != 7 && i < 3;
|
||||
dynamicProperty != NULL && mask != 7 && i < 3 && i < *nparams;
|
||||
dynamicProperty = dynamicProperty->_next) {
|
||||
if (STREQ(dynamicProperty->name, "config.cpuAllocation.reservation") &&
|
||||
! (mask & (1 << 0))) {
|
||||
@ -4886,12 +4880,6 @@ esxDomainGetMemoryParameters(virDomainPtr domain, virTypedParameterPtr params,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (*nparams < 1) {
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("Parameter array must have space for 1 item"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user