qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Brad Campbell <brad@wasp.net.au>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] -no-reboot
Date: Sun, 20 Aug 2006 12:18:12 +0400	[thread overview]
Message-ID: <44E81AC4.8060008@wasp.net.au> (raw)

G'day all,

I'm developing a series of automated tests for win2k and winxp installs with varying features 
enabled/disabled. One thing I've found *really* handy is the ability to stop qemu rebooting and just 
have it exit every time the vm tries to reboot. (Enables me to use different command line options 
for different parts of the install).

I've knocked up a rough and ready patch for this to vl.c, I just wonder if I cleaned it up and made 
it conform more to the actual qemu coding style whether anyone else would find this feature useful. 
(No help text for this yet)

Anyway, included here for comment

Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.210
diff -u -r1.210 vl.c
--- vl.c        19 Aug 2006 12:37:52 -0000      1.210
+++ vl.c        20 Aug 2006 08:15:04 -0000
@@ -161,6 +161,7 @@
  #endif
  int acpi_enabled = 1;
  int fd_bootchk = 1;
+int no_reboot = 0;

  /***********************************************************/
  /* x86 ISA bus support */
@@ -5611,7 +5612,12 @@

  void qemu_system_reset_request(void)
  {
-    reset_requested = 1;
+    printf("Qemu_system_reset_requested\n");
+    if ( no_reboot ) {
+           shutdown_requested = 1;
+    } else {
+           reset_requested = 1;
+    }
      if (cpu_single_env)
          cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
  }
@@ -5989,6 +5995,7 @@
      QEMU_OPTION_smp,
      QEMU_OPTION_vnc,
      QEMU_OPTION_no_acpi,
+    QEMU_OPTION_no_reboot,
  };

  typedef struct QEMUOption {
@@ -6065,6 +6072,7 @@
      { "usb", 0, QEMU_OPTION_usb },
      { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
      { "no-acpi", 0, QEMU_OPTION_no_acpi },
+    { "no-reboot", 0, QEMU_OPTION_no_reboot },
      { NULL },
  };

@@ -6708,6 +6716,10 @@
              case QEMU_OPTION_no_acpi:
                  acpi_enabled = 0;
                  break;
+            case QEMU_OPTION_no_reboot:
+               printf("Rebooting Disabled\n");
+               no_reboot = 1;
+               break;
              }
          }
      }

Brad
-- 
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams

                 reply	other threads:[~2006-08-20  8:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44E81AC4.8060008@wasp.net.au \
    --to=brad@wasp.net.au \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).