From patchwork Thu Nov 1 12:56:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 196188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ACD8F2C0339 for ; Thu, 1 Nov 2012 23:56:15 +1100 (EST) Received: from localhost ([::1]:47870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTuJh-0001mu-VH for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 08:56:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTuJa-0001mb-W4 for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:56:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTuJY-0003xw-Hz for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:56:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTuJY-0003xl-9C for qemu-devel@nongnu.org; Thu, 01 Nov 2012 08:56:04 -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 qA1Cu2Nx002416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Nov 2012 08:56:02 -0400 Received: from garlic.tlv.redhat.com (spice-ovirt.tlv.redhat.com [10.35.4.71]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qA1Cu16W025170; Thu, 1 Nov 2012 08:56:02 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Thu, 1 Nov 2012 14:56:00 +0200 Message-Id: <1351774560-20800-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] hw/qxl: qxl_send_events: nop if stopped 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 Added a trace point for easy logging. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972 Signed-off-by: Alon Levy --- hw/qxl.c | 8 +++++++- trace-events | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/qxl.c b/hw/qxl.c index 7b88a1e..c33dd03 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1739,7 +1739,13 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) uint32_t le_events = cpu_to_le32(events); trace_qxl_send_events(d->id, events); - assert(qemu_spice_display_is_running(&d->ssd)); + if (!qemu_spice_display_is_running(&d->ssd)) { + /* spice-server tracks guest running state and should not do this */ + fprintf(stderr, "%s: spice-server bug: guest stopped, ignoring\n", + __func__); + trace_qxl_send_events_vm_stopped(d->id, events); + return; + } old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events); if ((old_pending & le_events) == le_events) { return; diff --git a/trace-events b/trace-events index 7ee21e5..d308533 100644 --- a/trace-events +++ b/trace-events @@ -994,6 +994,7 @@ qxl_spice_update_area(int qid, uint32_t surface_id, uint32_t left, uint32_t righ qxl_spice_update_area_rest(int qid, uint32_t num_dirty_rects, uint32_t clear_dirty_region) "%d #d=%d clear=%d" qxl_surfaces_dirty(int qid, int surface, int offset, int size) "%d surface=%d offset=%d size=%d" qxl_send_events(int qid, uint32_t events) "%d %d" +qxl_send_events_vm_stopped(int qid, uint32_t events) "%d %d" qxl_set_guest_bug(int qid) "%d" qxl_interrupt_client_monitors_config(int qid, int num_heads, void *heads) "%d %d %p" qxl_client_monitors_config_unsupported_by_guest(int qid, uint32_t int_mask, void *client_monitors_config) "%d %X %p"