diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2019-04-22 17:58:33 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-04-30 15:29:00 +0200 |
commit | 696e8cb292074c28ced30b4a11d51dc8b3087db4 (patch) | |
tree | b11e8212586943644a93a9087a4d11a633718688 /block/qed.c | |
parent | 4ed3e0c48620a7f426bcec405745c6f01f560a8e (diff) |
block/qed: use buffer-based io
Move to _co_ versions of io functions qed_read_table() and
qed_write_table(), as we use qemu_co_mutex_unlock()
anyway.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed.c')
-rw-r--r-- | block/qed.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/qed.c b/block/qed.c index 89af05d524..912edaf56a 100644 --- a/block/qed.c +++ b/block/qed.c @@ -113,15 +113,13 @@ static int coroutine_fn qed_write_header(BDRVQEDState *s) int nsectors = DIV_ROUND_UP(sizeof(QEDHeader), BDRV_SECTOR_SIZE); size_t len = nsectors * BDRV_SECTOR_SIZE; uint8_t *buf; - QEMUIOVector qiov; int ret; assert(s->allocating_acb || s->allocating_write_reqs_plugged); buf = qemu_blockalign(s->bs, len); - qemu_iovec_init_buf(&qiov, buf, len); - ret = bdrv_co_preadv(s->bs->file, 0, qiov.size, &qiov, 0); + ret = bdrv_co_pread(s->bs->file, 0, len, buf, 0); if (ret < 0) { goto out; } @@ -129,7 +127,7 @@ static int coroutine_fn qed_write_header(BDRVQEDState *s) /* Update header */ qed_header_cpu_to_le(&s->header, (QEDHeader *) buf); - ret = bdrv_co_pwritev(s->bs->file, 0, qiov.size, &qiov, 0); + ret = bdrv_co_pwrite(s->bs->file, 0, len, buf, 0); if (ret < 0) { goto out; } |