[PATCH] bitmap: fix typo to use UL type of integer constant in virBitmapIsAllSet

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

 



This bug leads to get incorrect vcpupin information via
qemudDomainGetVcpuPinInfo() API when the number of maximum
cpu on a host falls into a scope such as 31 < ncpus < 64.

gcc warning:
left shift count >= width of type

The following bug is such a case
https://bugzilla.redhat.com/show_bug.cgi?id=876415
---
 src/util/bitmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/bitmap.c b/src/util/bitmap.c
index 5ec5440..c29f5f3 100644
--- a/src/util/bitmap.c
+++ b/src/util/bitmap.c
@@ -574,8 +574,8 @@ bool virBitmapIsAllSet(virBitmapPtr bitmap)
             return false;
 
     if (unusedBits > 0) {
-        if ((bitmap->map[sz] & ((1U << (VIR_BITMAP_BITS_PER_UNIT - unusedBits)) - 1))
-            != ((1U << (VIR_BITMAP_BITS_PER_UNIT - unusedBits)) - 1))
+        if ((bitmap->map[sz] & ((1UL << (VIR_BITMAP_BITS_PER_UNIT - unusedBits)) - 1))
+            != ((1UL << (VIR_BITMAP_BITS_PER_UNIT - unusedBits)) - 1))
             return false;
     }
 
-- 
1.7.1

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