WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] console: allow a panic to be triggered from the xen

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] console: allow a panic to be triggered from the xen console
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 7 Jul 2006 10:09:50 +0900
Cc: Magnus Damm <magnus@xxxxxxxxxxxxx>
Delivery-date: Fri, 07 Jul 2006 02:44:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060515074734.GA15410@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060515074734.GA15410@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11+cvs20060403
Hi,

this is a resend of this patch, which I believe is a simple but
useful feature. I have used it extensively to test the kdump
patches which I have been developing with my colleague Magnus Damm.
It is probably useful for other purposes too, and is analogous
to the trigger crashdump feature of Linux's sysrq.

-- 
Horms                                           

console: allow a panic to be triggered from the xen console

I'm not sure how useful this is generally, but
its proving quite useful for me while working on kdump/kexec.

Signed-Off-By: Horms <horms@xxxxxxxxxxxx>

diff -r 91c77df11b43 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Wed May 10 17:30:42 2006 +0100
+++ b/xen/drivers/char/console.c        Mon May 15 15:19:16 2006 +0900
@@ -701,6 +701,19 @@ void panic(const char *fmt, ...)
     machine_restart(0);
 }
 
+static void do_panic_trigger(unsigned char key)
+{
+       printk("triggering panic\n");
+       panic("CPU%d triggered panic\n", smp_processor_id());
+}
+
+static __init int register_panic_trigger(void)
+{
+       register_keyhandler('p', do_panic_trigger, "trigger a panic");
+       return 0;
+}
+__initcall(register_panic_trigger);
+
 /*
  * Local variables:
  * mode: C


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel