Hi, this contains the pending work from my previous two series to
reduce duplication in the migration parameters handling and unify
migration parameters and capabilities.

Supersedes these series:
- [PATCH v3 00/51] migration: Unify capabilities and parameters
https://lore.kernel.org/r/[email protected]

- [PATCH v2 0/9] qapi: Use visitors for migration parameters handling
https://lore.kernel.org/r/[email protected]

I held on to the "pass full config to migration commands" changes for
now, let's put this^ scaffolding in first.

Changes from previous versions:

1) hacky qapi dealloc visitor replaced with a simple merge using
QDict.

  Suggested as one of the alternatives by Markus in:
  https://lore.kernel.org/r/[email protected]

This^ made me realise we've been doing manual checking in a lot of
places where a QAPI->QDict serialization would do the work
automatically, so:

2) New qtest to validate migration HMP commands.

  Good to have in general, but also this series touches that code
  heavily.

3) Rewrite of hmp_migrate_set_parameters, hmp_info_migrate_parameters
and hmp_migrate_set_parameter_completion.

  I want to remove all manual handling of migration parameters. These
  commands were the last heavy users of the "if params->has_foo,
  handle params->foo" pattern. We lose some user-friendliness here,
  but hopefully it's ok.

4) Remove MigrationParameter (singular).

  With this, migration.json now has only one place to define and
  document migration parameters, the MigrationParameters (plural).

5) New routine to validate has_* fields.

  Due to the above change, we lose MIGRATION_PARAMETER__MAX. Add a
  routine that ensures s->parameters has all has_ fields set to
  true. This is required for all the QAPI cloning and merging, etc.

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

Fabiano Rosas (18):
  checkpatch: Fix checking of newlines in error messages
  migration/options.c: Don't export migrate_tls_opts_free
  migration: Rename variables in qmp_migrate_set_parameters
  migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply
  migration: Merge parameter structs instead of assigning one by one
  migration: Open code migrate_params_apply
  migration: Stop freeing s->parameters members individually
  migration: Use migrate_params_free during finalize
  tests/qtest/migration: Add a test for HMP
  migration: Validate that all params are set for query
  migration: Use keyval input visitor in HMP set command
  migration: Change HMP 'info migrate_parameters' output
  migration: Use output visitor in info command
  migration: Rewrite migrate_set_parameter_completion using QDict
  qapi/migration: Remove MigrationParameter
  migration: Add capabilities into MigrationParameters
  migration: Remove s->capabilities
  qapi/migration: Deprecate capabilities commands

 docs/about/deprecated.rst          |  13 +
 migration/migration-hmp-cmds.c     | 465 ++++++----------
 migration/migration.c              |  17 +-
 migration/migration.h              |   2 +-
 migration/options.c                | 848 ++++++++++++++---------------
 migration/options.h                |  26 +-
 migration/savevm.c                 |   8 +-
 qapi/migration.json                | 170 ++++--
 scripts/checkpatch.pl              |  11 +-
 tests/qemu-iotests/300             |  20 +-
 tests/qtest/migration/misc-tests.c | 460 ++++++++++++++++
 11 files changed, 1218 insertions(+), 822 deletions(-)

-- 
2.53.0


Reply via email to