diff mbox

[Bug,1635339] Re: qxl_pre_save assertion failure on vm "save"

Message ID 20170407221741.12230.11302.malone@gac.canonical.com
State New
Headers show

Commit Message

Gerd Hoffmann April 7, 2017, 10:17 p.m. UTC
Not sure we want a failure mode for pre_save().

If we go for option (a) (from comment 9), I'd add a check when reading
the commands from the ring, not at migration time, so we don't run enter
a state where pre_save() can fail in the first place.  Because that will
break the windows drivers we might add a warning only for 2.9, then for
2.10 raise an error irq.  Something like this:
diff mbox

Patch

--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -639,6 +639,24 @@  static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
         qxl->guest_primary.commands++;
         qxl_track_command(qxl, ext);
         qxl_log_command(qxl, "cmd", ext);
+        {
+            void *msg = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
+            if (msg < (void *)qxl->vga.vram_ptr ||
+                msg > ((void *)qxl->vga.vram_ptr + qxl->vga.vram_size)) {
+#if 1
+                /* temporary, for 2.9 */
+                static int once;
+                if (!once) {
+                    fprintf(stderr, "qxl: guest bug: command not in ram bar, "
+                            "guest not migratable\n");
+                    once = true;
+                }
+#else
+                qxl_set_guest_bug(qxl, "command not in ram bar");
+                return false;
+#endif
+            }
+        }
         trace_qxl_ring_command_get(qxl->id, qxl_mode_to_string(qxl->mode));
         return true;
     default: