提交 31eade07 编写于 作者: D Daniel Veillard

* src/virsh.c: patch from Masayuki Sunou to fix parameter

  validation of virsh schedinfo parameters.
Daniel
上级 028275d6
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>
* src/xml.c: patch from Beth Kon to fix a problem when the
......
......@@ -1149,11 +1149,25 @@ cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
return FALSE;
/* Currently supports Xen Credit only */
weight = vshCommandOptInt(cmd, "weight", &weightfound);
if (weightfound) nr_inputparams++;
cap = vshCommandOptInt(cmd, "cap", &capfound);
if (capfound) nr_inputparams++;
if(vshCommandOptBool(cmd, "weight")) {
weight = vshCommandOptInt(cmd, "weight", &weightfound);
if (!weightfound) {
vshError(ctl, FALSE, _("Invalid value of weight"));
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);
if (params == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册