Skip to content

migration: Remove extra type-checking from vmstate macros

Fabiano Rosas qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 2 repliesIn review
  2. v14 patches 22 repliesSuperseded

Changes in v2 from the cover letter

- Removed more unused vmstate macros
- Fixed the type check macro
- Renamed the new structure to something more explicit
- Added a new flag to indicate an empty vmstate
- Added the overflow and overallocation checks

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8migration: Remove unused vmstate macrosinclude/migration/vmstate.h+0 -450 replies
2/8migration: Introduce VMStateStructMemberinclude/migration/vmstate.h migration/savevm.c migration/vmstate.c +3 more+197 -801 reply
3/8migration: Remove redundant flagsinclude/migration/vmstate.h migration/savevm.c migration/vmstate.c +3 more+37 -630 replies
4/8migration: Remove duplicate vmstate macrosinclude/migration/vmstate.h+44 -910 replies
5/8migration: Add VMS_NO_STATE flaghw/pci/msix.c hw/scsi/scsi-bus.c include/migration/vmstate.h +3 more+16 -150 replies
6/8migration: Check more vmstate flagsmigration/savevm.c+19 -00 replies
7/8migration: Harden vmstate_handle_allocmigration/vmstate.c+22 -80 replies
8/8migration: Harden vmstate_sizemigration/vmstate.c+22 -60 replies

Reviews trailers per patch

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

PatchPeter Xu
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

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

Read the v2 thread

Cover letter [PATCH v2 0/8] migration: Remove extra type-checking from vmstate macros

Changes in v2:

- Removed more unused vmstate macros
- Fixed the type check macro
- Renamed the new structure to something more explicit
- Added a new flag to indicate an empty vmstate
- Added the overflow and overallocation checks

CI run: https://gitlab.com/farosas/qemu/-/pipelines/2769617319
Also tested:
- migration-test --full --thorough
- x86_64 compat run forward and backwards for previous 3 QEMU releases
- s390x compat run forward and backwards for previous 2 QEMU releases
- ppc64 compat run forward and backwards for previous QEMU release
- migration-test smoke ASAN/UBSAN run

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

Hi, this is basically what I ranted about in:
https://lore.kernel.org/r/[email protected]

I'm replacing the per-integer-size type checks with a single "int that fits in 32bit" check. This allows several lines of duplicated code to be removed.

I haven't changed the macro names in the device code yet. If this series gets positive feedback then I'll send per-subsystem patches doing that.

CI run: https://gitlab.com/farosas/qemu/-/pipelines/2716814081
Also tested:
- migration-test --full --thorough
- x86_64 compat run forwards and backwards for previous 3 QEMU releases
- s390x compat run forwards and backwards for previous 2 QEMU releases
- ppc64 compat run forwards and backwards for previous QEMU release
- migration-test smoke ASAN/UBSAN run

Fabiano Rosas (8):
migration: Remove unused vmstate macros
migration: Introduce VMStateStructMember
migration: Remove redundant flags
migration: Remove duplicate vmstate macros
migration: Add VMS_NO_STATE flag
migration: Check more vmstate flags
migration: Harden vmstate_handle_alloc
migration: Harden vmstate_size

 hw/pci/msix.c                      |   6 +-
 hw/scsi/scsi-bus.c                 |   6 +-
 include/migration/vmstate.h        | 388 +++++++++++++----------------
 migration/savevm.c                 |  29 ++-
 migration/vmstate.c                | 103 +++++---
 rust/bindings/migration-sys/lib.rs |  17 +-
 rust/migration/src/vmstate.rs      |  32 ++-
 rust/tests/tests/vmstate_tests.rs  |  32 +--
 8 files changed, 331 insertions(+), 282 deletions(-)
Signature · 1 line
2.53.0