public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/10] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC
@ 2026-03-17 23:23 Peter Xu
  2026-03-17 23:23 ` [PATCH RFC 01/10] vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTER Peter Xu
                   ` (9 more replies)
  0 siblings, 10 replies; 34+ messages in thread
From: Peter Xu @ 2026-03-17 23:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Mikhalitsyn, Juraj Marcin, peterx, Fabiano Rosas

This is an RFC series.  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/20260317102708.126725-1-alexander@mihalicyn.com

This is another alternative to solve this problem.

Note that I haven't had time to test anything more than the qtests/unit
tests provided.  Neither did I tested analyze-migration script, likely
that'll need some touch up when we plan to do this.  However I'm sending
this out first so to collect some early comments.

Alexander: sorry I renamed the flag once more because I just found it not
proper to call it _ALLOW_NULL if we already have that existing NULL use
case.. So I changed it to _AUTO_ALLOC.  I hope this series will also work
for your NVMe series, note that I removed two macros you introduced there
since you didn't use them (and we'd better not introduce unsed macros).  I
kept the two that your series used.

Thanks,

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

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: Limit the vmdesc_loop dedup trick to compressable field
  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    |  86 +++++++++++--
 migration/savevm.c             |  32 +++++
 migration/vmstate-types.c      |  36 +++---
 migration/vmstate.c            | 218 +++++++++++++++++++++++++--------
 tests/unit/test-vmstate.c      |  90 +++++++++++++-
 6 files changed, 380 insertions(+), 88 deletions(-)

-- 
2.50.1



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2026-03-26 21:20 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 23:23 [PATCH RFC 00/10] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC Peter Xu
2026-03-17 23:23 ` [PATCH RFC 01/10] vmstate: Pass in struct itself for VMSTATE_ARRAY_OF_POINTER Peter Xu
2026-03-18  9:36   ` Alexander Mikhalitsyn
2026-03-17 23:23 ` [PATCH RFC 02/10] vmstate: Pass in struct itself for VMSTATE_VARRAY_OF_POINTER_UINT32 Peter Xu
2026-03-18  9:37   ` Alexander Mikhalitsyn
2026-03-17 23:23 ` [PATCH RFC 03/10] vmstate: Do not set size for VMS_ARRAY_OF_POINTER Peter Xu
2026-03-18  9:37   ` Alexander Mikhalitsyn
2026-03-17 23:23 ` [PATCH RFC 04/10] vmstate: Limit the vmdesc_loop dedup trick to compressable field Peter Xu
2026-03-18  9:43   ` Alexander Mikhalitsyn
2026-03-26 19:27   ` Peter Xu
2026-03-17 23:23 ` [PATCH RFC 05/10] vmstate: Rename VMS_NULLPTR_MARKER to VMS_MARKER_PTR_NULL Peter Xu
2026-03-18  9:38   ` Alexander Mikhalitsyn
2026-03-17 23:23 ` [PATCH RFC 06/10] vmstate: Introduce vmstate_save_field_with_vmdesc() Peter Xu
2026-03-18  9:39   ` Alexander Mikhalitsyn
2026-03-19 20:36   ` Fabiano Rosas
2026-03-17 23:23 ` [PATCH RFC 07/10] vmstate: Allow vmstate_info_nullptr to emit non-NULL markers Peter Xu
2026-03-18  9:40   ` Alexander Mikhalitsyn
2026-03-19 20:46   ` Fabiano Rosas
2026-03-26 19:25     ` Peter Xu
2026-03-26 21:19       ` Fabiano Rosas
2026-03-17 23:23 ` [PATCH RFC 08/10] vmstate: Implement load of ptr marker in vmstate core Peter Xu
2026-03-18  9:48   ` Alexander Mikhalitsyn
2026-03-19 20:56   ` Fabiano Rosas
2026-03-19 21:57     ` Peter Xu
2026-03-19 22:07       ` Alexander Graf
2026-03-20 13:03       ` Fabiano Rosas
2026-03-20 14:51         ` Peter Xu
2026-03-17 23:23 ` [PATCH RFC 09/10] vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC Peter Xu
2026-03-18 10:00   ` Alexander Mikhalitsyn
2026-03-19 14:10     ` Peter Xu
2026-03-19 22:06   ` Fabiano Rosas
2026-03-20 14:42   ` Fabiano Rosas
2026-03-20 15:37     ` Peter Xu
2026-03-17 23:23 ` [PATCH RFC 10/10] tests/unit/test-vmstate: add tests for VMS_ARRAY_OF_POINTER_ALLOW_NULL Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox