Skip to content

Fix VMSTATE_BUFFER_UNSAFE macro usage

Igor Mitsyanko qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macroinclude/migration/vmstate.h+9 -00 replies
2/3hw/sd.c: fix migration of dynamically allocated buffer "buf"hw/sd.c+1 -11 reply
3/3hw/onenand.c: fix migration of dynamically allocated buffer "otp"hw/onenand.c+2 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeter MaydellMichael Walle
SeriesR-b
1/3
2/3T-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] Fix VMSTATE_BUFFER_UNSAFE macro usage

hw/sd.c and hw/onenand.c were wrongly using VMSTATE_BUFFER_UNSAFE for dynamically allocated buffer migration, this was causing memory corruption.
Use VMSTATE_BUFFER_POINTER_UNSAFE (wich has an additional VMS_POINTER flag set) instead.

Not sure what to do with vmstate version for his devices, should I bump it? Migration was never working for them anyway.

Only tested hw/sd.c, by saving/loading a snapshot of VM while it was playing videofile from SD card.

Igor Mitsyanko (3):
vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro hw/sd.c: fix migration of dynamically allocated buffer "buf" hw/onenand.c: fix migration of dynamically allocated buffer "otp"

 hw/onenand.c                |    3 ++-
 hw/sd.c                     |    2 +-
 include/migration/vmstate.h |    9 +++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.5.4