Skip to contentSkip to conversation

hbitmap: fix missing restore count when finish deserialization

PATCH RESEND Applied Liang Li 2 participants 2 messages Jan 18, 2018

lore
Share & tools
lore

Liang Li

author
#0 lore raw

PATCH RESEND 1/1 hbitmap: fix missing restore count when finish deserialization

The .count of HBitmap is forgot to set in function hbitmap_deserialize_finish, let's set it to the right value.

---
 util/hbitmap.c | 1 +
 1 file changed, 1 insertion(+)
util/hbitmap.c +1 -0
index 289778a..58a2c93 100644
@@ -630,6 +630,7 @@ void hbitmap_deserialize_finish(HBitmap *bitmap)
     }
 
     bitmap->levels[0][0] |= 1UL << (BITS_PER_LONG - 1);
+    bitmap->count = hb_count_between(bitmap, 0, bitmap->size - 1);
 }
 
 void hbitmap_free(HBitmap *hb)
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 21 lines · Liang Li

The .count of HBitmap is forgot to set in function hbitmap_deserialize_finish, let's set it to the right value.

---
 util/hbitmap.c | 1 +
 1 file changed, 1 insertion(+)
util/hbitmap.c +0 -0
index 289778a..58a2c93 100644

util/hbitmap.c void hbitmap_deserialize_finish(HBitmap *bitmap) · line 636

Quoted 7 lines
util/hbitmap.c +1 -0
@@ -630,6 +630,7 @@ void hbitmap_deserialize_finish(HBitmap *bitmap)
     }
 
     bitmap->levels[0][0] |= 1UL << (BITS_PER_LONG - 1);
+    bitmap->count = hb_count_between(bitmap, 0, bitmap->size - 1);
 }
 
 void hbitmap_free(HBitmap *hb)

and

Thanks, applied to my bitmaps tree:

https://github.com/jnsnow/qemu/commits/bitmaps
https://github.com/jnsnow/qemu.git

--js