[libvirt] [PATCH 1/2] lxc: forbid negative blkio values

Martin Kletzander mkletzan at redhat.com
Tue Aug 19 13:18:49 UTC 2014


On Tue, Aug 19, 2014 at 03:10:54PM +0200, Martin Kletzander wrote:
>Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131306
>
>Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>---
> src/lxc/lxc_driver.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
>index 4741632..165e642 100644
>--- a/src/lxc/lxc_driver.c
>+++ b/src/lxc/lxc_driver.c
>@@ -2185,16 +2185,16 @@ lxcDomainParseBlkioDeviceStr(char *blkioDeviceStr, const char *type,
>             if (virStrToLong_ui(temp, &p, 10, &result[i].weight) < 0)

This "weight" parsing should use _uip too, of course, consider it
changed as well (my local branch is fixed).

>                 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;
>--
>2.0.4
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140819/ed336617/attachment-0001.sig>


More information about the libvir-list mailing list