On 09/11/2012 08:11 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Add an API allowing flags from one virBitmapPtr to be copied
into another instance.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/bitmap.c | 19 +++++++++++++++++++
src/util/bitmap.h | 6 ++++++
3 files changed, 26 insertions(+)
This conflicts with a patch proposed by Hu Tao
(
https://www.redhat.com/archives/libvir-list/2012-September/msg00317.html).
+
+int virBitmapCopy(virBitmapPtr dst, virBitmapPtr src)
This requires you to pre-create the copy, so a better name might be
virBitmapCopyInto(), and then rebase Hu's patch, so that his function
signature:
+/**
+ * virBitmapCopy:
+ * @src: the source bitmap.
+ *
+ * Makes a copy of bitmap @src.
+ *
+ * returns the copied bitmap on success, or NULL otherwise. Caller
+ * should call virBitmapFree to free the returned bitmap.
+ */
+virBitmapPtr virBitmapCopy(virBitmapPtr src)
would then call into your virBitmapCopyInto for fewer lines of
implementation.
That is, I like Hu's semantics better of creating the copy, but I still
think your function is useful, if given the correct name.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org