From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RznRO-00034c-Ue for qemu-devel@nongnu.org; Tue, 21 Feb 2012 05:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RznRG-0000Lv-18 for qemu-devel@nongnu.org; Tue, 21 Feb 2012 05:59:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RznRF-0000Lj-P4 for qemu-devel@nongnu.org; Tue, 21 Feb 2012 05:59:17 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1LAxGKs016855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Feb 2012 05:59:16 -0500 From: Gerd Hoffmann Date: Tue, 21 Feb 2012 11:59:06 +0100 Message-Id: <1329821953-32446-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1329821953-32446-1-git-send-email-kraxel@redhat.com> References: <1329821953-32446-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/9] qxl: don't render stuff when the vm is stopped. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is largely pointless because we ask spice-server to process all not-yet processed commands when the vm is stopped, so there isn't much do do anyway. Second we avoid triggering an assert in spice-server. The patch makes sure we still honor redraw requests, even if we don't ask spice-server for updates. This is needed to handle displaysurface changes with a stopped vm correctly. With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped. Signed-off-by: Gerd Hoffmann --- hw/qxl-render.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/qxl-render.c b/hw/qxl-render.c index 133d093..7084143 100644 --- a/hw/qxl-render.c +++ b/hw/qxl-render.c @@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl) dpy_resize(vga->ds); } - if (!qxl->guest_primary.commands) { - return; - } - qxl->guest_primary.commands = 0; - update.left = 0; update.right = qxl->guest_primary.surface.width; update.top = 0; update.bottom = qxl->guest_primary.surface.height; memset(dirty, 0, sizeof(dirty)); - qxl_spice_update_area(qxl, 0, &update, - dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC); + if (runstate_is_running() && qxl->guest_primary.commands) { + qxl->guest_primary.commands = 0; + qxl_spice_update_area(qxl, 0, &update, + dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC); + } if (redraw) { memset(dirty, 0, sizeof(dirty)); dirty[0] = update; -- 1.7.1