mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
xen: Fix scheduler setting problems
Doing `virsh schedinfo rhel5u3 --cap 65535' the hypervisor does the call, but does not change the value nor raise an error. Best is just to consider it's not in the allowed values. The problem is that the error won't be output since the xend driver will then be called and raise an error error: this function is not supported by the hypervisor: unsupported in xendConfigVersion < 4 which will override the useful information from xenUnifiedDomainSetSchedulerParameters(). So best is to also invert the order in which the xen sub-drivers are called. * src/xen/xen_hypervisor.c: mark 65535 cap value as out of bound * src/xen/xen_hypervisor.c: reverse the order of the calls to the xen sub drivers to get the error message if needed
This commit is contained in:
parent
47c74e8264
commit
1dcd5ab989
@ -1588,7 +1588,8 @@ xenUnifiedDomainSetSchedulerParameters (virDomainPtr dom,
|
||||
GET_PRIVATE(dom->conn);
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) {
|
||||
/* do the hypervisor call last to get better error */
|
||||
for (i = XEN_UNIFIED_NR_DRIVERS - 1; i >= 0; i--) {
|
||||
if (priv->opened[i] && drivers[i]->domainSetSchedulerParameters) {
|
||||
ret = drivers[i]->domainSetSchedulerParameters(dom, params, nparams);
|
||||
if (ret == 0)
|
||||
|
@ -1394,8 +1394,8 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
|
||||
} else if (STREQ (params[i].field, str_cap) &&
|
||||
params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) {
|
||||
val = params[i].value.ui;
|
||||
if (val > USHRT_MAX) {
|
||||
snprintf(buf, sizeof(buf), _("Credit scheduler cap parameter (%d) is out of range (0-65535)"), val);
|
||||
if (val >= USHRT_MAX) {
|
||||
snprintf(buf, sizeof(buf), _("Credit scheduler cap parameter (%d) is out of range (0-65534)"), val);
|
||||
virXenErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, buf, val);
|
||||
return(-1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user