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(-) -- 2.51.0
