X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=init.c;h=ef7011c032543e1d29b679b617431d307e7d139e;hb=e15822c82b3888420187eb32db82554266a6f350;hp=f19772ba22c726a36a273738c3581b2e6fe9d1d7;hpb=eedd895bb3d8d65de98dbdc4e032853c66958f30;p=qemu-sanity-check.git diff --git a/init.c b/init.c index f19772b..ef7011c 100644 --- a/init.c +++ b/init.c @@ -22,6 +22,10 @@ #include #include +#ifdef HAVE_SYS_REBOOT_H +#include +#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");