git.annexia.org
/
qemu-sanity-check.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Search for +debug kernels when --kernel option is not used (RHBZ#1002189).
[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
@@
-22,6
+22,10
@@
#include <stdlib.h>
#include <unistd.h>
#include <stdlib.h>
#include <unistd.h>
+#ifdef HAVE_SYS_REBOOT_H
+#include <sys/reboot.h>
+#endif
+
int
main (int argc, char *argv[])
{
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");
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");
fprintf (stderr, "expect to see a kernel panic below, that is normal\n");
fprintf (stderr, "\n");
fprintf (stderr, "\n");