qcow2-bitmap: initialize bitmap directory alignment

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>
Message-id: 1558961521-131620-1-git-send-email-andrey.shinkevich@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Andrey Shinkevich 2019-05-27 15:52:01 +03:00 committed by Max Reitz
parent c8bb23cbdb
commit 6388903e7c

View File

@ -753,7 +753,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;
}