Skip to content

vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC

Peter Xu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTERinclude/migration/vmstate.h roms/seabios-hppa tests/unit/test-vmstate.c+5 -52 replies
2/11vmstate: Pass in struct itself for VMSTATE_VARRAY_OF_POINTER_UINT32include/hw/intc/riscv_aclint.h include/migration/vmstate.h+5 -50 replies
3/11vmstate: Do not set size for VMS_ARRAY_OF_POINTERinclude/migration/vmstate.h migration/savevm.c migration/vmstate.c+28 -50 replies
4/11vmstate: Update max_elems early and check field compressable oncemigration/vmstate.c+5 -30 replies
5/11vmstate: Rename VMS_NULLPTR_MARKER to VMS_MARKER_PTR_NULLinclude/migration/vmstate.h migration/vmstate-types.c tests/unit/test-vmstate.c+4 -40 replies
6/11vmstate: Introduce vmstate_save_field_with_vmdesc()migration/vmstate.c+32 -130 replies
7/11vmstate: Allow vmstate_info_nullptr to emit non-NULL markersinclude/migration/vmstate.h migration/vmstate-types.c migration/vmstate.c +1 more+48 -420 replies
8/11vmstate: Implement load of ptr marker in vmstate coremigration/vmstate-types.c migration/vmstate.c+32 -260 replies
9/11vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOCinclude/migration/vmstate.h migration/savevm.c migration/vmstate.c+199 -240 replies
10/11vmstate: Stop checking size for nullptr compressionmigration/vmstate.c+3 -30 replies
11/11tests/unit/test-vmstate: add tests for VMS_ARRAY_OF_POINTER_AUTO_ALLOCtests/unit/test-vmstate.c+86 -00 replies

Reviews trailers per patch

10 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexander MikhalitsynFabiano RosasPhilippe Mathieu-DaudéJuraj Marcin
SeriesR-b
1/11R-b R-b R-b
2/11R-b R-b R-b
3/11R-b R-b R-b
4/11R-b R-b
5/11R-b R-b R-b
6/11R-b R-b
7/11R-b R-b
8/11R-b R-b
9/11R-b T-b
10/11R-b
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/11] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC

CI: https://gitlab.com/peterx/qemu/-/pipelines/2424266591
(one checkpatch warning, not relevant to this series)

rfcv1: https://lore.kernel.org/r/[email protected]
rfcv2: https://lore.kernel.org/r/[email protected]

Changelog rfcv2->v1:

- Rebased to latest fabiano's migration-staging branch (bd698d7730)
- Collected new tags
- Patch 1
- Add space between "_type*" [Phil]
- Patch 9
- Slight refactoring on vmstate_load_next() [Fabiano]
- I collected Alexander's tested-by even if strictly I shouldn't when the patch changed; if test fails, it's me to blame.

This is v1, I removed RFC as I we should have reached some form of consensus in general. It is based on Fabiano's migration-staging branch. I've pushed this tree here for easier reference:

https://gitlab.com/peterx/qemu/-/tree/vmstate-array-null

This series implements a new vmstate flag that allows real dynamic array of pointers to be migrated, so that QEMU vmstate core will be able to identify NULL and non-NULL pointers pointing to any kind of VMSD (or base types), then properly allocate memory for them on dest QEMU.

The first planned user of such is Alexander's NVMe migration series here:

https://lore.kernel.org/r/[email protected]

This is another alternative to solve this problem.

I tested analyze-migration.py with this version and it works with an idle dump from the nvme series (after I rebase).

Thanks,

Alexander Mikhalitsyn (1):
tests/unit/test-vmstate: add tests for VMS_ARRAY_OF_POINTER_AUTO_ALLOC

Fabiano Rosas (1):
vmstate: Stop checking size for nullptr compression

Peter Xu (9):
vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTER
vmstate: Pass in struct itself for VMSTATE_VARRAY_OF_POINTER_UINT32
vmstate: Do not set size for VMS_ARRAY_OF_POINTER
vmstate: Update max_elems early and check field compressable once
vmstate: Rename VMS_NULLPTR_MARKER to VMS_MARKER_PTR_NULL
vmstate: Introduce vmstate_save_field_with_vmdesc()
vmstate: Allow vmstate_info_nullptr to emit non-NULL markers
vmstate: Implement load of ptr marker in vmstate core
vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC

 include/hw/intc/riscv_aclint.h |   6 +-
 include/migration/vmstate.h    |  88 ++++++++++--
 migration/savevm.c             |  28 ++++
 migration/vmstate-types.c      |  36 ++---
 migration/vmstate.c            | 247 ++++++++++++++++++++++++++-------
 tests/unit/test-vmstate.c      |  90 +++++++++++-
 roms/seabios-hppa              |   2 +-
 scripts/analyze-migration.py   |  22 +--
 8 files changed, 418 insertions(+), 101 deletions(-)
Signature · 1 line
2.50.1