aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-02-02 12:32:31 +0100
committerKevin Wolf <kwolf@redhat.com>2012-02-09 16:17:51 +0100
commite24e49e6194626e4ec9f1aecce6d6a6847320bce (patch)
tree8e9ee8ff36e8056231c5a9750d903f1ff3a73768 /block/qcow2.h
parentecd880d9eeb59a0148d4761698448245ec4306e0 (diff)
downloadqemu-e24e49e6194626e4ec9f1aecce6d6a6847320bce.zip
qemu-e24e49e6194626e4ec9f1aecce6d6a6847320bce.tar.gz
qemu-e24e49e6194626e4ec9f1aecce6d6a6847320bce.tar.bz2
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>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 99e4536..aae5f89 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -178,6 +178,7 @@ static inline int64_t align_offset(int64_t offset, int n)
/* qcow2.c functions */
int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
int64_t sector_num, int nb_sectors);
+int qcow2_update_header(BlockDriverState *bs);
/* qcow2-refcount.c functions */
int qcow2_refcount_init(BlockDriverState *bs);