]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
qcow2: Update whole header at once
authorKevin Wolf <kwolf@redhat.com>
Thu, 2 Feb 2012 11:32:31 +0000 (12:32 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 9 Feb 2012 15:17:51 +0000 (16:17 +0100)
commite24e49e6194626e4ec9f1aecce6d6a6847320bce
tree8e9ee8ff36e8056231c5a9750d903f1ff3a73768
parentecd880d9eeb59a0148d4761698448245ec4306e0
qcow2: Update whole header at once

In order to switch the backing file, qcow2 issues multiple write
requests that only changed a part of the image header. Any failure after
the first one would leave the header in an corrupted state. With this
patch, the whole header is written at once, so we can't fail in the
middle.

At the same time, this gives us a reusable functions that updates all
fields of the qcow2 header and not only the backing file.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c
block/qcow2.h