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>
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.
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();
}