[Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization

Liang Li posted 1 patch 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180118105841.GA1897@liangdeMacBook-Pro.local
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppc passed
Test s390x passed
util/hbitmap.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization
Posted by Liang Li 7 years, 9 months ago
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 <vsementsov@virtuozzo.com>
Cc: Fam Zheng <famz@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: Liang Li <liliangleo@didichuxing.com>
---
 util/hbitmap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/hbitmap.c b/util/hbitmap.c
index 289778a..58a2c93 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -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)
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization
Posted by Vladimir Sementsov-Ogievskiy 7 years, 9 months ago
18.01.2018 13:58, Liang Li wrote:
> 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 <vsementsov@virtuozzo.com>
> Cc: Fam Zheng <famz@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: John Snow <jsnow@redhat.com>
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> Signed-off-by: Liang Li <liliangleo@didichuxing.com>
> ---
>   util/hbitmap.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/util/hbitmap.c b/util/hbitmap.c
> index 289778a..58a2c93 100644
> --- a/util/hbitmap.c
> +++ b/util/hbitmap.c
> @@ -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!

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

-- 
Best regards,
Vladimir


Re: [Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization
Posted by Max Reitz 7 years, 8 months ago
On 2018-01-18 11:58, Liang Li wrote:
> 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 <vsementsov@virtuozzo.com>
> Cc: Fam Zheng <famz@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: John Snow <jsnow@redhat.com>
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> Signed-off-by: Liang Li <liliangleo@didichuxing.com>
> ---
>  util/hbitmap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/util/hbitmap.c b/util/hbitmap.c
> index 289778a..58a2c93 100644
> --- a/util/hbitmap.c
> +++ b/util/hbitmap.c
> @@ -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

Re: [Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization
Posted by John Snow 7 years, 8 months ago

On 01/31/2018 01:54 PM, Max Reitz wrote:
> On 2018-01-18 11:58, Liang Li wrote:
>> 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 <vsementsov@virtuozzo.com>
>> Cc: Fam Zheng <famz@redhat.com>
>> Cc: Max Reitz <mreitz@redhat.com>
>> Cc: John Snow <jsnow@redhat.com>
>> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
>> Signed-off-by: Liang Li <liliangleo@didichuxing.com>
>> ---
>>  util/hbitmap.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/util/hbitmap.c b/util/hbitmap.c
>> index 289778a..58a2c93 100644
>> --- a/util/hbitmap.c
>> +++ b/util/hbitmap.c
>> @@ -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
> 

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

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

Re: [Qemu-devel] [PATCH] hbitmap: fix missing restore count when finish deserialization
Posted by Max Reitz 7 years, 8 months ago
On 2018-01-31 20:01, John Snow wrote:
> 
> 
> On 01/31/2018 01:54 PM, Max Reitz wrote:
>> On 2018-01-18 11:58, Liang Li wrote:
>>> 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 <vsementsov@virtuozzo.com>
>>> Cc: Fam Zheng <famz@redhat.com>
>>> Cc: Max Reitz <mreitz@redhat.com>
>>> Cc: John Snow <jsnow@redhat.com>
>>> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
>>> Signed-off-by: Liang Li <liliangleo@didichuxing.com>
>>> ---
>>>  util/hbitmap.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/util/hbitmap.c b/util/hbitmap.c
>>> index 289778a..58a2c93 100644
>>> --- a/util/hbitmap.c
>>> +++ b/util/hbitmap.c
>>> @@ -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
>>
> 
> Staged already, sorry. Will send the PR this Friday.
> 
> https://github.com/jnsnow/qemu/commit/78ad6913bd34a54f658d5182990fe149614d6402

OK, good. :-)

Max