Fix signed to unsigned comparison in qxl_create_guest_primary and add the size of the framebuffer to the error message used when setting the guest bug state (which causes a complete guess blackout until reset, so it helps if it is verbose).
Signed-off-by: Alon Levy <al...@redhat.com> --- hw/display/qxl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index e4f172e..b799b51 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1360,14 +1360,15 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm, { QXLDevSurfaceCreate surface; QXLSurfaceCreate *sc = &qxl->guest_primary.surface; - int size; + uint32_t size; int requested_height = le32_to_cpu(sc->height); int requested_stride = le32_to_cpu(sc->stride); size = abs(requested_stride) * requested_height; if (size > qxl->vgamem_size) { - qxl_set_guest_bug(qxl, "%s: requested primary larger then framebuffer" - " size", __func__); + qxl_set_guest_bug(qxl, "%s: requested primary larger than framebuffer" + " size %u > %u", __func__, size, + qxl->vgamem_size); return; } -- 1.8.4.2