[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory
From: |
Radim Krčmář |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory |
Date: |
Tue, 17 Feb 2015 11:29:28 +0100 |
2015-02-17 09:00+0100, Gerd Hoffmann:
> On Mo, 2015-02-16 at 22:23 +0100, Radim Krčmář wrote:
> > Automatic shrinking of vram_size leads to a segfault, because other
> > variables depend on being smaller and don't get shrinked.
>
> --verbose please. Which other variables?
I'm sorry, at least rom->surface0_area_size.
(It is sourced from qxl->vgamem_size.)
rom->surface0_area_size shouldn't be bigger than qxl->vga.vram_size,
because it accesses memory allocated by it.
> > Implications of shrinking would make the code needlessly complicated;
> > assert instead.
>
> assert isn't an option. vram_size_mb may come from the user (via vga
> device properties), so we need a friendly error message here.
Agreed, it would require a lot of code to do it though (in cover letter)
... what about just dropping [1/2]? :) ([2/2] does the same job)
> Also the loop you are removing makes sure vram_size is a power of two,
> removing that is not correct too.
(True, the patch should have asserted that as well.)