qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Screen dump on shutdown?
@ 2009-02-17  8:54 Steve Fosdick
  2009-02-17 11:17 ` [Qemu-devel] [PATCH] Screen dump on shutdown Steve Fosdick
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Fosdick @ 2009-02-17  8:54 UTC (permalink / raw)
  To: qemu-devel

How hard would it be to implement a feature where a screendump is taken
to a predetermined file immediately before the virtual machine is
powered off or rebooted?

The application I have in mind for this is when the guest fails to boot
correctly.  It would be useful if there was a screendump at the point
the guest attempts an automatic reboot in order to gather at least some
information about what went wrong.

Regards,
Steve.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] [PATCH] Screen dump on shutdown
  2009-02-17  8:54 [Qemu-devel] Screen dump on shutdown? Steve Fosdick
@ 2009-02-17 11:17 ` Steve Fosdick
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Fosdick @ 2009-02-17 11:17 UTC (permalink / raw)
  To: qemu-devel

[-- 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)
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-17 11:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-17  8:54 [Qemu-devel] Screen dump on shutdown? Steve Fosdick
2009-02-17 11:17 ` [Qemu-devel] [PATCH] Screen dump on shutdown Steve Fosdick

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).