From 5e2862b29da18df518452f52ff7f75b0bb22330f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 15 Feb 2018 14:44:56 -0500 Subject: [PATCH] cpu: Add crash_occurred flag into CPUState CPUState::crash_occurred field inside CPUState marks that guest crash occurred. This value is added into cpu common migration subsection. Backports commit bac05aa9a77af1ca7972c8dc07560f4daa7c2dfc from qemu --- qemu/include/qom/cpu.h | 2 ++ qemu/qom/cpu.c | 1 + 2 files changed, 3 insertions(+) diff --git a/qemu/include/qom/cpu.h b/qemu/include/qom/cpu.h index ec8a542a..692864c2 100644 --- a/qemu/include/qom/cpu.h +++ b/qemu/include/qom/cpu.h @@ -184,6 +184,7 @@ struct kvm_run; * @halted: Nonzero if the CPU is in suspended state. * @stop: Indicates a pending stop request. * @stopped: Indicates the CPU has been artificially stopped. + * @crash_occurred: Indicates the OS reported a crash (panic) for this CPU * @tcg_exit_req: Set to force TCG to stop executing linked TBs for this * CPU and return to its top level loop. * @singlestep_enabled: Flags for single-stepping. @@ -223,6 +224,7 @@ struct CPUState { bool created; bool stop; bool stopped; + bool crash_occurred; volatile sig_atomic_t exit_request; uint32_t interrupt_request; int singlestep_enabled; diff --git a/qemu/qom/cpu.c b/qemu/qom/cpu.c index 6acd3308..ca43fdb2 100644 --- a/qemu/qom/cpu.c +++ b/qemu/qom/cpu.c @@ -167,6 +167,7 @@ static void cpu_common_reset(CPUState *cpu) cpu->icount_extra = 0; cpu->icount_decr.u32 = 0; cpu->can_do_io = 0; + cpu->crash_occurred = false; memset(cpu->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof(void *)); }