[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 39/43] migration: Create migrate_tls_creds() function
From: |
Juan Quintela |
Subject: |
[PATCH v2 39/43] migration: Create migrate_tls_creds() function |
Date: |
Thu, 20 Apr 2023 15:39:58 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/options.c | 7 +++++++
migration/options.h | 1 +
migration/tls.c | 9 ++++-----
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/migration/options.c b/migration/options.c
index da70f62693..bb5e055004 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -581,6 +581,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/options.h b/migration/options.h
index 2981da21f0..acd48feabb 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -80,6 +80,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/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 v2 28/43] migration: Move migrate_use_tls() to options.c, (continued)
- [PATCH v2 28/43] migration: Move migrate_use_tls() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 29/43] migration: Move migrate_postcopy() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 31/43] migration: Move qmp_query_migrate_parameters() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 35/43] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/04/20
- [PATCH v2 36/43] migration: Move migrate_set_block_incremental() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 32/43] migration: Move qmp_migrate_set_parameters() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 37/43] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 39/43] migration: Create migrate_tls_creds() function,
Juan Quintela <=
- [PATCH v2 33/43] migration: Create migrate_params_init() function, Juan Quintela, 2023/04/20
- [PATCH v2 34/43] migration: Make all functions check have the same format, Juan Quintela, 2023/04/20
- [PATCH v2 41/43] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/04/20
- [PATCH v2 40/43] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/04/20
- [PATCH v2 38/43] migration: Remove MigrationState from block_cleanup_parameters(), Juan Quintela, 2023/04/20
- [PATCH v2 42/43] migration: Create migrate_block_bitmap_mapping() function, Juan Quintela, 2023/04/20
- [PATCH v2 43/43] migration: Move migration_properties to options.c, Juan Quintela, 2023/04/20