[Qemu-devel] [PATCH] qxl: clear guest_cursor on QXL_CURSOR_HIDE

Gerd Hoffmann posted 1 patch 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1488789111-27340-1-git-send-email-kraxel@redhat.com
Test checkpatch passed
Test docker passed
hw/display/qxl.c | 5 +++++
1 file changed, 5 insertions(+)
[Qemu-devel] [PATCH] qxl: clear guest_cursor on QXL_CURSOR_HIDE
Posted by Gerd Hoffmann 7 years, 1 month ago
Make sure we don't leave guest_cursor pointing into nowhere.  This might
lead to (rare) live migration failures, due to target trying to restore
the cursor from the stale pointer.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1421788
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/qxl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index af4c0ca..0d02f0e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -477,6 +477,11 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
             qxl->guest_cursor = ext->cmd.data;
             qemu_mutex_unlock(&qxl->track_lock);
         }
+        if (cmd->type == QXL_CURSOR_HIDE) {
+            qemu_mutex_lock(&qxl->track_lock);
+            qxl->guest_cursor = 0;
+            qemu_mutex_unlock(&qxl->track_lock);
+        }
         break;
     }
     }
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] qxl: clear guest_cursor on QXL_CURSOR_HIDE
Posted by Marc-André Lureau 7 years, 1 month ago
On Mon, Mar 6, 2017 at 12:32 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> Make sure we don't leave guest_cursor pointing into nowhere.  This might
> lead to (rare) live migration failures, due to target trying to restore
> the cursor from the stale pointer.
>
> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1421788
> Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>


Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  hw/display/qxl.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index af4c0ca..0d02f0e 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -477,6 +477,11 @@ static int qxl_track_command(PCIQXLDevice *qxl,
> struct QXLCommandExt *ext)
>              qxl->guest_cursor = ext->cmd.data;
>              qemu_mutex_unlock(&qxl->track_lock);
>          }
> +        if (cmd->type == QXL_CURSOR_HIDE) {
> +            qemu_mutex_lock(&qxl->track_lock);
> +            qxl->guest_cursor = 0;
> +            qemu_mutex_unlock(&qxl->track_lock);
> +        }
>          break;
>      }
>      }
> --
> 1.8.3.1
>
>
> --
Marc-André Lureau