[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10] vl.c: Support multiple CPU ranges on -numa op
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH 08/10] vl.c: Support multiple CPU ranges on -numa option |
Date: |
Fri, 11 Jan 2013 16:15:06 -0200 |
This allows "," or ";" to be used a separator between each CPU range.
Note that commas inside key=value command-line options have to be
escaped using ",,", so the command-line will look like:
-numa node,cpus=A,,B,,C,,D
or:
-numa node,cpus=A;B;C;D
Note that the following format, currently used by libvirt:
-numa nodes,cpus=A,B,C,D
will _not_ work yet, as "," is the option separator for the command-line
option parser, and it will require changing the -numa option parsing
code to handle "cpus" as a special case.
Signed-off-by: Eduardo Habkost <address@hidden>
---
vl.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 31175f6..d7337c1 100644
--- a/vl.c
+++ b/vl.c
@@ -1052,7 +1052,7 @@ char *get_boot_devices_list(uint32_t *size)
return list;
}
-static void numa_node_parse_cpus(int nodenr, const char *cpus)
+static void numa_node_parse_cpu_range(int nodenr, const char *cpus)
{
char *endptr;
unsigned long long value, endvalue;
@@ -1095,6 +1095,18 @@ error:
exit(1);
}
+static void numa_node_parse_cpus(int nodenr, const char *option)
+{
+ char **parts;
+ int i;
+
+ parts = g_strsplit_set(option, ",;", 0);
+ for (i = 0; parts[i]; i++) {
+ numa_node_parse_cpu_range(nodenr, parts[i]);
+ }
+ g_strfreev(parts);
+}
+
static void numa_node_add(const char *optarg)
{
char option[128];
--
1.7.11.7
- [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 <=
- [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