Message ID | 1418957987-28511-2-git-send-email-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/vl.c b/vl.c index 113e98e..3b7157d 100644 --- a/vl.c +++ b/vl.c @@ -1300,13 +1300,11 @@ static void smp_parse(QemuOpts *opts) if (cpus == 0) { cpus = cores * threads * sockets; } + } else if (cores == 0) { + threads = threads > 0 ? threads : 1; + cores = cpus / (sockets * threads); } else { - if (cores == 0) { - threads = threads > 0 ? threads : 1; - cores = cpus / (sockets * threads); - } else { - threads = cpus / (cores * sockets); - } + threads = cpus / (cores * sockets); } max_cpus = qemu_opt_get_number(opts, "maxcpus", 0);