From c44dbb2ca444be1d655d41bcd8df8eec89784f81 Mon Sep 17 00:00:00 2001 Message-Id: From: Peter Krempa Date: Wed, 19 Feb 2020 15:09:58 +0100 Subject: [PATCH] virDomainDiskTranslateSourcePoolAuth: Take virStorageSourcePtr instead of virDomainDiskDefPtr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only 'def->src' was ever used in this function. Use the source directly. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko (cherry picked from commit 4fca8299c5d83378fc950f23bdf9fcca605a8251) https://bugzilla.redhat.com/show_bug.cgi?id=1804603 Message-Id: <66d9f9fe057c447d3b1fc5e93fce513b33242c05.1582120424.git.pkrempa@redhat.com> Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9cbc7b47e7..14b675d5d6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31222,18 +31222,18 @@ virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src, static int -virDomainDiskTranslateSourcePoolAuth(virDomainDiskDefPtr def, +virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src, virStoragePoolSourcePtr source) { /* Only necessary when authentication set */ if (!source->auth) return 0; - def->src->auth = virStorageAuthDefCopy(source->auth); - if (!def->src->auth) + src->auth = virStorageAuthDefCopy(source->auth); + if (!src->auth) return -1; /* A doesn't use src->auth->authType = VIR_STORAGE_AUTH_TYPE_NONE; + src->auth->authType = VIR_STORAGE_AUTH_TYPE_NONE; return 0; } @@ -31245,7 +31245,7 @@ virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def, def->src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK; def->src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI; - if (virDomainDiskTranslateSourcePoolAuth(def, + if (virDomainDiskTranslateSourcePoolAuth(def->src, &pooldef->source) < 0) return -1; -- 2.25.0