aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpus.c b/cpus.c
index fc0ddc8793..7ec6473c02 100644
--- a/cpus.c
+++ b/cpus.c
@@ -229,7 +229,7 @@ int64_t cpu_get_icount_raw(void)
CPUState *cpu = current_cpu;
icount = timers_state.qemu_icount;
- if (cpu) {
+ if (cpu && cpu->running) {
if (!cpu->can_do_io) {
fprintf(stderr, "Bad icount read\n");
exit(1);