]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: Zero-initialise first cluster for new images
authorKevin Wolf <kwolf@redhat.com>
Wed, 4 Dec 2013 10:06:36 +0000 (11:06 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:18:12 +0000 (16:18 -0500)
commitaeba41549da75d5775165e9205170e5b7a30f016
treec70364df37181b49e16f8c3bf954eb979a3f6aaf
parent2f59c95f16f3c98534b49e145da3cac0957c02a7
qcow2: Zero-initialise first cluster for new images

Strictly speaking, this is only required for has_zero_init() == false,
but it's easy enough to just do a cluster-aligned write that is padded
with zeros after the header.

This fixes that after 'qemu-img create' header extensions are attempted
to be parsed that are really just random leftover data.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit f8413b3c23b08a547ce18609acc6fae5fd04ed5c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c