Add -m/--machine option.
[qemu-sanity-check.git] / init.c
diff --git a/init.c b/init.c
index 17bfa2a..ef7011c 100644 (file)
--- a/init.c
+++ b/init.c
@@ -11,9 +11,9 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <config.h>
 #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");