diff mbox

[PATCHv3] qxl: qxl_send_events: ignore if stopped (instead of abort)

Message ID 1310478932-25370-18-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy July 12, 2011, 1:55 p.m. UTC
This can happen if there is an interface_get_command issued when
the server has been stopped. easy to trigger - do stop/cont a few
times (three seem to be enough).

The "solution" of ignoring the request is bad, but better then aborting
and a real solution would probably be in spice to not call get_command
in the first place.
---
 hw/qxl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Gerd Hoffmann July 13, 2011, 7:54 a.m. UTC | #1
Hi,

> The "solution" of ignoring the request is bad, but better then aborting
> and a real solution would probably be in spice to not call get_command
> in the first place.

Isn't the plan to fix spice-server this way?

cheers,
   Gerd
Alon Levy July 13, 2011, 9:17 a.m. UTC | #2
On Wed, Jul 13, 2011 at 09:54:55AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> >The "solution" of ignoring the request is bad, but better then aborting
> >and a real solution would probably be in spice to not call get_command
> >in the first place.
> 
> Isn't the plan to fix spice-server this way?

I can't reproduce this right now, I'll drop the patch. I do see spice-server
is fixed in red_process_commands to not call get_command on stopped, so I probably
used an unpatched server when this happened.
> 
> cheers,
>   Gerd
>
diff mbox

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index 8a9463e..0585f02 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1406,7 +1406,10 @@  static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
     uint32_t old_pending;
     uint32_t le_events = cpu_to_le32(events);
 
-    assert(d->ssd.running);
+    if (!d->ssd.running) {
+        fprintf(stderr, "qxl: not sending interrupt %d while stopped\n", events);
+        return;
+    }
     old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);
     if ((old_pending & le_events) == le_events) {
         return;