Received: from eggs.gnu.org ([2001:4830:134:3::10]:45273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS1Lk-00057e-61 for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:39:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS1Lc-0008Tt-Qo for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:39:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS1Lc-0008TZ-If for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:39:12 -0400 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 s2O9dBfo001620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Mar 2014 05:39:11 -0400 From: Alon Levy Date: Mon, 24 Mar 2014 11:39:04 +0200 Message-Id: <1395653944-14544-1-git-send-email-alevy@redhat.com> Subject: [Qemu-devel] [PATCH] display/qxl: don't abort on reset with non empty rings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com The command ring and cursor rings are pushed to by the guest, and cleared asynchronously by qemu's spice thread. It is easy to have them non empty by bad guest behaviour, and we must never abort on bad guest behaviour. Signed-off-by: Alon Levy --- hw/display/qxl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 47bbf1f..abe7a18 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1111,8 +1111,12 @@ static void qxl_check_state(PCIQXLDevice *d) QXLRam *ram = d->ram; int spice_display_running = qemu_spice_display_is_running(&d->ssd); - assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cmd_ring)); - assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cursor_ring)); + if (spice_display_running && !SPICE_RING_IS_EMPTY(&ram->cmd_ring)) { + fprintf(stderr, "qxl: cmd ring not empty on reset\n"); + } + if (spice_display_running && !SPICE_RING_IS_EMPTY(&ram->cursor_ring)) { + fprintf(stderr, "qxl: cursor ring not empty on reset\n"); + } } static void qxl_reset_state(PCIQXLDevice *d) -- 1.8.5.3