aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-04-05 21:27:55 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-04-15 08:26:18 +0200
commit8d3b1a2d0b34a95800c482e1414c63f469ac4973 (patch)
tree89f06faf7d2261daa5c3039413a1ccc06bc3f22d /block
parent05fcc84888cfabec2267851415b66395a73a0f5f (diff)
block: Introduce bdrv_pwritev() for qcow2_save_vmstate
Directly pass the QEMUIOVector on instead of linearising it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 1d856af80f..e8934de185 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1658,18 +1658,12 @@ static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
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, qiov->size);
+ ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);
bs->growable = growable;
- qemu_vfree(buf);
-
return ret;
}