diff options
author | Donald Dutile <ddutile@redhat.com> | 2010-07-15 14:56:49 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-08-04 14:47:31 -0700 |
commit | f09f6d194d85043e0eb105a577e7ad6d8170ab66 (patch) | |
tree | 1ac8db53e42a15f9f28f20c941d75bb8b94fd385 /arch/x86/xen/enlighten.c | |
parent | c06ee78d73fd24e8d8a65f16380f6a0551107e1b (diff) | |
download | op-kernel-dev-f09f6d194d85043e0eb105a577e7ad6d8170ab66.zip op-kernel-dev-f09f6d194d85043e0eb105a577e7ad6d8170ab66.tar.gz |
Xen: register panic notifier to take crashes of xen guests on panic
Register a panic notifier so that when the guest crashes it can shut
down the domain and indicate it was a crash to the host.
Signed-off-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r-- | arch/x86/xen/enlighten.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 90a3e80..d99522e 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1040,6 +1040,26 @@ static void xen_crash_shutdown(struct pt_regs *regs) xen_reboot(SHUTDOWN_crash); } +static int +xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) +{ + struct sched_shutdown r = { .reason = SHUTDOWN_crash}; + + if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) + BUG(); + return NOTIFY_DONE; +} + +static struct notifier_block xen_panic_block = { + .notifier_call= xen_panic_event, +}; + +int xen_panic_handler_init(void) +{ + atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); + return 0; +} + static const struct machine_ops __initdata xen_machine_ops = { .restart = xen_restart, .halt = xen_machine_halt, |