[libvirt] [PATCH 01/20] Add a virBitmapCopy API

Eric Blake eblake at redhat.com
Tue Sep 11 21:35:45 UTC 2012


On 09/11/2012 08:11 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Add an API allowing flags from one virBitmapPtr to be copied
> into another instance.
> 
> Signed-off-by: Daniel P. Berrange <berrange at 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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120911/42f5c856/attachment-0001.sig>


More information about the libvir-list mailing list