qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: [Qemu-devel] [PATCH] display/qxl: don't abort on reset with non empty rings
Date: Mon, 24 Mar 2014 11:39:04 +0200	[thread overview]
Message-ID: <1395653944-14544-1-git-send-email-alevy@redhat.com> (raw)

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 <alevy@redhat.com>
---
 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

             reply	other threads:[~2014-03-24  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24  9:39 Alon Levy [this message]
2014-03-26 10:35 ` [Qemu-devel] [PATCH] display/qxl: don't abort on reset with non empty rings 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=1395653944-14544-1-git-send-email-alevy@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).