vl: Avoid unnecessary 'if' nesting

Just a coding style change, to make other changes easier to review.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Eduardo Habkost 2014-12-19 00:59:45 -02:00 committed by Paolo Bonzini
parent 4d91558d60
commit 719cac1ce2
1 changed files with 4 additions and 6 deletions

4
vl.c
View File

@ -1170,14 +1170,12 @@ static void smp_parse(QemuOpts *opts)
if (cpus == 0) { if (cpus == 0) {
cpus = cores * threads * sockets; cpus = cores * threads * sockets;
} }
} else { } else if (cores == 0) {
if (cores == 0) {
threads = threads > 0 ? threads : 1; threads = threads > 0 ? threads : 1;
cores = cpus / (sockets * threads); cores = cpus / (sockets * threads);
} else { } else {
threads = cpus / (cores * sockets); threads = cpus / (cores * sockets);
} }
}
max_cpus = qemu_opt_get_number(opts, "maxcpus", 0); max_cpus = qemu_opt_get_number(opts, "maxcpus", 0);