From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Euf-000813-30 for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:29:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5EuY-0007VL-Vk for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:29:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5EuY-0007VD-Nc for qemu-devel@nongnu.org; Mon, 20 Jan 2014 08:29:06 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0KDT6AE025046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Jan 2014 08:29:06 -0500 From: Alon Levy Date: Mon, 20 Jan 2014 15:29:00 +0200 Message-Id: <1390224540-12380-1-git-send-email-alevy@redhat.com> In-Reply-To: <87bnz627hi.fsf@blackfin.pond.sub.org> References: <87bnz627hi.fsf@blackfin.pond.sub.org> Subject: [Qemu-devel] [PATCH v2] hw/display/qxl: fix signed to unsigned comparison List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, armbru@redhat.com 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 --- 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