]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
virtio-gpu: skip update cursor in post_load if we don't have one
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 10 Jul 2017 07:04:32 +0000 (09:04 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 17 Jul 2017 09:41:23 +0000 (11:41 +0200)
If the cursor resource id isn't set the guest didn't define a cursor.
Skip the cursor update in post_load in that that case.

Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: wanghaibin <wanghaibin.wang@huawei.com>
Message-id: 20170710070432.856-1-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/virtio-gpu.c

index 0506d2c1b073210620aa6fb2148ef8e202d74ee3..6aae147324e63c0531841a415746ff2db6ac6538 100644 (file)
@@ -1092,7 +1092,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
 
         dpy_gfx_replace_surface(scanout->con, scanout->ds);
         dpy_gfx_update(scanout->con, 0, 0, scanout->width, scanout->height);
-        update_cursor(g, &scanout->cursor);
+        if (scanout->cursor.resource_id) {
+            update_cursor(g, &scanout->cursor);
+        }
         res->scanout_bitmask |= (1 << i);
     }