diff options
Diffstat (limited to 'qom/cpu.c')
-rw-r--r-- | qom/cpu.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -382,6 +382,7 @@ static void cpu_common_unrealizefn(DeviceState *dev, Error **errp) static void cpu_common_initfn(Object *obj) { + uint32_t count; CPUState *cpu = CPU(obj); CPUClass *cc = CPU_GET_CLASS(obj); @@ -396,7 +397,10 @@ static void cpu_common_initfn(Object *obj) QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); - cpu->trace_dstate = bitmap_new(trace_get_vcpu_event_count()); + count = trace_get_vcpu_event_count(); + if (count) { + cpu->trace_dstate = bitmap_new(count); + } cpu_exec_initfn(cpu); } |