render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0434-qxl-don-t-assert-on-guest-create_guest_primary.patch

Hans de Goede 56753f
From f9f547a6646d72204d88a79960191a0285774c23 Mon Sep 17 00:00:00 2001
Hans de Goede 56753f
From: Alon Levy <alevy@redhat.com>
Hans de Goede 56753f
Date: Wed, 18 Apr 2012 14:00:06 +0300
Hans de Goede 56753f
Subject: [PATCH 434/434] qxl: don't assert on guest create_guest_primary
Hans de Goede 56753f
Hans de Goede 56753f
initiate the implicit destroy ourselves.
Hans de Goede 56753f
Hans de Goede 56753f
Signed-off-by: Alon Levy <alevy@redhat.com>
Hans de Goede 56753f
---
Hans de Goede 56753f
 hw/qxl.c |   10 +++++++++-
Hans de Goede 56753f
 1 file changed, 9 insertions(+), 1 deletion(-)
Hans de Goede 56753f
Hans de Goede 56753f
diff --git a/hw/qxl.c b/hw/qxl.c
Hans de Goede 56753f
index 2135fde..29c8873 100644
Hans de Goede 56753f
--- a/hw/qxl.c
Hans de Goede 56753f
+++ b/hw/qxl.c
Hans de Goede 56753f
@@ -1123,7 +1123,15 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
Hans de Goede 56753f
     QXLDevSurfaceCreate surface;
Hans de Goede 56753f
     QXLSurfaceCreate *sc = &qxl->guest_primary.surface;
Hans de Goede 56753f
 
Hans de Goede 56753f
-    assert(qxl->mode != QXL_MODE_NATIVE);
Hans de Goede 56753f
+    if (qxl->mode == QXL_MODE_NATIVE) {
Hans de Goede 56753f
+        /*
Hans de Goede 56753f
+         * allow a create without a destroy. This could be used
Hans de Goede 56753f
+         * later for an atomic "change primary" but right now just
Hans de Goede 56753f
+         * destroy the primary for the guest. Note that this uses
Hans de Goede 56753f
+         * the ability to have multiple concurrent async commands.
Hans de Goede 56753f
+         */
Hans de Goede 56753f
+        qxl_destroy_primary(qxl, async);
Hans de Goede 56753f
+    }
Hans de Goede 56753f
     qxl_exit_vga_mode(qxl);
Hans de Goede 56753f
 
Hans de Goede 56753f
     surface.format     = le32_to_cpu(sc->format);
Hans de Goede 56753f
-- 
Hans de Goede 56753f
1.7.10
Hans de Goede 56753f