提交 719cac1c 编写于 作者: E Eduardo Habkost 提交者: Paolo Bonzini

vl: Avoid unnecessary 'if' nesting

Just a coding style change, to make other changes easier to review.
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: NAndrew Jones <drjones@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 4d91558d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册