Commit b2f76161e8d7021612bd01e0e9a70207b7bf2052

Authored by aurel32
1 parent ca10f867

Stop before shutdown

(Eduardo Felipe)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4192 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 13 additions and 1 deletions
@@ -215,6 +215,7 @@ const char *vnc_display; @@ -215,6 +215,7 @@ const char *vnc_display;
215 int acpi_enabled = 1; 215 int acpi_enabled = 1;
216 int fd_bootchk = 1; 216 int fd_bootchk = 1;
217 int no_reboot = 0; 217 int no_reboot = 0;
  218 +int no_shutdown = 0;
218 int cursor_hide = 1; 219 int cursor_hide = 1;
219 int graphic_rotate = 0; 220 int graphic_rotate = 0;
220 int daemonize = 0; 221 int daemonize = 0;
@@ -7570,7 +7571,12 @@ static int main_loop(void) @@ -7570,7 +7571,12 @@ static int main_loop(void)
7570 7571
7571 if (shutdown_requested) { 7572 if (shutdown_requested) {
7572 ret = EXCP_INTERRUPT; 7573 ret = EXCP_INTERRUPT;
7573 - break; 7574 + if (no_shutdown) {
  7575 + vm_stop(0);
  7576 + no_shutdown = 0;
  7577 + }
  7578 + else
  7579 + break;
7574 } 7580 }
7575 if (reset_requested) { 7581 if (reset_requested) {
7576 reset_requested = 0; 7582 reset_requested = 0;
@@ -7729,6 +7735,7 @@ static void help(int exitcode) @@ -7729,6 +7735,7 @@ static void help(int exitcode)
7729 "-curses use a curses/ncurses interface instead of SDL\n" 7735 "-curses use a curses/ncurses interface instead of SDL\n"
7730 #endif 7736 #endif
7731 "-no-reboot exit instead of rebooting\n" 7737 "-no-reboot exit instead of rebooting\n"
  7738 + "-no-shutdown stop before shutdown\n"
7732 "-loadvm file start right away with a saved state (loadvm in monitor)\n" 7739 "-loadvm file start right away with a saved state (loadvm in monitor)\n"
7733 "-vnc display start a VNC server on display\n" 7740 "-vnc display start a VNC server on display\n"
7734 #ifndef _WIN32 7741 #ifndef _WIN32
@@ -7835,6 +7842,7 @@ enum { @@ -7835,6 +7842,7 @@ enum {
7835 QEMU_OPTION_no_acpi, 7842 QEMU_OPTION_no_acpi,
7836 QEMU_OPTION_curses, 7843 QEMU_OPTION_curses,
7837 QEMU_OPTION_no_reboot, 7844 QEMU_OPTION_no_reboot,
  7845 + QEMU_OPTION_no_shutdown,
7838 QEMU_OPTION_show_cursor, 7846 QEMU_OPTION_show_cursor,
7839 QEMU_OPTION_daemonize, 7847 QEMU_OPTION_daemonize,
7840 QEMU_OPTION_option_rom, 7848 QEMU_OPTION_option_rom,
@@ -7940,6 +7948,7 @@ const QEMUOption qemu_options[] = { @@ -7940,6 +7948,7 @@ const QEMUOption qemu_options[] = {
7940 { "vmwarevga", 0, QEMU_OPTION_vmsvga }, 7948 { "vmwarevga", 0, QEMU_OPTION_vmsvga },
7941 { "no-acpi", 0, QEMU_OPTION_no_acpi }, 7949 { "no-acpi", 0, QEMU_OPTION_no_acpi },
7942 { "no-reboot", 0, QEMU_OPTION_no_reboot }, 7950 { "no-reboot", 0, QEMU_OPTION_no_reboot },
  7951 + { "no-shutdown", 0, QEMU_OPTION_no_shutdown },
7943 { "show-cursor", 0, QEMU_OPTION_show_cursor }, 7952 { "show-cursor", 0, QEMU_OPTION_show_cursor },
7944 { "daemonize", 0, QEMU_OPTION_daemonize }, 7953 { "daemonize", 0, QEMU_OPTION_daemonize },
7945 { "option-rom", HAS_ARG, QEMU_OPTION_option_rom }, 7954 { "option-rom", HAS_ARG, QEMU_OPTION_option_rom },
@@ -8729,6 +8738,9 @@ int main(int argc, char **argv) @@ -8729,6 +8738,9 @@ int main(int argc, char **argv)
8729 case QEMU_OPTION_no_reboot: 8738 case QEMU_OPTION_no_reboot:
8730 no_reboot = 1; 8739 no_reboot = 1;
8731 break; 8740 break;
  8741 + case QEMU_OPTION_no_shutdown:
  8742 + no_shutdown = 1;
  8743 + break;
8732 case QEMU_OPTION_show_cursor: 8744 case QEMU_OPTION_show_cursor:
8733 cursor_hide = 0; 8745 cursor_hide = 0;
8734 break; 8746 break;