diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-12 15:17:21 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-12 15:17:21 +0100 |
commit | 17af31bde615d3655b2659319d3d8d6b6e3b3e73 (patch) | |
tree | 8a48d7f59a0a23465961f180d89e548baecfe905 /tools/ioemu/hw/pc.c | |
parent | 4b769f4b6160f8a43856940f38ea44b66e339443 (diff) | |
download | xen-17af31bde615d3655b2659319d3d8d6b6e3b3e73.tar.gz xen-17af31bde615d3655b2659319d3d8d6b6e3b3e73.tar.bz2 xen-17af31bde615d3655b2659319d3d8d6b6e3b3e73.zip |
Fix the cirrus vga model to not leak memory when switching between
initial vga mode and linear framebuffer.
When creating device model, the vga memory is allocated through
xc_domain_memory_increase_reservation(), however, when switch to use
linear framebuffer, we didn't free that memory, and re-allocate the vga
memory through set_mm_mapping(), that caused memory leak. Now it is
changed to just using qemu_malloc when create device model, and free
that memory when switch to linear framebuffer.
After unset_vram_mapping(), the old memory pointer should be
unmapped; after set_vram_mapping(), the old memory should be freed.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'tools/ioemu/hw/pc.c')
-rw-r--r-- | tools/ioemu/hw/pc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/ioemu/hw/pc.c b/tools/ioemu/hw/pc.c index 474b1de4f4..40cbc826a4 100644 --- a/tools/ioemu/hw/pc.c +++ b/tools/ioemu/hw/pc.c @@ -385,7 +385,6 @@ void pc_init(uint64_t ram_size, int vga_ram_size, int boot_device, char buf[1024]; int ret, linux_boot, initrd_size, i, nb_nics1; PCIBus *pci_bus; - extern void * shared_vram; linux_boot = (kernel_filename != NULL); @@ -512,14 +511,14 @@ void pc_init(uint64_t ram_size, int vga_ram_size, int boot_device, if (cirrus_vga_enabled) { if (pci_enabled) { pci_cirrus_vga_init(pci_bus, - ds, shared_vram, ram_size, + ds, NULL, ram_size, vga_ram_size); } else { - isa_cirrus_vga_init(ds, shared_vram, ram_size, + isa_cirrus_vga_init(ds, NULL, ram_size, vga_ram_size); } } else { - vga_initialize(pci_bus, ds, shared_vram, ram_size, + vga_initialize(pci_bus, ds, NULL, ram_size, vga_ram_size); } |