[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/13] migration: Create migrate_tls_creds() function
From: |
Juan Quintela |
Subject: |
[PATCH v3 09/13] migration: Create migrate_tls_creds() function |
Date: |
Mon, 24 Apr 2023 20:32:32 +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 f65b7babef..9eabb4c25d 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -579,6 +579,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 3948218dbe..47cc24585b 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
- Re: [PATCH v3 08/13] migration: Remove MigrationState from block_cleanup_parameters(), (continued)
- [PATCH v3 05/13] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/04/24
- [PATCH v3 11/13] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/04/24
- [PATCH v3 10/13] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/04/24
- [PATCH v3 12/13] migration: Create migrate_block_bitmap_mapping() function, Juan Quintela, 2023/04/24
- [PATCH v3 09/13] migration: Create migrate_tls_creds() function,
Juan Quintela <=
- [PATCH v3 07/13] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/04/24
- [PATCH v3 13/13] migration: Move migration_properties to options.c, Juan Quintela, 2023/04/24