Displaying 2 results from an estimated 2 matches for "cleanup_virsecretfree".
2014 Oct 31
1
[PATCH] launch: libvirt: Implement drive secrets (RHBZ#1159016).
...1 file changed, 224 insertions(+), 3 deletions(-)
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 7206b33..45e215c 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -97,6 +97,25 @@ xmlBufferDetach (xmlBufferPtr buf)
}
#endif
+#ifdef HAVE_ATTRIBUTE_CLEANUP
+#define CLEANUP_VIRSECRETFREE __attribute__((cleanup(cleanup_virSecretFree)))
+
+static void
+cleanup_virSecretFree (void *ptr)
+{
+ virSecretFree (* (virSecretPtr *) ptr);
+}
+
+#else /* !HAVE_ATTRIBUTE_CLEANUP */
+#define CLEANUP_VIRSECRETFREE
+#endif
+
+/* Use to store a mapping of secret to libvirt secret UUID. */
+struct...
2014 Oct 31
1
[PATCH v2] launch: libvirt: Implement drive secrets (RHBZ#1159016).
Since v1:
- Base64 decode the Ceph secret before passing it to libvirt.
- Don't call virSecretFree (NULL) [libvirt bug?]
- Small cleanups.