aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-02-23 10:37:58 -0500
committerKevin O'Connor <kevin@koconnor.net>2013-02-23 10:37:58 -0500
commit400c66cd253ea5e730ba13c4abad2b699b1d08b8 (patch)
treea21084c07a71265fbb3a7d395772bf19cec6def0
parentd338eb94f65c765d43fd9cc9c31e9ec914ca64e3 (diff)
downloadseabios-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>
-rw-r--r--src/resume.c9
-rw-r--r--src/shadow.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/resume.c b/src/resume.c
index 784abac..9466480 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.
diff --git a/src/shadow.c b/src/shadow.c
index 0aac60b..e971fe9 100644
--- a/src/shadow.c
+++ b/src/shadow.c
@@ -169,8 +169,4 @@ qemu_prep_reset(void)
extern u8 code32flat_start[], code32flat_end[];
memcpy(code32flat_start, code32flat_start + BIOS_SRC_OFFSET
, code32flat_end - code32flat_start);
-
- if (HaveRunPost)
- // Memory copy failed to work - try to halt the machine.
- apm_shutdown();
}