qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano Stabelli


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano Stabellini)
Date: Fri, 16 Jan 2009 12:36:33 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Stefano Stabellini wrote:
Jan Kiszka wrote:

This hunk now generates:

qemu/hw/pc.c: In function â¬Üpc_init1â¬":
qemu/hw/pc.c:762: warning: â¬Üvga_bios_offsetâ¬" may be used uninitialized in this function
For obvious reasons. Can we simply make the related
cpu_register_physical_memory conditional as well?

Jan




You are right that patch caused variable initialization issues, this
patch should fix them.

Signed-off-by: Stefano Stabellini <address@hidden>

diff --git a/hw/pc.c b/hw/pc.c
index d64e442..ff0f16d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -759,7 +759,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 {
     char buf[1024];
     int ret, linux_boot, i;
-    ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset;
+    ram_addr_t ram_addr, vga_ram_addr = 0x00, bios_offset, vga_bios_offset;
     ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
     int bios_size, isa_bios_size, vga_bios_size;
     PCIBus *pci_bus;
@@ -831,10 +831,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
                                      ram_addr);
     }
-
-    /* allocate VGA RAM */
-    vga_ram_addr = qemu_ram_alloc(vga_ram_size);
-

It's a little safer to leave this allocation in place because it maintains the 1-1 mapping of phys_ram_base and low memory. Unfortunately, I think there is still code that depends on this.

Regards,

Anthony Liguroi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]