diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2014-12-19 00:59:45 -0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-01-09 23:41:11 +0100 |
commit | 719cac1ce20c8806303793b2501aedb9edf1bca3 (patch) | |
tree | 454f00dd9242c4cf965e99a7b1e8a8bc1c2cd86a | |
parent | 4d91558d60c229f34819329728cf46ff71e13935 (diff) |
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>
-rw-r--r-- | vl.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1170,13 +1170,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); |