aboutsummaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorAndrey Smetanin <asmetanin@virtuozzo.com>2015-07-03 15:01:43 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2015-09-16 17:33:32 +0200
commit7c207b90465bc16a39b9fb8d9194f161059f69bf (patch)
treeef9677871ef41eaffd0bb29be6822cc01fd8649c /kvm-all.c
parentbac05aa9a77af1ca7972c8dc07560f4daa7c2dfc (diff)
kvm: Add kvm system event crash handler
KVM kernel can send guest crash events into userspace. Appropriate guest crash handler is called when kernel guest crash event received. Guest crash event recognized by a KVM_SYSTEM_EVENT_CRASH type of system event. Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Andreas Färber <afaerber@suse.de> Message-Id: <1435924905-8926-11-git-send-email-den@openvz.org> [Rebase: add lock/unlock iothread around qemu_system_guest_panicked - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index c6f5128756..de1924c467 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1889,6 +1889,12 @@ int kvm_cpu_exec(CPUState *cpu)
qemu_system_reset_request();
ret = EXCP_INTERRUPT;
break;
+ case KVM_SYSTEM_EVENT_CRASH:
+ qemu_mutex_lock_iothread();
+ qemu_system_guest_panicked();
+ qemu_mutex_unlock_iothread();
+ ret = 0;
+ break;
default:
DPRINTF("kvm_arch_handle_exit\n");
ret = kvm_arch_handle_exit(cpu, run);