Skip to contentSkip to conversation

hbitmap: fix missing restore count when finish deserialization

PATCH Superseded Liang Li 4 participants 5 messages Jan 18, 2018 – Jan 31, 2018

lore
Share & tools
lore

Liang Li

author
#0 lore raw

PATCH 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.

Cc Vladimir Sementsov-Ogievskiy <[email protected]>
Cc Fam Zheng <[email protected]>
Cc Max Reitz <[email protected]>
Cc John Snow <[email protected]>
---
 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
#1 lore raw
Quoted 18 lines · Liang Li

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

Cc Vladimir Sementsov-Ogievskiy <[email protected]>
Cc Fam Zheng <[email protected]>
Cc Max Reitz <[email protected]>
Cc John Snow <[email protected]>
---
  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)

Hm, right, my fault. Thank you!

Signature · 2 lines
Best regards,
Vladimir
#2 lore raw
In reply to Liang Li
Quoted 18 lines · Liang Li

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

Cc Vladimir Sementsov-Ogievskiy <[email protected]>
Cc Fam Zheng <[email protected]>
Cc Max Reitz <[email protected]>
Cc John Snow <[email protected]>
---
 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)

Actually CC-ing John...

(Looks good to me, though.)

Max

#3 lore raw
Quoted 25 lines · Max Reitz
Quoted 24 lines · Liang Li

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

Cc Vladimir Sementsov-Ogievskiy <[email protected]>
Cc Fam Zheng <[email protected]>
Cc Max Reitz <[email protected]>
Cc John Snow <[email protected]>
---
 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);
 }
 
Quoted 8 lines

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

Quoted 1 line
util/hbitmap.c +0 -0
 void hbitmap_free(HBitmap *hb)

Actually CC-ing John...

(Looks good to me, though.)

Max

Staged already, sorry. Will send the PR this Friday.

https://github.com/jnsnow/qemu/commit/78ad6913bd34a54f658d5182990fe149614d6402

#4 lore raw
Quoted 32 lines · John Snow
Quoted 29 lines · Max Reitz
Quoted 18 lines · Liang Li

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

Cc Vladimir Sementsov-Ogievskiy <[email protected]>
Cc Fam Zheng <[email protected]>
Cc Max Reitz <[email protected]>
Cc John Snow <[email protected]>
---
 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)

Actually CC-ing John...

Quoted 8 lines
Quoted 4 lines

(Looks good to me, though.)

Max

Staged already, sorry. Will send the PR this Friday.

https://github.com/jnsnow/qemu/commit/78ad6913bd34a54f658d5182990fe149614d6402

OK, good. :-)

Max