aboutsummaryrefslogtreecommitdiff
path: root/migration/channel.c
diff options
context:
space:
mode:
authorLeonardo Bras <leobras@redhat.com>2022-05-13 03:28:34 -0300
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-05-16 13:56:24 +0100
commitd2fafb6a6814a8998607d0baf691265032996a0f (patch)
tree10893a5d8602eba5c8bcab76209ca2b0fe2de740 /migration/channel.c
parentabb6295b3ace5d17c3a65936913fc346616dbf14 (diff)
migration: Add migrate_use_tls() helper
A lot of places check parameters.tls_creds in order to evaluate if TLS is in use, and sometimes call migrate_get_current() just for that test. Add new helper function migrate_use_tls() in order to simplify testing for TLS usage. Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220513062836.965425-6-leobras@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/channel.c')
-rw-r--r--migration/channel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/migration/channel.c b/migration/channel.c
index c6a8dcf1d7..a162d00fea 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -38,8 +38,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)
trace_migration_set_incoming_channel(
ioc, object_get_typename(OBJECT(ioc)));
- if (s->parameters.tls_creds &&
- *s->parameters.tls_creds &&
+ if (migrate_use_tls() &&
!object_dynamic_cast(OBJECT(ioc),
TYPE_QIO_CHANNEL_TLS)) {
migration_tls_channel_process_incoming(s, ioc, &local_err);