aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-04-05 21:27:53 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-04-15 08:26:18 +0200
commitcf8074b3825f7229a20c60e679511592bde41340 (patch)
tree0d44731c8ec33903dd131295f76c8cd6da9b9c7a /block/qcow2.c
parente2ec3f976803b360c70d9ae2ba13852fa5d11665 (diff)
block: Introduce bdrv_writev_vmstate
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 1d180732e9..1d856af80f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1652,18 +1652,24 @@ static void dump_refcounts(BlockDriverState *bs)
}
#endif
-static int qcow2_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
- int64_t pos, int size)
+static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
+ int64_t pos)
{
BDRVQcowState *s = bs->opaque;
int growable = bs->growable;
int ret;
+ void *buf;
+
+ buf = qemu_blockalign(bs, qiov->size);
+ qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
bs->growable = 1;
- ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, size);
+ ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, qiov->size);
bs->growable = growable;
+ qemu_vfree(buf);
+
return ret;
}