debuggers.hg

view unmodified_drivers/linux-2.6/platform-pci/panic-handler.c @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents a88e19526770
children
line source
1 #include <linux/module.h>
2 #include <linux/init.h>
3 #include <linux/notifier.h>
4 #include <asm/hypervisor.h>
6 #ifdef HAVE_XEN_PLATFORM_COMPAT_H
7 #include <xen/platform-compat.h>
8 #endif
10 MODULE_LICENSE("GPL");
12 #ifdef __ia64__
13 static void
14 xen_panic_hypercall(struct unw_frame_info *info, void *arg)
15 {
16 current->thread.ksp = (__u64)info->sw - 16;
17 HYPERVISOR_shutdown(SHUTDOWN_crash);
18 /* we're never actually going to get here... */
19 }
20 #endif
22 static int
23 xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
24 {
25 #ifdef __ia64__
26 unw_init_running(xen_panic_hypercall, NULL);
27 #else /* !__ia64__ */
28 HYPERVISOR_shutdown(SHUTDOWN_crash);
29 #endif
30 /* we're never actually going to get here... */
31 return NOTIFY_DONE;
32 }
34 static struct notifier_block xen_panic_block = {
35 .notifier_call = xen_panic_event
36 };
38 int xen_panic_handler_init(void)
39 {
40 atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
41 return 0;
42 }