[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 39/43] migration: Create migrate_tls_creds() function
From: |
Juan Quintela |
Subject: |
[PATCH 39/43] migration: Create migrate_tls_creds() function |
Date: |
Thu, 2 Mar 2023 17:34:06 +0100 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/options.h | 1 +
migration/options.c | 7 +++++++
migration/tls.c | 9 ++++-----
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/migration/options.h b/migration/options.h
index 1d63c4069c..78cb936aba 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -82,6 +82,7 @@ MultiFDCompression migrate_multifd_compression(void);
int migrate_multifd_zlib_level(void);
int migrate_multifd_zstd_level(void);
uint8_t migrate_throttle_trigger_threshold(void);
+char *migrate_tls_creds(void);
uint64_t migrate_xbzrle_cache_size(void);
/* parameters setters */
diff --git a/migration/options.c b/migration/options.c
index 79187c3be0..41bb2d2959 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -583,6 +583,13 @@ uint8_t migrate_throttle_trigger_threshold(void)
return s->parameters.throttle_trigger_threshold;
}
+char *migrate_tls_creds(void)
+{
+ MigrationState *s = migrate_get_current();
+
+ return s->parameters.tls_creds;
+}
+
uint64_t migrate_xbzrle_cache_size(void)
{
MigrationState *s = migrate_get_current();
diff --git a/migration/tls.c b/migration/tls.c
index acd38e0b62..0d318516de 100644
--- a/migration/tls.c
+++ b/migration/tls.c
@@ -34,20 +34,19 @@ migration_tls_get_creds(MigrationState *s,
Error **errp)
{
Object *creds;
+ char *tls_creds = migrate_tls_creds();
QCryptoTLSCreds *ret;
- creds = object_resolve_path_component(
- object_get_objects_root(), s->parameters.tls_creds);
+ creds = object_resolve_path_component(object_get_objects_root(),
tls_creds);
if (!creds) {
- error_setg(errp, "No TLS credentials with id '%s'",
- s->parameters.tls_creds);
+ error_setg(errp, "No TLS credentials with id '%s'", tls_creds);
return NULL;
}
ret = (QCryptoTLSCreds *)object_dynamic_cast(
creds, TYPE_QCRYPTO_TLS_CREDS);
if (!ret) {
error_setg(errp, "Object with id '%s' is not TLS credentials",
- s->parameters.tls_creds);
+ tls_creds);
return NULL;
}
if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) {
--
2.39.2
- [PATCH 31/43] migration: Move qmp_query_migrate_parameters() to options.c, (continued)
- [PATCH 31/43] migration: Move qmp_query_migrate_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 27/43] migration: Create migrate_cpu_throttle_tailslow() function, Juan Quintela, 2023/03/02
- [PATCH 30/43] migration: Create migrate_max_bandwidth() function, Juan Quintela, 2023/03/02
- [PATCH 32/43] migration: Move qmp_migrate_set_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 35/43] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/03/02
- [PATCH 37/43] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 28/43] migration: Move migrate_use_tls() to options.c, Juan Quintela, 2023/03/02
- [PATCH 33/43] migration: Create migrate_params_init() function, Juan Quintela, 2023/03/02
- [PATCH 40/43] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/03/02
- [PATCH 42/43] migration: Create migrate_block_bitmap_mapping() function, Juan Quintela, 2023/03/02
- [PATCH 39/43] migration: Create migrate_tls_creds() function,
Juan Quintela <=
- [PATCH 41/43] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/03/02
- [PATCH 38/43] migration: Remove MigrationState from block_cleanup_parameters(), Juan Quintela, 2023/03/02
- [PATCH 43/43] migration: Move migration_properties to options.c, Juan Quintela, 2023/03/02
- [PATCH 36/43] migration: Move migrate_set_block_incremental() to options.c, Juan Quintela, 2023/03/02
- Re: [PATCH 00/43] Migration: Create options.c for capabilities/params/properties, Vladimir Sementsov-Ogievskiy, 2023/03/06