Skip to contentSkip to conversation

display/qxl: don't abort on reset with non empty rings

PATCH In review Alon Levy 2 participants 2 messages Mar 24, 2014 – Mar 26, 2014

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/1 display/qxl: don't abort on reset with non empty rings

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.

---
 hw/display/qxl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
hw/display/qxl.c +6 -2
index 47bbf1f..abe7a18 100644
@@ -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)
Signature · 1 line
1.8.5.3
#1 lore raw
Quoted 4 lines · Alon Levy

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.

I think we should either use the qxl_guest_bug trace point if we want report this for troubleshooting reasons. Or simply drop qxl_check_state altogether ...

cheers,
Gerd