tests/qtest/migration: Pass MigrateCommon into test functions
With the upcoming addition of the config QDict, the tests will need a
better way of managing the memory of the test data than putting the
test arguments on the stack of the test functions. The config QDict
will need to be merged into the arguments of migrate_qmp* functions,
which causes a refcount increment, so the test functions would need to
allocate and deref the config QDict themselves.
A better approach is to already pass the arguments into the test
functions and do the memory management in the existing wrapper. There
is already migration_test_destroy(), which is called for every test.
Do the following:
- merge the two existing wrappers, migration_test_wrapper() and
migration_test_wrapper_full(). The latter was pioneer in passing
data into the tests, but now all tests will receive data, so we
don't need it anymore.
The usage of migration_test_wrapper_full() was in passing a slightly
different test name string into the cancel tests, so still keep the
migration_test_add_suffix() function.
- add (char *name, MigrateCommon *args) to the signature of all test
functions.
- alter any code to stop allocating args on the stack and instead use
the object that came as parameter.
- pass args around as needed.
- while here, order args (MigrateCommon) before args->start
(MigrateStart) and put a blank like in between.
No functional change.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20251215220041.12657-26-farosas@suse.de
[peterx: fix a conflict with newly added mapped-ram+ignore-share test]
Signed-off-by: Peter Xu <peterx@redhat.com>