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
This commit is contained in:
Lioncash 2018-02-15 14:44:56 -05:00
parent 62544c10af
commit 5e2862b29d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 3 additions and 0 deletions

View file

@ -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;

View file

@ -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 *));
}