aboutsummaryrefslogtreecommitdiff
path: root/hw/display/virtio-gpu.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-07-10 09:04:32 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-07-17 11:41:23 +0200
commit10750ee0d67eeebbf05822b2249969ba05b5ff4b (patch)
tree17e7ac68448ec643f845ae7fc900795d47ad9794 /hw/display/virtio-gpu.c
parent6e2c46334385c7e295ac883c801c81b4925fb54f (diff)
downloadqemu-10750ee0d67eeebbf05822b2249969ba05b5ff4b.zip
qemu-10750ee0d67eeebbf05822b2249969ba05b5ff4b.tar.gz
qemu-10750ee0d67eeebbf05822b2249969ba05b5ff4b.tar.bz2
virtio-gpu: skip update cursor in post_load if we don't have one
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>
Diffstat (limited to 'hw/display/virtio-gpu.c')
-rw-r--r--hw/display/virtio-gpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 0506d2c..6aae147 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -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);
}