110 lines
4.7 KiB
Diff
110 lines
4.7 KiB
Diff
From 160863c5cac5519c287462439b9ce8abc6a8237e Mon Sep 17 00:00:00 2001
|
|
Message-Id: <160863c5cac5519c287462439b9ce8abc6a8237e@dist-git>
|
|
From: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Mon, 16 Mar 2020 22:11:48 +0100
|
|
Subject: [PATCH] Remove qemuDomainSecretInfoNew
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Replace it by a direct call to qemuDomainSecretAESSetupFromSecret.
|
|
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
(cherry picked from commit f742461389c11a7d4cc8bda941814c4128eadf94)
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
|
|
Message-Id: <c14d98c90ae9d0e9c5e4fef6a8e5061411c43a78.1584391726.git.pkrempa@redhat.com>
|
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
---
|
|
src/qemu/qemu_domain.c | 53 +++++++++++-------------------------------
|
|
1 file changed, 13 insertions(+), 40 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
index c286f50650..af23079d5d 100644
|
|
--- a/src/qemu/qemu_domain.c
|
|
+++ b/src/qemu/qemu_domain.c
|
|
@@ -1669,33 +1669,6 @@ qemuDomainSecretInfoNewPlain(virSecretUsageType usageType,
|
|
}
|
|
|
|
|
|
-/* qemuDomainSecretInfoNew:
|
|
- * @priv: pointer to domain private object
|
|
- * @srcAlias: Alias base to use for TLS object
|
|
- * @usageType: Secret usage type
|
|
- * @username: username
|
|
- * @looupDef: lookup def describing secret
|
|
- * @isLuks: boolean for luks lookup
|
|
- *
|
|
- * Helper function to create a secinfo to be used for secinfo consumers. This
|
|
- * sets up encrypted data to be used with qemu's 'secret' object.
|
|
- *
|
|
- * Returns @secinfo on success, NULL on failure. Caller is responsible
|
|
- * to eventually free @secinfo.
|
|
- */
|
|
-static qemuDomainSecretInfoPtr
|
|
-qemuDomainSecretInfoNew(qemuDomainObjPrivatePtr priv,
|
|
- const char *srcAlias,
|
|
- virSecretUsageType usageType,
|
|
- const char *username,
|
|
- virSecretLookupTypeDefPtr lookupDef,
|
|
- bool isLuks)
|
|
-{
|
|
- return qemuDomainSecretAESSetupFromSecret(priv, srcAlias, usageType, username,
|
|
- lookupDef, isLuks);
|
|
-}
|
|
-
|
|
-
|
|
/**
|
|
* qemuDomainSecretInfoTLSNew:
|
|
* @priv: pointer to domain private object
|
|
@@ -1722,9 +1695,9 @@ qemuDomainSecretInfoTLSNew(qemuDomainObjPrivatePtr priv,
|
|
}
|
|
seclookupdef.type = VIR_SECRET_LOOKUP_TYPE_UUID;
|
|
|
|
- return qemuDomainSecretInfoNew(priv, srcAlias,
|
|
- VIR_SECRET_USAGE_TYPE_TLS, NULL,
|
|
- &seclookupdef, false);
|
|
+ return qemuDomainSecretAESSetupFromSecret(priv, srcAlias,
|
|
+ VIR_SECRET_USAGE_TYPE_TLS,
|
|
+ NULL, &seclookupdef, false);
|
|
}
|
|
|
|
|
|
@@ -1814,11 +1787,11 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivatePtr priv,
|
|
src->auth->username,
|
|
&src->auth->seclookupdef);
|
|
} else {
|
|
- srcPriv->secinfo = qemuDomainSecretInfoNew(priv, authalias,
|
|
- usageType,
|
|
- src->auth->username,
|
|
- &src->auth->seclookupdef,
|
|
- false);
|
|
+ srcPriv->secinfo = qemuDomainSecretAESSetupFromSecret(priv, authalias,
|
|
+ usageType,
|
|
+ src->auth->username,
|
|
+ &src->auth->seclookupdef,
|
|
+ false);
|
|
}
|
|
|
|
if (!srcPriv->secinfo)
|
|
@@ -1826,11 +1799,11 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivatePtr priv,
|
|
}
|
|
|
|
if (hasEnc) {
|
|
- if (!(srcPriv->encinfo =
|
|
- qemuDomainSecretInfoNew(priv, encalias,
|
|
- VIR_SECRET_USAGE_TYPE_VOLUME, NULL,
|
|
- &src->encryption->secrets[0]->seclookupdef,
|
|
- true)))
|
|
+ if (!(srcPriv->encinfo = qemuDomainSecretAESSetupFromSecret(priv, encalias,
|
|
+ VIR_SECRET_USAGE_TYPE_VOLUME,
|
|
+ NULL,
|
|
+ &src->encryption->secrets[0]->seclookupdef,
|
|
+ true)))
|
|
return -1;
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|