mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
general: Replace global smp variables with smp machine properties
Basically, the context could get the MachineState reference via call chains or unrecommended qdev_get_machine() in !CONFIG_USER_ONLY mode. A local variable of the same name would be introduced in the declaration phase out of less effort OR replace it on the spot if it's only used once in the context. No semantic changes. Signed-off-by: Like Xu <like.xu@linux.intel.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190518205428.90532-4-like.xu@linux.intel.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "exec/gdbstub.h"
|
||||
#include "hw/cpu/cluster.h"
|
||||
#include "hw/boards.h"
|
||||
#endif
|
||||
|
||||
#define MAX_PACKET_LENGTH 4096
|
||||
@@ -1171,6 +1172,9 @@ static int gdb_handle_vcont(GDBState *s, const char *p)
|
||||
CPU_FOREACH(cpu) {
|
||||
max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus;
|
||||
}
|
||||
#else
|
||||
MachineState *ms = MACHINE(qdev_get_machine());
|
||||
unsigned int max_cpus = ms->smp.max_cpus;
|
||||
#endif
|
||||
/* uninitialised CPUs stay 0 */
|
||||
newstates = g_new0(char, max_cpus);
|
||||
|
||||
Reference in New Issue
Block a user