aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorLike Xu <like.xu@linux.intel.com>2019-05-19 04:54:19 +0800
committerEduardo Habkost <ehabkost@redhat.com>2019-07-05 17:07:35 -0300
commitedeeec911702870adf8866311b5feb2bdaaee2ce (patch)
treef616d4490038f1b090d19c3b4742c2e6dc6abff7 /vl.c
parentd2c5f91ca944aaade642624397e1853801bbc744 (diff)
hw/boards: Add struct CpuTopology to MachineState
The cpu topology property CpuTopology is added to the MachineState and its members are initialized with the leagcy global smp variables. From this commit, the code in the system emulation mode is supposed to use cpu topology variables from MachineState instead of the global ones defined in vl.c and there is no semantic change. Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Like Xu <like.xu@linux.intel.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190518205428.90532-2-like.xu@linux.intel.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index ddefa75c1d..43113386f7 100644
--- a/vl.c
+++ b/vl.c
@@ -4014,6 +4014,11 @@ int main(int argc, char **argv, char **envp)
smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
+ current_machine->smp.cpus = smp_cpus;
+ current_machine->smp.max_cpus = max_cpus;
+ current_machine->smp.cores = smp_cores;
+ current_machine->smp.threads = smp_threads;
+
/* sanity-check smp_cpus and max_cpus against machine_class */
if (smp_cpus < machine_class->min_cpus) {
error_report("Invalid SMP CPUs %d. The min CPUs "