qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steve Fosdick <lists@pelvoux.nildram.co.uk>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Screen dump on shutdown
Date: Tue, 17 Feb 2009 11:17:07 +0000	[thread overview]
Message-ID: <1234869427.18080.40.camel@ecrins.fosdick.home.net> (raw)
In-Reply-To: <1234860861.18080.35.camel@ecrins.fosdick.home.net>

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

After my earlier message about a screen dump taken at shutdown or reboot
this turned out to be very simple to implement so I attach a patch which
does that.

Regards,
Steve.

[-- Attachment #2: Type: text/x-patch, Size: 2516 bytes --]

Index: vl.c
===================================================================
--- vl.c	(revision 6626)
+++ vl.c	(working copy)
@@ -234,6 +234,7 @@
 int fd_bootchk = 1;
 int no_reboot = 0;
 int no_shutdown = 0;
+const char *sdump_file = NULL;
 int cursor_hide = 1;
 int graphic_rotate = 0;
 int daemonize = 0;
@@ -3578,6 +3579,8 @@
 
 void qemu_system_reset_request(void)
 {
+    if (sdump_file)
+        vga_hw_screen_dump(sdump_file);
     if (no_reboot) {
         shutdown_requested = 1;
     } else {
@@ -3589,6 +3592,8 @@
 
 void qemu_system_shutdown_request(void)
 {
+    if (sdump_file)
+        vga_hw_screen_dump(sdump_file);
     shutdown_requested = 1;
     if (cpu_single_env)
         cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
@@ -4045,6 +4050,7 @@
 #endif
            "-no-reboot      exit instead of rebooting\n"
            "-no-shutdown    stop before shutdown\n"
+           "-sdump file     screendump to file on shutdown or reset\n"
            "-loadvm [tag|id]\n"
            "                start right away with a saved state (loadvm in monitor)\n"
 #ifndef _WIN32
@@ -4174,6 +4180,7 @@
     QEMU_OPTION_enable_kvm,
     QEMU_OPTION_no_reboot,
     QEMU_OPTION_no_shutdown,
+    QEMU_OPTION_sdump,
     QEMU_OPTION_loadvm,
     QEMU_OPTION_daemonize,
     QEMU_OPTION_option_rom,
@@ -4297,6 +4304,7 @@
 #endif
     { "no-reboot", 0, QEMU_OPTION_no_reboot },
     { "no-shutdown", 0, QEMU_OPTION_no_shutdown },
+    { "sdump", HAS_ARG, QEMU_OPTION_sdump },
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "daemonize", 0, QEMU_OPTION_daemonize },
     { "option-rom", HAS_ARG, QEMU_OPTION_option_rom },
@@ -5179,6 +5187,9 @@
             case QEMU_OPTION_no_shutdown:
                 no_shutdown = 1;
                 break;
+            case QEMU_OPTION_sdump:
+                sdump_file = optarg;
+                break;
             case QEMU_OPTION_show_cursor:
                 cursor_hide = 0;
                 break;
Index: qemu-doc.texi
===================================================================
--- qemu-doc.texi	(revision 6626)
+++ qemu-doc.texi	(working copy)
@@ -1107,6 +1107,10 @@
 This allows for instance switching to monitor to commit changes to the
 disk image.
 
+@item -sdump @var{file}
+Write a screen dump to the specified file immediately before a
+shutdown or reboot.
+
 @item -loadvm @var{file}
 Start right away with a saved state (@code{loadvm} in monitor)
 

      reply	other threads:[~2009-02-17 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  8:54 [Qemu-devel] Screen dump on shutdown? Steve Fosdick
2009-02-17 11:17 ` Steve Fosdick [this message]

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=1234869427.18080.40.camel@ecrins.fosdick.home.net \
    --to=lists@pelvoux.nildram.co.uk \
    --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).