Add -m/--machine option.
[qemu-sanity-check.git] / init.c
diff --git a/init.c b/init.c
index f19772b..ef7011c 100644 (file)
--- a/init.c
+++ b/init.c
 #include <stdlib.h>
 #include <unistd.h>
 
+#ifdef HAVE_SYS_REBOOT_H
+#include <sys/reboot.h>
+#endif
+
 int
 main (int argc, char *argv[])
 {
@@ -29,6 +33,14 @@ 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");