[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [libvirt] [PATCH 03/10] vl.c: Isolate code specific to
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [libvirt] [PATCH 03/10] vl.c: Isolate code specific to "-numa node" option type |
Date: |
Fri, 11 Jan 2013 19:19:48 -0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Jan 11, 2013 at 02:06:05PM -0700, Eric Blake wrote:
> On 01/11/2013 11:15 AM, Eduardo Habkost wrote:
> > Extract the code that's specific for the "node" -numa option type (the
> > only one, today) to a separate function.
> >
> > The extracted code will eventually become a function specific for a
> > "numa-node" config section, independent from the numa_add() code.
>
> > + if (get_param_value(option, 128, "nodeid", optarg) == 0) {
> > + nodenr = nb_numa_nodes;
> > + } else {
> > + nodenr = strtoull(option, NULL, 10);
> > }
>
> strtoull() needs additional error checking after the fact, to make sure
> I didn't pass an empty string, trailing garbage, or so many digits I
> triggered overflow.
>
>
> > + if (get_param_value(option, 128, "cpus", optarg) != 0) {
> > + value = strtoull(option, &endptr, 10);
> > + if (*endptr == '-') {
> > + endvalue = strtoull(endptr+1, &endptr, 10);
> > } else {
> > - nodenr = strtoull(option, NULL, 10);
> > + endvalue = value;
> > }
>
> More uses of strtoull() that aren't guarding against all possible errors.
All this code gets replaced in patch 09/10. The only remaining
strtoull() call gets error-checking at patch 06/10.
--
Eduardo
- [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
- [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