提交 e80adb0e 编写于 作者: M Martin Kletzander

lxc: forbid negative blkio values

Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131306Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 e2f14211
......@@ -2182,19 +2182,19 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type,
temp = p + 1;
if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT)) {
if (virStrToLong_ui(temp, &p, 10, &result[i].weight) < 0)
if (virStrToLong_uip(temp, &p, 10, &result[i].weight) < 0)
goto error;
} else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS)) {
if (virStrToLong_ui(temp, &p, 10, &result[i].riops) < 0)
if (virStrToLong_uip(temp, &p, 10, &result[i].riops) < 0)
goto error;
} else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS)) {
if (virStrToLong_ui(temp, &p, 10, &result[i].wiops) < 0)
if (virStrToLong_uip(temp, &p, 10, &result[i].wiops) < 0)
goto error;
} else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS)) {
if (virStrToLong_ull(temp, &p, 10, &result[i].rbps) < 0)
if (virStrToLong_ullp(temp, &p, 10, &result[i].rbps) < 0)
goto error;
} else if (STREQ(type, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS)){
if (virStrToLong_ull(temp, &p, 10, &result[i].wbps) < 0)
if (virStrToLong_ullp(temp, &p, 10, &result[i].wbps) < 0)
goto error;
} else {
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册