[libvirt] [PATCH 3/6] util: bitmap: Add comments for functions which don't have them

Peter Krempa pkrempa at redhat.com
Mon Feb 5 13:17:44 UTC 2018


virBitmap code is thoroughly documented. Add docs for the few functions
missing them.
---
 src/util/virbitmap.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 4229aa286e..0973731e3a 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -146,6 +146,14 @@ virBitmapFree(virBitmapPtr bitmap)
 }


+/**
+ * virBitmapCopy:
+ * @dst: destination bitmap
+ * @src: source bitmap
+ *
+ * Copies contents of @src to @dst. @dst must have the same size as @src.
+ * Returns -1 if the size is not the same or 0 on success.
+ */
 int
 virBitmapCopy(virBitmapPtr dst,
               virBitmapPtr src)
@@ -882,6 +890,12 @@ virBitmapEqual(virBitmapPtr b1,
 }


+/**
+ * virBitmapSize:
+ * @bitmap: virBitmap to inspect
+ *
+ * Returns number of bits @bitmap can store.
+ */
 size_t
 virBitmapSize(virBitmapPtr bitmap)
 {
@@ -1116,7 +1130,12 @@ virBitmapNextClearBit(virBitmapPtr bitmap,
 }


-/* Return the number of bits currently set in the map.  */
+/**
+ * virBitmapCountBits:
+ * @bitmap: bitmap to inspect
+ *
+ * Return the number of bits currently set in @bitmap.
+ */
 size_t
 virBitmapCountBits(virBitmapPtr bitmap)
 {
@@ -1192,6 +1211,14 @@ virBitmapDataFormat(const void *data,
 }


+/**
+ * virBitmapOverlaps:
+ * @b1: virBitmap to inspect
+ * @b2: virBitmap to inspect
+ *
+ * Returns true if at least one bit with the same index is set both in @b1 and
+ * @b2.
+ */
 bool
 virBitmapOverlaps(virBitmapPtr b1,
                   virBitmapPtr b2)
-- 
2.15.0




More information about the libvir-list mailing list