aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-05-12 10:39:32 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2017-05-12 10:39:35 -0400
commit3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d (patch)
treed007aee1e6c5db9039a9fbde3343939b2e6596a1
parentb54933eed532b10c8a1967d9f988262ccbb94ee2 (diff)
parent5651743c908d8c3b1ff0192ce9543a502ec7a206 (diff)
downloadqemu-3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d.zip
qemu-3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d.tar.gz
qemu-3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d.tar.bz2
Merge tag 'tracing-pull-request' into staging
# gpg: Signature made Fri 12 May 2017 10:38:07 AM EDT # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * tag 'tracing-pull-request': trace: add sanity check Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--qom/cpu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index f02e9c0..f9111a0 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -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);
}