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