[PATCH 6/6] util: bitmap: Note that shrinking the bitmap requires clearing of unused bits

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

 



Note the fact that the unused portion of the last element in the bitmap
needs to be cleared, since we use functions which process only full-size
elements and don't really deal with individual bits.
---
 src/util/virbitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 82b1f76427..0cc5292d8c 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -45,6 +45,10 @@ struct _virBitmap {
     size_t nbits;
     size_t map_len;
     size_t map_alloc;
+
+    /* Note that code below depends on the fact that unused bits of the bitmap
+     * are not set. Any function decreasing the size of the map needs clear
+     * bits which don't belong to the bitmap any more. */
     unsigned long *map;
 };

-- 
2.15.0

--
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]

  Powered by Linux