qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] hw/qxl: inject interrupts in any state
Date: Thu, 1 Nov 2012 08:44:02 -0400 (EDT)	[thread overview]
Message-ID: <2016872320.25352175.1351773842819.JavaMail.root@redhat.com> (raw)
In-Reply-To: <50926BEF.3000709@redhat.com>

> On 11/01/12 12:48, Alon Levy wrote:
> > +    if (!qemu_spice_display_is_running(&d->ssd)) {
> > +        fprintf(stderr, "%s: guest stopped, ignoring\n",
> > __func__);
> > +        trace_qxl_send_events_vm_stopped(d->id, events);
> > +        return;
> > +    }
> 
> Almost perfect.  We should add a note here that this happening is a
> spice server bug, at least as source code comment, maybe also in the
> fprintf.
> 
> cheers,
>   Gerd
> 


commit 49072da137e3d2d86449082e152b0717e5e94672
Author: Alon Levy <alevy@redhat.com>
Date:   Tue Oct 30 18:00:33 2012 +0200

    hw/qxl: qxl_send_events: nop if stopped
    
    Added a trace point for easy logging.
    
    RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972
    
    Signed-off-by: Alon Levy <alevy@redhat.com>

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"

  reply	other threads:[~2012-11-01 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 12:53 [Qemu-devel] [RFC] hw/qxl: inject interrupts in any state Alon Levy
2012-11-01  9:19 ` Gerd Hoffmann
2012-11-01  9:45   ` Alon Levy
2012-11-01  9:55     ` Gerd Hoffmann
2012-11-01 10:22       ` Alon Levy
2012-11-01 10:33         ` Gerd Hoffmann
2012-11-01 11:48           ` Alon Levy
2012-11-01 12:32             ` Gerd Hoffmann
2012-11-01 12:44               ` Alon Levy [this message]
2012-11-01 12:47                 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2016872320.25352175.1351773842819.JavaMail.root@redhat.com \
    --to=alevy@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).