carlwgeorge / rpms / qemu

Forked from rpms/qemu a year ago
Clone
Blob Blame History Raw
From f9f547a6646d72204d88a79960191a0285774c23 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 18 Apr 2012 14:00:06 +0300
Subject: [PATCH 434/434] qxl: don't assert on guest create_guest_primary

initiate the implicit destroy ourselves.

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/qxl.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 2135fde..29c8873 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1123,7 +1123,15 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
     QXLDevSurfaceCreate surface;
     QXLSurfaceCreate *sc = &qxl->guest_primary.surface;
 
-    assert(qxl->mode != QXL_MODE_NATIVE);
+    if (qxl->mode == QXL_MODE_NATIVE) {
+        /*
+         * allow a create without a destroy. This could be used
+         * later for an atomic "change primary" but right now just
+         * destroy the primary for the guest. Note that this uses
+         * the ability to have multiple concurrent async commands.
+         */
+        qxl_destroy_primary(qxl, async);
+    }
     qxl_exit_vga_mode(qxl);
 
     surface.format     = le32_to_cpu(sc->format);
-- 
1.7.10