From patchwork Mon Mar 24 09:39:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 333008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4E11A14008B for ; Mon, 24 Mar 2014 22:26:27 +1100 (EST) Received: from localhost ([::1]:35316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS1M9-00059C-60 for incoming@patchwork.ozlabs.org; Mon, 24 Mar 2014 05:39:45 -0400 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 Received: from blues.com (vpn-200-87.tlv.redhat.com [10.35.200.87]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2O9d9Lb014310; Mon, 24 Mar 2014 05:39:10 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Mon, 24 Mar 2014 11:39:04 +0200 Message-Id: <1395653944-14544-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH] display/qxl: don't abort on reset with non empty rings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)