[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/11] qxl: fix guest cursor tracking
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 09/11] qxl: fix guest cursor tracking |
Date: |
Tue, 25 Oct 2011 14:25:48 +0200 |
From: Yonit Halperin <address@hidden>
(1) If the guest cursor command is empty, don't reload it after migration.
(2) Cleaning the guest cursor when it is released by
the spice server. In addition, explicitly reset the
cursor in spice upon destroying the primary surface
(was done by spice-server implicitly). This will prevent
access to pci memory that was released.
RHBZ: 744518
Signed-off-by: Yonit Halperin <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/qxl.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 2ca1b04..3a3b3a4 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -236,6 +236,9 @@ void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
void qxl_spice_reset_cursor(PCIQXLDevice *qxl)
{
qxl->ssd.worker->reset_cursor(qxl->ssd.worker);
+ qemu_mutex_lock(&qxl->track_lock);
+ qxl->guest_cursor = 0;
+ qemu_mutex_unlock(&qxl->track_lock);
}
@@ -400,7 +403,9 @@ static void qxl_track_command(PCIQXLDevice *qxl, struct
QXLCommandExt *ext)
{
QXLCursorCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
if (cmd->type == QXL_CURSOR_SET) {
+ qemu_mutex_lock(&qxl->track_lock);
qxl->guest_cursor = ext->cmd.data;
+ qemu_mutex_unlock(&qxl->track_lock);
}
break;
}
@@ -1065,6 +1070,7 @@ static int qxl_destroy_primary(PCIQXLDevice *d,
qxl_async_io async)
d->mode = QXL_MODE_UNDEFINED;
qemu_spice_destroy_primary_surface(&d->ssd, 0, async);
+ qxl_spice_reset_cursor(d);
return 1;
}
@@ -1704,10 +1710,12 @@ static int qxl_post_load(void *opaque, int version)
cmds[out].group_id = MEMSLOT_GROUP_GUEST;
out++;
}
- cmds[out].cmd.data = d->guest_cursor;
- cmds[out].cmd.type = QXL_CMD_CURSOR;
- cmds[out].group_id = MEMSLOT_GROUP_GUEST;
- out++;
+ if (d->guest_cursor) {
+ cmds[out].cmd.data = d->guest_cursor;
+ cmds[out].cmd.type = QXL_CMD_CURSOR;
+ cmds[out].group_id = MEMSLOT_GROUP_GUEST;
+ out++;
+ }
qxl_spice_loadvm_commands(d, cmds, out);
g_free(cmds);
--
1.7.1
- [Qemu-devel] [PULL] spice patch queue, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 04/11] spice: Convert core to QEMU thread API, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 07/11] ui/spice-core: fix segfault in monitor, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 03/11] spice: support the new migration interface (spice 0.8.3), Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 08/11] qxl: factor out properties, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 01/11] migration: add status query functions, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 05/11] qxl: Convert to QEMU thread API, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 06/11] qxl: Drop phread_yield on OOM, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 11/11] spice: fix file handle cleanup, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 10/11] qxl: reset update_surface, Gerd Hoffmann, 2011/10/25
- [Qemu-devel] [PATCH 09/11] qxl: fix guest cursor tracking,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 02/11] spice: turn client_migrate_info to async, Gerd Hoffmann, 2011/10/25
- Re: [Qemu-devel] [PULL] spice patch queue, Anthony Liguori, 2011/10/31