[Qemu-devel] [PATCH] qcow2-bitmap: initialize bitmap directory alignment

Andrey Shinkevich posted 1 patch 4 years, 10 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1558961521-131620-1-git-send-email-andrey.shinkevich@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
block/qcow2-bitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] qcow2-bitmap: initialize bitmap directory alignment
Posted by Andrey Shinkevich 4 years, 10 months ago
Valgrind detects multiple issues in QEMU iotests when the memory is
used without being initialized. Valgrind may dump lots of unnecessary
reports what makes the memory issue analysis harder. Particularly,
that is true for the aligned bitmap directory and can be seen while
running the iotest #169. Padding the aligned space with zeros eases
the pain.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
 block/qcow2-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 8a75366..4941764 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -754,7 +754,7 @@ static int bitmap_list_store(BlockDriverState *bs, Qcow2BitmapList *bm_list,
         dir_offset = *offset;
     }
 
-    dir = g_try_malloc(dir_size);
+    dir = g_try_malloc0(dir_size);
     if (dir == NULL) {
         return -ENOMEM;
     }
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] qcow2-bitmap: initialize bitmap directory alignment
Posted by Max Reitz 4 years, 10 months ago
On 27.05.19 14:52, Andrey Shinkevich wrote:
> Valgrind detects multiple issues in QEMU iotests when the memory is
> used without being initialized. Valgrind may dump lots of unnecessary
> reports what makes the memory issue analysis harder. Particularly,
> that is true for the aligned bitmap directory and can be seen while
> running the iotest #169. Padding the aligned space with zeros eases
> the pain.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
>  block/qcow2-bitmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max

Re: [Qemu-devel] [PATCH] qcow2-bitmap: initialize bitmap directory alignment
Posted by Andrey Shinkevich 4 years, 10 months ago

On 27/05/2019 16:28, Max Reitz wrote:
> On 27.05.19 14:52, Andrey Shinkevich wrote:
>> Valgrind detects multiple issues in QEMU iotests when the memory is
>> used without being initialized. Valgrind may dump lots of unnecessary
>> reports what makes the memory issue analysis harder. Particularly,
>> that is true for the aligned bitmap directory and can be seen while
>> running the iotest #169. Padding the aligned space with zeros eases
>> the pain.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>>   block/qcow2-bitmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thanks, applied to my block branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block
> 
> Max
> 

Thank you too!
Andrey