[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [libvirt] [PATCH 06/10] vl.c: handle invalid NUMA CPU r
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [libvirt] [PATCH 06/10] vl.c: handle invalid NUMA CPU ranges properly |
Date: |
Fri, 11 Jan 2013 14:32:48 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 01/11/2013 11:15 AM, Eduardo Habkost wrote:
> Add checks for the following cases:
>
> * Empty string: will be ignored and won't set any CPU bitmap,
> parser won't abort.
> * Missing end value after "-": parser will abort.
> * Extra characters after a valid CPU range: parser will abort.
> * "N-M" string where M < N: parser will abort.
> value = strtoull(cpus, &endptr, 10);
> if (*endptr == '-') {
> - endvalue = strtoull(endptr+1, &endptr, 10);
> + endptr++;
> + if (!*endptr) {
> + goto error;
> + }
> + endvalue = strtoull(endptr, &endptr, 10);
> } else {
> endvalue = value;
> }
Still missing a check for '-numa=-2' with no number on the left of '-',
as well as missing a check for overflow for -numa=999999999999999999999999
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/10] -numa option parsing fixes & improvements, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 08/10] vl.c: Support multiple CPU ranges on -numa option, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 01/10] vl.c: Fix off-by-one bug when handling "-numa node" argument, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 06/10] vl.c: handle invalid NUMA CPU ranges properly, Eduardo Habkost, 2013/01/11
- Re: [Qemu-devel] [libvirt] [PATCH 06/10] vl.c: handle invalid NUMA CPU ranges properly,
Eric Blake <=
- [Qemu-devel] [RFC 09/10] vl.c: Introduce QemuOpts-friendly "-numa-node" config option, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 03/10] vl.c: Isolate code specific to "-numa node" option type, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 04/10] vl.c: Check for NUMA node limit inside numa_node_add(), Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 05/10] vl.c: Extract -numa "cpus" parsing to separate function, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [RFC 10/10] vl.c: Handle legacy "-numa node, cpus=A, B, C, D" format, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 02/10] vl.c: Abort on unknown -numa option type, Eduardo Habkost, 2013/01/11
- [Qemu-devel] [PATCH 07/10] vl.c: numa_add_node(): Validate nodeid before using it, Eduardo Habkost, 2013/01/11