Skip to content

qapi: Use visitors for migration parameters handling

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 Latest9 patches 18 repliesIn review
  2. v15 patches 15 repliesSuperseded

v1 from the cover letter

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9migration/options.c: Don't export migrate_tls_opts_freemigration/options.c migration/options.h+1 -21 reply
2/9migration: Use QAPI_CLONE_MEMBERS in migrate_params_test_applymigration/options.c+12 -141 reply
3/9migration: Use QAPI_CLONE_MEMBERS in migrate_params_applymigration/options.c+14 -1230 replies
4/9qapi: Implement qapi_dealloc_present_visitorinclude/qapi/dealloc-visitor.h qapi/qapi-dealloc-visitor.c+178 -13 replies
5/9qapi: Add QAPI_MERGEinclude/qapi/type-helpers.h+40 -01 reply
6/9migration/options: Use QAPI_MERGE in migrate_params_test_applymigration/options.c+10 -1350 replies
7/9migration/options: Open code migrate_params_applymigration/options.c+14 -192 replies
8/9migration/options: Stop freeing s->parameters members individuallymigration/options.c+17 -75 replies
9/9migration: Use migrate_params_free during finalizemigration/migration.c migration/options.c migration/options.h+6 -51 reply

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchPeter XuPrasad Pandit
1/9R-b
2/9R-b
3/9R-b R-b
4/9
5/9A-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

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/9] qapi: Use visitors for migration parameters handling

Hi, just a few more patches until options.c is fully using QAPI_CLONE instead of open-coding options handling, we're almost there.

In this v2:

- [NEW] patch 1/9 - Cleanup of a previous mistake.

- Properly freeing ptr members in patch 2/9 as spotted by Peter.

- Moved has_block_bitmap_mapping=true from patch 2 to patch 3.

- [NEW] patch 7/9 - Prasad's suggestion to keep the entire process of applying parameters in one place.

- [NEW] patch 8/9 - Replaced calls to qapi_free_* with qapi_dealloc_visitor.

- [NEW] patch 9/9 - Used the new migrate_params_free() for the instance finalize as well.

CI run: https://gitlab.com/farosas/qemu/-/pipelines/2301775498

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

I split this series from the original[0] because these changes are more QAPI-related and self-contained.

The idea is to use QAPI_CLONE_MEMBERS and (the new) QAPI_MERGE to reduce the amount of open-coded parameters handling in options.c, such as checks to QAPI's has_* fields and manual inclusion of future parameters.

- Patches 1 & 2 are unchanged

- Patch 3 adds a new variant of the dealloc visitor to free the to-be unreferenced memory when the input visitor eventually allocates new memory and overwrites the pointers.

- Patches 4 & 5 are mostly unchanged, but now use the new visitor.

0 - migration: Unify capabilities and parameters
https://lore.kernel.org/r/[email protected]

Fabiano Rosas (9):
migration/options.c: Don't export migrate_tls_opts_free
migration: Use QAPI_CLONE_MEMBERS in migrate_params_test_apply
migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply
qapi: Implement qapi_dealloc_present_visitor
qapi: Add QAPI_MERGE
migration/options: Use QAPI_MERGE in migrate_params_test_apply migration/options: Open code migrate_params_apply migration/options: Stop freeing s->parameters members individually
migration: Use migrate_params_free during finalize

 include/qapi/dealloc-visitor.h |   6 +
 include/qapi/type-helpers.h    |  40 +++++
 migration/migration.c          |   3 +-
 migration/options.c            | 304 ++++-----------------------------
 migration/options.h            |   2 +-
 qapi/qapi-dealloc-visitor.c    | 173 ++++++++++++++++++-
 6 files changed, 257 insertions(+), 271 deletions(-)
Signature · 1 line
2.51.0