mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
* src/xen_internal.c: and nother one again from Saori Fukuta
Daniel
This commit is contained in:
parent
90ae19cccf
commit
46da4f268f
@ -1,3 +1,7 @@
|
||||
Fri Jul 20 12:53:35 CEST 2007 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/xen_internal.c: and nother one again from Saori Fukuta
|
||||
|
||||
Fri Jul 20 11:02:28 CEST 2007 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/xen_internal.c: some error handling improvements from Saori Fukuta
|
||||
|
@ -1182,6 +1182,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
|
||||
int i;
|
||||
unsigned int val;
|
||||
xenUnifiedPrivatePtr priv;
|
||||
char buf[256];
|
||||
|
||||
if ((domain == NULL) || (domain->conn == NULL)) {
|
||||
virXenErrorFunc (VIR_ERR_INTERNAL_ERROR, __FUNCTION__,
|
||||
@ -1246,13 +1247,13 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
|
||||
op_dom.u.getschedinfo.u.credit.cap = (uint16_t)~0U;
|
||||
|
||||
for (i = 0; i < nparams; i++) {
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
if (STREQ (params[i].field, str_weight) &&
|
||||
params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) {
|
||||
val = params[i].value.ui;
|
||||
if ((val < 1) || (val > USHRT_MAX)) {
|
||||
virXenErrorFunc (VIR_ERR_INVALID_ARG, __FUNCTION__,
|
||||
_("Credit scheduler weight parameter (%d) is out of range (1-65535)"),
|
||||
val);
|
||||
snprintf(buf, sizeof(buf), _("Credit scheduler weight parameter (%d) is out of range (1-65535)"), val);
|
||||
virXenErrorFunc (VIR_ERR_INVALID_ARG, __FUNCTION__, buf, val);
|
||||
return(-1);
|
||||
}
|
||||
op_dom.u.getschedinfo.u.credit.weight = val;
|
||||
@ -1261,9 +1262,8 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
|
||||
params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) {
|
||||
val = params[i].value.ui;
|
||||
if (val > USHRT_MAX) {
|
||||
virXenErrorFunc (VIR_ERR_INVALID_ARG, __FUNCTION__,
|
||||
_("Credit scheduler cap parameter (%d) is out of range (0-65535)"),
|
||||
val);
|
||||
snprintf(buf, sizeof(buf), _("Credit scheduler cap parameter (%d) is out of range (0-65535)"), val);
|
||||
virXenErrorFunc (VIR_ERR_INVALID_ARG, __FUNCTION__, buf, val);
|
||||
return(-1);
|
||||
}
|
||||
op_dom.u.getschedinfo.u.credit.cap = val;
|
||||
|
Loading…
Reference in New Issue
Block a user