numa: make -numa parser dynamically allocate CPUs masks

so it won't impose an additional limits on max_cpus limits
supported by different targets.

It removes global MAX_CPUMASK_BITS constant and need to
bump it up whenever max_cpus is being increased for
a target above MAX_CPUMASK_BITS value.

Use runtime max_cpus value instead to allocate sufficiently
sized node_cpu bitmasks in numa parser.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1479466974-249781-1-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
[ehabkost: Added asserts to ensure cpu_index < max_cpus]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Igor Mammedov 2016-11-18 12:02:54 +01:00 committed by Eduardo Habkost
parent 410e98146f
commit cdda2018e3
4 changed files with 15 additions and 20 deletions

5
vl.c
View file

@ -1277,11 +1277,6 @@ static void smp_parse(QemuOpts *opts)
max_cpus = qemu_opt_get_number(opts, "maxcpus", cpus);
if (max_cpus > MAX_CPUMASK_BITS) {
error_report("unsupported number of maxcpus");
exit(1);
}
if (max_cpus < cpus) {
error_report("maxcpus must be equal to or greater than smp");
exit(1);