diff options
author | Juan Quintela <quintela@redhat.com> | 2023-03-02 12:17:06 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-27 16:37:28 +0200 |
commit | d5c3e1959cbabe9456bf1d5860ad718c6cd27fb8 (patch) | |
tree | f47a57d52e3413a02c9ed5a258b0099f7d1fbf66 /migration | |
parent | b1a8795654561b23eaf5bb134b61e5b23545046d (diff) | |
download | qemu-d5c3e1959cbabe9456bf1d5860ad718c6cd27fb8.zip qemu-d5c3e1959cbabe9456bf1d5860ad718c6cd27fb8.tar.gz qemu-d5c3e1959cbabe9456bf1d5860ad718c6cd27fb8.tar.bz2 |
migration: Create migrate_tls_creds() function
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
Moved the type to const char * (vladimir)
Diffstat (limited to 'migration')
-rw-r--r-- | migration/options.c | 7 | ||||
-rw-r--r-- | migration/options.h | 1 | ||||
-rw-r--r-- | migration/tls.c | 9 |
3 files changed, 12 insertions, 5 deletions
diff --git a/migration/options.c b/migration/options.c index da99c62..b5d4ebe 100644 --- a/migration/options.c +++ b/migration/options.c @@ -582,6 +582,13 @@ uint8_t migrate_throttle_trigger_threshold(void) return s->parameters.throttle_trigger_threshold; } +const 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 3948218..4603ac9 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); +const 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 acd38e0..6e70887 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -34,20 +34,19 @@ migration_tls_get_creds(MigrationState *s, Error **errp) { Object *creds; + const 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)) { |