Patchwork spice: (32 bit only) fix surface cmd tracking destruction

login
register
mail settings
Submitter Alon Levy
Date March 13, 2013, 3:58 p.m.
Message ID <1363190315-23956-1-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/227306/
State New
Headers show

Comments

Alon Levy - March 13, 2013, 3:58 p.m.
No change for 64 bit arches, but for 32 bit previously we zeroed half
the surfaces cmd array, instead of all of it.

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Hans de Goede - March 13, 2013, 4:16 p.m.
Looks good,

Acked-by: Hans de Goede <hdegoede@redhat.com>

On 03/13/2013 04:58 PM, Alon Levy wrote:
> No change for 64 bit arches, but for 32 bit previously we zeroed half
> the surfaces cmd array, instead of all of it.
>
> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>   hw/qxl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/qxl.c b/hw/qxl.c
> index ef69348..4cbab45 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -226,7 +226,7 @@ static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl)
>       trace_qxl_spice_destroy_surfaces_complete(qxl->id);
>       qemu_mutex_lock(&qxl->track_lock);
>       memset(qxl->guest_surfaces.cmds, 0,
> -           sizeof(qxl->guest_surfaces.cmds) * qxl->ssd.num_surfaces);
> +           sizeof(qxl->guest_surfaces.cmds[0]) * qxl->ssd.num_surfaces);
>       qxl->guest_surfaces.count = 0;
>       qemu_mutex_unlock(&qxl->track_lock);
>   }
>
Gerd Hoffmann - April 4, 2013, 8:21 a.m.
On 03/13/13 16:58, Alon Levy wrote:
> No change for 64 bit arches, but for 32 bit previously we zeroed half
> the surfaces cmd array, instead of all of it.

Patch added to spice patch queue.

thanks,
  Gerd

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index ef69348..4cbab45 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -226,7 +226,7 @@  static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl)
     trace_qxl_spice_destroy_surfaces_complete(qxl->id);
     qemu_mutex_lock(&qxl->track_lock);
     memset(qxl->guest_surfaces.cmds, 0,
-           sizeof(qxl->guest_surfaces.cmds) * qxl->ssd.num_surfaces);
+           sizeof(qxl->guest_surfaces.cmds[0]) * qxl->ssd.num_surfaces);
     qxl->guest_surfaces.count = 0;
     qemu_mutex_unlock(&qxl->track_lock);
 }