mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
* src/virsh.c: patch from Masayuki Sunou to fix parameter
validation of virsh schedinfo parameters. Daniel
This commit is contained in:
parent
028275d6da
commit
31eade077e
@ -1,3 +1,8 @@
|
|||||||
|
Tue Nov 6 10:40:13 CET 2007 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/virsh.c: patch from Masayuki Sunou to fix parameter
|
||||||
|
validation of virsh schedinfo parameters.
|
||||||
|
|
||||||
Mon Nov 5 11:11:45 CET 2007 Daniel Veillard <veillard@redhat.com>
|
Mon Nov 5 11:11:45 CET 2007 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/xml.c: patch from Beth Kon to fix a problem when the
|
* src/xml.c: patch from Beth Kon to fix a problem when the
|
||||||
|
24
src/virsh.c
24
src/virsh.c
@ -1149,11 +1149,25 @@ cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Currently supports Xen Credit only */
|
/* Currently supports Xen Credit only */
|
||||||
weight = vshCommandOptInt(cmd, "weight", &weightfound);
|
if(vshCommandOptBool(cmd, "weight")) {
|
||||||
if (weightfound) nr_inputparams++;
|
weight = vshCommandOptInt(cmd, "weight", &weightfound);
|
||||||
|
if (!weightfound) {
|
||||||
cap = vshCommandOptInt(cmd, "cap", &capfound);
|
vshError(ctl, FALSE, _("Invalid value of weight"));
|
||||||
if (capfound) nr_inputparams++;
|
goto cleanup;
|
||||||
|
} else {
|
||||||
|
nr_inputparams++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(vshCommandOptBool(cmd, "cap")) {
|
||||||
|
cap = vshCommandOptInt(cmd, "cap", &capfound);
|
||||||
|
if (!capfound) {
|
||||||
|
vshError(ctl, FALSE, _("Invalid value of cap"));
|
||||||
|
goto cleanup;
|
||||||
|
} else {
|
||||||
|
nr_inputparams++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
params = vshMalloc(ctl, sizeof (virSchedParameter) * nr_inputparams);
|
params = vshMalloc(ctl, sizeof (virSchedParameter) * nr_inputparams);
|
||||||
if (params == NULL) {
|
if (params == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user