qemu-devel
[Top][All Lists]
Advanced

[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 12:15:42 +0100

2015-02-17 11:51+0100, Gerd Hoffmann:
>   Hi,
> 
> > > Which command line triggers it?
> > 
> > The important subset is:
> >   -vga qxl -global qxl-vga.vgamem_mb=512
> 
> Ah, so the problem is only one place enforces a upper limit, so we can
> get an invalid configuration with large values.

(I think that hardcoding the limit at two unrelated places is bad --
 nothing in the code has improved since the first bug.)

> Can you try the attached patch?

It doesn't crash, but spice doesn't work when setting vgamem that high,
and there is no reason to anyway, so the attached hunk would be better.

Thanks.


---
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 61df47726481..3c55aa6479d4 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1880,6 +1880,9 @@ static void qxl_init_ramsize(PCIQXLDevice *qxl)
     if (qxl->vgamem_size_mb < 8) {
         qxl->vgamem_size_mb = 8;
     }
+    if (qxl->vgamem_size_mb > 128) {
+        qxl->vgamem_size_mb = 128;
+    }
     qxl->vgamem_size = qxl->vgamem_size_mb * 1024 * 1024;
 
     /* vga ram (bar 0, total) */



reply via email to

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