]> xenbits.xensource.com Git - seabios.git/commitdiff
Try to detect an unsuccessful hard-reboot to prevent soft-reboot loops.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 23 Feb 2013 15:37:58 +0000 (10:37 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 23 Feb 2013 15:37:58 +0000 (10:37 -0500)
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>
src/resume.c
src/shadow.c

index 784abac00d5ca9859577820a9efed630ae609744..94664803e3354623726428b78da9a2de4078c386 100644 (file)
@@ -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.
index 0aac60bbeeb20eef980d73b1bf16409eae0193d5..e971fe96189ae5b139537b7c8871d50e3ef286a8 100644 (file)
@@ -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();
 }