Skip to contentSkip to conversation

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

PATCH In review Alon Levy 3 participants 3 messages Mar 13, 2013 – Apr 4, 2013

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/1 spice: (32 bit only) fix surface cmd tracking destruction

No change for 64 bit arches, but for 32 bit previously we zeroed half the surfaces cmd array, instead of all of it.

---
 hw/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/qxl.c +1 -1
index ef69348..4cbab45 100644
@@ -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);
 }
Signature · 1 line
1.8.1.4
Acked-by on v1 1/1
#1 lore raw

Looks good,

Quoted 22 lines · Alon Levy

No change for 64 bit arches, but for 32 bit previously we zeroed half the surfaces cmd array, instead of all of it.

---
  hw/qxl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/qxl.c +1 -1
index ef69348..4cbab45 100644
@@ -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);
  }
#2 lore raw
In reply to Alon Levy
Quoted 2 lines · Alon Levy

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