]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commit
block/vdi: Zero unused parts when allocating a new block (fix #919242)
authorStefan Weil <sw@weilnetz.de>
Sat, 21 Jan 2012 12:54:24 +0000 (13:54 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Jan 2012 13:49:18 +0000 (14:49 +0100)
commit641543b76b82a8b361482b727e08de0c8ec093b0
tree37bbd0327a9d2d3ca4e4f163e87cccf246f835b4
parent81b6b9faef111f4493addc2ed19903feace332bf
block/vdi: Zero unused parts when allocating a new block (fix #919242)

The new block was filled with zero when it was allocated by g_malloc0,
but when it was reused later and only partially used, data from the
previously allocated block were still present and written to the new
block.

This caused the problems reported by bug #919242
(https://bugs.launchpad.net/qemu/+bug/919242).

Now the unused parts of the new block which are before and after the data
are always filled with zero, so it is no longer necessary to zero the whole
block with g_malloc0.

I also updated the copyright comment.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vdi.c