cpu: Initialize breakpoint/watchpoint lists in cpu_common_initfn()
authorEduardo Habkost <ehabkost@redhat.com>
Mon, 27 Apr 2015 20:00:32 +0000 (17:00 -0300)
committerAndreas Färber <afaerber@suse.de>
Thu, 9 Jul 2015 13:20:39 +0000 (15:20 +0200)
One small step in the simplification of cpu_exec_init().

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
exec.c
qom/cpu.c

diff --git a/exec.c b/exec.c
index 44bebe9..e2caee9 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -541,8 +541,6 @@ void cpu_exec_init(CPUArchState *env)
         cpu_index++;
     }
     cpu->cpu_index = cpu_index;
-    QTAILQ_INIT(&cpu->breakpoints);
-    QTAILQ_INIT(&cpu->watchpoints);
 #ifndef CONFIG_USER_ONLY
     cpu->as = &address_space_memory;
     cpu->thread_id = qemu_get_thread_id();
index 108bfa2..56c53a8 100644 (file)
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -313,6 +313,8 @@ static void cpu_common_initfn(Object *obj)
     CPUClass *cc = CPU_GET_CLASS(obj);
 
     cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs;
+    QTAILQ_INIT(&cpu->breakpoints);
+    QTAILQ_INIT(&cpu->watchpoints);
 }
 
 static int64_t cpu_common_get_arch_id(CPUState *cpu)