* [Qemu-devel] smp-parse: smp-opt-cores for simple -smp X
@ 2011-07-08 19:59 Adam Lackorzynski
0 siblings, 0 replies; only message in thread
From: Adam Lackorzynski @ 2011-07-08 19:59 UTC (permalink / raw)
To: qemu-devel
Hi,
When just using a simple '-smp X', both the smp_cores and smp_threads
variables are set to 1, which on x86 leads to CPUid-0x80000008-ecx
returning 1 for the CPU count despite more CPUs are there. Docs say
'Missing values will be computed.', so my try on this is the following.
Comments?
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
---
vl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index fcd7395..1459bde 100644
--- a/vl.c
+++ b/vl.c
@@ -886,6 +886,8 @@ static void smp_parse(const char *optarg)
max_cpus = strtoull(option, NULL, 10);
/* compute missing values, prefer sockets over cores over threads */
+ if (sockets + cores + threads == 0)
+ cores = smp;
if (smp == 0 || sockets == 0) {
sockets = sockets > 0 ? sockets : 1;
cores = cores > 0 ? cores : 1;
--
1.7.5.3
Adam
--
Adam adam@os.inf.tu-dresden.de
Lackorzynski http://os.inf.tu-dresden.de/~adam/
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-08 19:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 19:59 [Qemu-devel] smp-parse: smp-opt-cores for simple -smp X Adam Lackorzynski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).