[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/10] console: Fix segfault on screendump without V
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 02/10] console: Fix segfault on screendump without VGA adapter |
Date: |
Tue, 3 Jan 2012 16:08:14 +0100 |
When trying to create a screen dump without having any VGA adapter
inside the guest, QEMU segfaults.
This is because it's trying to switch back to the "previous" screen
it was on before dumping the VGA screen. Unfortunately, in my case
there simply is no previous screen so it accesses a NULL pointer.
Fix it by checking if previous_active_console is actually available.
This is 1.0 material.
Signed-off-by: Alexander Graf <address@hidden>
---
console.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/console.c b/console.c
index 223f8fd..135394f 100644
--- a/console.c
+++ b/console.c
@@ -186,7 +186,9 @@ void vga_hw_screen_dump(const char *filename)
consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
}
- console_select(previous_active_console->index);
+ if (previous_active_console) {
+ console_select(previous_active_console->index);
+ }
}
void vga_hw_text_update(console_ch_t *chardata)
--
1.6.0.2
- [Qemu-devel] [PULL 00/10] ppc patch queue 2012-01-03, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 02/10] console: Fix segfault on screendump without VGA adapter,
Alexander Graf <=
- [Qemu-devel] [PATCH 05/10] pseries: FDT NUMA extensions to support multi-node guests, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 08/10] pseries: Populate "/chosen/linux, stdout-path" in the FDT, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 10/10] PPC: Add description for the Freescale e500mc core., Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 03/10] kvm-ppc: halt secondary cpus when guest reset, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 06/10] pseries: Emit device tree nodes in reg order, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 09/10] pseries: Check for duplicate addresses on the spapr-vio bus, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 01/10] PPC: monitor: add ability to dump SLB entries, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 07/10] pseries: Add a routine to find a stable "default" vty and use it, Alexander Graf, 2012/01/03
- [Qemu-devel] [PATCH 04/10] pseries: Remove hcalls callback, Alexander Graf, 2012/01/03
- Re: [Qemu-devel] [PULL 00/10] ppc patch queue 2012-01-03, Aurelien Jarno, 2012/01/07