Skip to contentSkip to conversation

Initialize the VMware VGA console after vga_init

PATCH In review Alexander Graf 3 participants 3 messages Jul 8, 2008 – Jul 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Initialize the VMware VGA console after vga_init

Hi,

while trying the -vmwarevga switch I stumbled across this nifty problem: vga_common_init calls vga_reset, which memsets the whole VGAState to 0. Unfortunately the console initialization code is before that, so it gets overwritten by 0 which breaks later on.

To circumvent this I reordered the console initialization to after the vga_init. I am not 100% sure if that's correct, but it works so far. Please double-check if this is the right approach.

Alex

vmware_vga.c +5 -5
Index: hw/vmware_vga.c
===================================================================
@@ -1123,16 +1123,16 @@
 
     vmsvga_reset(s);
 
-    s->console = graphic_console_init(ds, vmsvga_update_display,
-                                      vmsvga_invalidate_display,
-                                      vmsvga_screen_dump,
-                                      vmsvga_text_update, s);
-
 #ifdef EMBED_STDVGA
     vga_common_init((VGAState *) s, ds,
                     vga_ram_base, vga_ram_offset, vga_ram_size);
     vga_init((VGAState *) s);
 #endif
+
+    s->console = graphic_console_init(ds, vmsvga_update_display,
+                                      vmsvga_invalidate_display,
+                                      vmsvga_screen_dump,
+                                      vmsvga_text_update, s);
 }
 
 static void pci_vmsvga_save(QEMUFile *f, void *opaque)
#1 lore raw
Quoted 7 lines · Alexander Graf

Hi,

while trying the -vmwarevga switch I stumbled across this nifty problem:
vga_common_init calls vga_reset, which memsets the whole VGAState to 0. Unfortunately the console initialization code is before that, so it gets overwritten by 0 which breaks later on.

Quoted 7 lines

To circumvent this I reordered the console initialization to after the vga_init. I am not 100% sure if that's correct, but it works so far. Please double-check if this is the right approach.

Alex

Improvement here, as well.
Thanks!

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alexander Graf
Quoted 17 lines · Alexander Graf

Hi,

while trying the -vmwarevga switch I stumbled across this nifty problem:
vga_common_init calls vga_reset, which memsets the whole VGAState to 0. Unfortunately the console initialization code is before that, so it gets overwritten by 0 which breaks later on.

To circumvent this I reordered the console initialization to after the vga_init. I am not 100% sure if that's correct, but it works so far. Please double-check if this is the right approach.

Alex