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