For some reason, panic=1 is broken on kernel 3.11. Calling reboot is
more reliable.
Note that qemu won't actually reboot the VM, because we are passing
-no-reboot on the command line, so the VM should exit instead.
AM_PROG_CC_C_O
+AC_CHECK_HEADERS([sys/reboot.h])
+
dnl Allow the package to override the default list of qemu binary
dnl names which are tried, since this heavily depends on how qemu
dnl has been packaged in the downstream distro.
#include <stdlib.h>
#include <unistd.h>
+#ifdef HAVE_SYS_REBOOT_H
+#include <sys/reboot.h>
+#endif
+
int
main (int argc, char *argv[])
{
fprintf (stderr, "***** initrd started up OK *****\n");
fprintf (stderr, "\n");
fprintf (stderr, "\n");
+
+#if defined(HAVE_SYS_REBOOT_H) && defined(RB_AUTOBOOT)
+ /* Try to reboot the system. */
+ reboot (RB_AUTOBOOT);
+ perror ("reboot");
+ /* Reboot attempt failed, fallthrough below. */
+#endif
+
fprintf (stderr, "expect to see a kernel panic below, that is normal\n");
fprintf (stderr, "\n");
fprintf (stderr, "\n");