From: Martin Kletzander Date: Tue, 19 Aug 2014 12:54:24 +0000 (+0200) Subject: lxc: forbid negative blkio values X-Git-Tag: v1.2.8-rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e80adb0ed51c8533d7fbcaf8438a9de1e4fa51af;p=thirdparty%2Flibvirt.git lxc: forbid negative blkio values Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131306 Signed-off-by: Martin Kletzander --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 5f08a67791..d65dda0d4b 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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;