diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-02-23 10:37:58 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-02-23 10:37:58 -0500 |
commit | 400c66cd253ea5e730ba13c4abad2b699b1d08b8 (patch) | |
tree | a21084c07a71265fbb3a7d395772bf19cec6def0 /src/resume.c | |
parent | d338eb94f65c765d43fd9cc9c31e9ec914ca64e3 (diff) | |
download | seabios-400c66cd253ea5e730ba13c4abad2b699b1d08b8.tar.gz |
Try to detect an unsuccessful hard-reboot to prevent soft-reboot loops.
There have been various kvm bugs that prevent reboots from working
properly. Generalize the existing test for a failed reboot to better
catch these cases.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/resume.c')
-rw-r--r-- | src/resume.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resume.c b/src/resume.c index 784abac0..94664803 100644 --- a/src/resume.c +++ b/src/resume.c @@ -123,10 +123,19 @@ s3_resume(void) farcall16big(&br); } +u8 HaveAttemptedReboot VARLOW; + // Attempt to invoke a hard-reboot. static void tryReboot(void) { + if (HaveAttemptedReboot) { + // Hard reboot has failed - try to shutdown machine. + dprintf(1, "Unable to hard-reboot machine - attempting shutdown.\n"); + apm_shutdown(); + } + HaveAttemptedReboot = 1; + dprintf(1, "Attempting a hard reboot\n"); // Setup for reset on qemu. |