Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 720

kvm-83-270.el5_11.src.rpm

From 6195e7de339d8e08aea3c4bf86ea5661ec55970f Mon Sep 17 00:00:00 2001
From: Yaniv Kamay <yaniv@qumranet.com>
Date: Sun, 8 Mar 2009 23:16:51 +0200
Subject: [PATCH 1/2] qemu: prevent reset of vga fb mapping in case of isa

Bugzilla: 489348
Acked-by: Izik Eidus <ieidus@redhat.com>
Acked-by: Dor Laor <dlaor@redhat.com>
---
 qemu/hw/vga.c     |    7 +++++--
 qemu/hw/vga_int.h |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/qemu/hw/vga.c b/qemu/hw/vga.c
index b28c2ab..17a2ceb 100644
--- a/qemu/hw/vga.c
+++ b/qemu/hw/vga.c
@@ -1863,8 +1863,10 @@ void vga_reset(void *opaque)
 
     s->lfb_addr = 0;
     s->lfb_end = 0;
-    s->map_addr = 0;
-    s->map_end = 0;
+    if (!s->isa) {
+        s->map_addr = 0;
+        s->map_end = 0;
+    }
     s->lfb_vram_mapped = 0;
     s->bios_offset = 0;
     s->bios_size = 0;
@@ -2595,6 +2597,7 @@ int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
 
     s->console = graphic_console_init(s->ds, s->update, s->invalidate,
                                       s->screen_dump, s->text_update, s);
+    s->isa = 1; 
 
 #ifdef CONFIG_BOCHS_VBE
     /* XXX: use optimized standard vga accesses */
diff --git a/qemu/hw/vga_int.h b/qemu/hw/vga_int.h
index fa34978..f140057 100644
--- a/qemu/hw/vga_int.h
+++ b/qemu/hw/vga_int.h
@@ -110,6 +110,7 @@ typedef void (* vga_update_retrace_info_fn)(struct VGAState *s);
     unsigned long bios_offset;                                          \
     unsigned int bios_size;                                             \
     int it_shift;                                                       \
+    int isa;                                                            \
     PCIDevice *pci_dev;                                                 \
     uint32_t latch;                                                     \
     uint8_t sr_index;                                                   \
@@ -133,7 +134,7 @@ typedef void (* vga_update_retrace_info_fn)(struct VGAState *s);
     int dac_8bit;                                                       \
     uint8_t palette[768];                                               \
     int32_t bank_offset;                                                \
-    int vga_io_memory;                                             \
+    int vga_io_memory;                                                  \
     int (*get_bpp)(struct VGAState *s);                                 \
     void (*get_offsets)(struct VGAState *s,                             \
                         uint32_t *pline_offset,                         \
-- 
1.6.1