Commit 5109d20a5f for qemu.org
commit 5109d20a5fee7cbcae0208cb83aa1840fdbd5a87
Author: Fabiano Rosas <farosas@suse.de>
Date: Mon Sep 14 21:01:54 2026 -0300
migration: Open code migrate_params_apply
Remove migrate_params_apply so the logic of setting migration
parameters is all in one spot.
Suggested-by: Prasad Pandit <ppandit@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
diff --git a/migration/options.c b/migration/options.c
index 0f7478aa6a..12f884caa4 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -1393,21 +1393,6 @@ bool migrate_params_check(MigrationParameters *params, Error **errp)
return true;
}
-/*
- * Caller must ensure the has_* fields of @params are true so they all
- * get copied and the pointer members don't dangle.
- */
-static void migrate_params_apply(MigrationParameters *params)
-{
- MigrationState *s = migrate_get_current();
- MigrationParameters *cur = &s->parameters;
-
- migrate_tls_opts_free(cur);
- qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping);
- qapi_free_strList(cur->cpr_exec_command);
- QAPI_CLONE_MEMBERS(MigrationParameters, cur, params);
-}
-
void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp)
{
MigrationParameters *cur = &migrate_get_current()->parameters;
@@ -1430,8 +1415,15 @@ void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp)
return;
}
- if (migrate_params_check(new, errp)) {
- migrate_params_apply(new);
- migrate_post_update_params(input, errp);
+ if (!migrate_params_check(new, errp)) {
+ return;
}
+
+ migrate_tls_opts_free(cur);
+ qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping);
+ qapi_free_strList(cur->cpr_exec_command);
+
+ QAPI_CLONE_MEMBERS(MigrationParameters, cur, new);
+
+ migrate_post_update_params(input, errp);
}