On a Monday in 2020, Peter Krempa wrote:
Previously qemuDomainSecretAESSetup was looking up the secret in the secret diver as well as encrypting it for use with qemu. Split out the the lookup into a wrapper for this function so that we can reuse the original internals when we don't need to look up a secret with the secret driver. The new wrapper is called qemuDomainSecretAESSetupFromSecret.
This refactor also changes the functions to return qemuDomainSecretInfoPtr
also
Please split the split from refactors.
directly rather than filling it via an argument. This rendered qemuDomainSecretInfoNew obsolete and thus it was deleted. Signed-off-by: Peter Krempa <pkre...@redhat.com> --- src/qemu/qemu_domain.c | 180 ++++++++++++++++++----------------------- src/qemu/qemu_domain.h | 2 + 2 files changed, 81 insertions(+), 101 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 10d6264e46..202b85e39a 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1035,6 +1035,8 @@ bool qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivatePtr priv); void qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr secinfo) ATTRIBUTE_NONNULL(1); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSecretInfo, qemuDomainSecretInfoFree); +
You really should not need to declare a new cleanup function when splitting code. Jano
void qemuDomainSecretInfoDestroy(qemuDomainSecretInfoPtr secinfo); void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk) -- 2.24.1
signature.asc
Description: PGP signature