mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
hw/ide: drop iov field from IDEBufferedRequest
@iov is used only to initialize @qiov. Let's use new qemu_iovec_init_buf() instead, which simplifies the code. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190218140926.333779-17-vsementsov@virtuozzo.com Message-Id: <20190218140926.333779-17-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
e5863d49e4
commit
5bbe9325a0
@ -629,13 +629,15 @@ static void ide_buffered_readv_cb(void *opaque, int ret)
|
||||
IDEBufferedRequest *req = opaque;
|
||||
if (!req->orphaned) {
|
||||
if (!ret) {
|
||||
qemu_iovec_from_buf(req->original_qiov, 0, req->iov.iov_base,
|
||||
assert(req->qiov.size == req->original_qiov->size);
|
||||
qemu_iovec_from_buf(req->original_qiov, 0,
|
||||
req->qiov.local_iov.iov_base,
|
||||
req->original_qiov->size);
|
||||
}
|
||||
req->original_cb(req->original_opaque, ret);
|
||||
}
|
||||
QLIST_REMOVE(req, list);
|
||||
qemu_vfree(req->iov.iov_base);
|
||||
qemu_vfree(qemu_iovec_buf(&req->qiov));
|
||||
g_free(req);
|
||||
}
|
||||
|
||||
@ -660,9 +662,8 @@ BlockAIOCB *ide_buffered_readv(IDEState *s, int64_t sector_num,
|
||||
req->original_qiov = iov;
|
||||
req->original_cb = cb;
|
||||
req->original_opaque = opaque;
|
||||
req->iov.iov_base = qemu_blockalign(blk_bs(s->blk), iov->size);
|
||||
req->iov.iov_len = iov->size;
|
||||
qemu_iovec_init_external(&req->qiov, &req->iov, 1);
|
||||
qemu_iovec_init_buf(&req->qiov, blk_blockalign(s->blk, iov->size),
|
||||
iov->size);
|
||||
|
||||
aioreq = blk_aio_preadv(s->blk, sector_num << BDRV_SECTOR_BITS,
|
||||
&req->qiov, 0, ide_buffered_readv_cb, req);
|
||||
|
@ -346,7 +346,6 @@ extern const char *IDE_DMA_CMD_lookup[IDE_DMA__COUNT];
|
||||
|
||||
typedef struct IDEBufferedRequest {
|
||||
QLIST_ENTRY(IDEBufferedRequest) list;
|
||||
struct iovec iov;
|
||||
QEMUIOVector qiov;
|
||||
QEMUIOVector *original_qiov;
|
||||
BlockCompletionFunc *original_cb;
|
||||
|
Loading…
Reference in New Issue
Block a user