Re: [PATCH 01/20] Add a virBitmapCopy API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]