aboutsummaryrefslogtreecommitdiff
path: root/qom/cpu.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2016-07-25 11:59:21 +0200
committerEduardo Habkost <ehabkost@redhat.com>2016-07-26 15:32:01 -0300
commita07f953ef4ef48058c24fb50b49e6fa28bf5f5f4 (patch)
tree5715286d5955f261ff6e4d1c76a6fd9ee4a9fec7 /qom/cpu.c
parent8b1b835035fda831b405c1947210efcf758a7ca8 (diff)
downloadqemu-a07f953ef4ef48058c24fb50b49e6fa28bf5f5f4.zip
qemu-a07f953ef4ef48058c24fb50b49e6fa28bf5f5f4.tar.gz
qemu-a07f953ef4ef48058c24fb50b49e6fa28bf5f5f4.tar.bz2
exec: Set cpu_index only if it's not been explictly set
It keeps the legacy behavior for all users that doesn't care about stable cpu_index value, but would allow boards that would support device_add/device_del to set stable cpu_index that won't depend on order in which cpus are created/destroyed. While at that simplify cpu_get_free_index() as cpu_index generated by USER_ONLY and softmmu variants is the same since none of the users support cpu-remove so far, except of not yet released spapr/x86 device_add/delr, which will be altered by follow up patches to set stable cpu_index manually. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'qom/cpu.c')
-rw-r--r--qom/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index 42b5631..2553247 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -340,7 +340,7 @@ static void cpu_common_initfn(Object *obj)
CPUState *cpu = CPU(obj);
CPUClass *cc = CPU_GET_CLASS(obj);
- cpu->cpu_index = -1;
+ cpu->cpu_index = UNASSIGNED_CPU_INDEX;
cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs;
qemu_mutex_init(&cpu->work_mutex);
QTAILQ_INIT(&cpu->breakpoints);