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