aboutsummaryrefslogtreecommitdiff
path: root/migration/multifd.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2023-02-08 15:28:10 -0500
committerJuan Quintela <quintela@redhat.com>2023-02-11 16:51:09 +0100
commitd6f74fd12e464325f260d157c221e29480c62368 (patch)
treebe3573f347618fa392fa66e328e0b6b1c0b23fbb /migration/multifd.c
parentcc98c9fd5c17b8ab62ad91b183060d8f70b9d00d (diff)
downloadqemu-d6f74fd12e464325f260d157c221e29480c62368.zip
qemu-d6f74fd12e464325f260d157c221e29480c62368.tar.gz
qemu-d6f74fd12e464325f260d157c221e29480c62368.tar.bz2
migration: Rework multi-channel checks on URI
The whole idea of multi-channel checks was not properly done, IMHO. Currently we check multi-channel in a lot of places, but actually that's not needed because we only need to check it right after we get the URI and that should be it. If the URI check succeeded, we should never need to check it again because we must have it. If it check fails, we should fail immediately on either the qmp_migrate or qmp_migrate_incoming, instead of failingg it later after the connection established. Neither should we fail any set capabiliities like what we used to do here: 5ad15e8614 ("migration: allow enabling mutilfd for specific protocol only", 2021-10-19) Because logically the URI will only be set later after the capability is set, so it doesn't make a lot of sense to check the URI type when setting the capability, because we're checking the cap with an old URI passed in, and that may not even be the URI we're going to use later. This patch mostly reverted all such checks for before, dropping the variable migrate_allow_multi_channels and helpers. Instead, add a common helper to check URI for multi-channels for either qmp_migrate and qmp_migrate_incoming and that should do all the proper checks. The failure will only trigger with the "migrate" or "migrate_incoming" command, or when user specified "-incoming xxx" where "xxx" is not "defer". Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/multifd.c')
-rw-r--r--migration/multifd.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/migration/multifd.c b/migration/multifd.c
index 7aa030f..99a5983 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -516,7 +516,7 @@ void multifd_save_cleanup(void)
{
int i;
- if (!migrate_use_multifd() || !migrate_multi_channels_is_allowed()) {
+ if (!migrate_use_multifd()) {
return;
}
multifd_send_terminate_threads(NULL);
@@ -913,10 +913,6 @@ int multifd_save_setup(Error **errp)
if (!migrate_use_multifd()) {
return 0;
}
- if (!migrate_multi_channels_is_allowed()) {
- error_setg(errp, "multifd is not supported by current protocol");
- return -1;
- }
thread_count = migrate_multifd_channels();
multifd_send_state = g_malloc0(sizeof(*multifd_send_state));
@@ -1021,7 +1017,7 @@ int multifd_load_cleanup(Error **errp)
{
int i;
- if (!migrate_use_multifd() || !migrate_multi_channels_is_allowed()) {
+ if (!migrate_use_multifd()) {
return 0;
}
multifd_recv_terminate_threads(NULL);
@@ -1172,10 +1168,6 @@ int multifd_load_setup(Error **errp)
return 0;
}
- if (!migrate_multi_channels_is_allowed()) {
- error_setg(errp, "multifd is not supported by current protocol");
- return -1;
- }
thread_count = migrate_multifd_channels();
multifd_recv_state = g_malloc0(sizeof(*multifd_recv_state));
multifd_recv_state->params = g_new0(MultiFDRecvParams, thread_count);