Skip to content

Commit

Permalink
migration: Create migrate_tls_hostname() function
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

---

Moved the type to const char * (vladimir)
  • Loading branch information
Juan Quintela committed Apr 27, 2023
1 parent 2eb0308 commit 1f2f366
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions migration/options.c
Expand Up @@ -596,6 +596,13 @@ const char *migrate_tls_creds(void)
return s->parameters.tls_creds;
}

const char *migrate_tls_hostname(void)
{
MigrationState *s = migrate_get_current();

return s->parameters.tls_hostname;
}

uint64_t migrate_xbzrle_cache_size(void)
{
MigrationState *s = migrate_get_current();
Expand Down
1 change: 1 addition & 0 deletions migration/options.h
Expand Up @@ -82,6 +82,7 @@ int migrate_multifd_zstd_level(void);
uint8_t migrate_throttle_trigger_threshold(void);
const char *migrate_tls_authz(void);
const char *migrate_tls_creds(void);
const char *migrate_tls_hostname(void);
uint64_t migrate_xbzrle_cache_size(void);

/* parameters setters */
Expand Down
5 changes: 3 additions & 2 deletions migration/tls.c
Expand Up @@ -130,8 +130,9 @@ QIOChannelTLS *migration_tls_client_create(MigrationState *s,
return NULL;
}

if (s->parameters.tls_hostname && *s->parameters.tls_hostname) {
hostname = s->parameters.tls_hostname;
const char *tls_hostname = migrate_tls_hostname();
if (tls_hostname && *tls_hostname) {
hostname = tls_hostname;
}

return qio_channel_tls_new_client(ioc, creds, hostname, errp);
Expand Down

0 comments on commit 1f2f366

Please sign in to comment.