[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] virtio-blk: introduce multiread
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] virtio-blk: introduce multiread |
Date: |
Wed, 10 Dec 2014 15:48:06 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, 12/09 17:26, Peter Lieven wrote:
> diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
> index 3f2652f..0ee9582 100644
> --- a/include/hw/virtio/virtio-blk.h
> +++ b/include/hw/virtio/virtio-blk.h
> @@ -134,13 +134,6 @@ typedef struct VirtIOBlock {
> struct VirtIOBlockDataPlane *dataplane;
> } VirtIOBlock;
>
> -#define VIRTIO_BLK_MAX_MERGE_REQS 32
> -
> -typedef struct MultiReqBuffer {
> - BlockRequest blkreq[VIRTIO_BLK_MAX_MERGE_REQS];
> - unsigned int num_writes;
> -} MultiReqBuffer;
> -
> typedef struct VirtIOBlockReq {
> VirtIOBlock *dev;
> VirtQueueElement elem;
> @@ -149,8 +142,21 @@ typedef struct VirtIOBlockReq {
> QEMUIOVector qiov;
> struct VirtIOBlockReq *next;
> BlockAcctCookie acct;
> + QEMUIOVector mr_qiov;
> + struct VirtIOBlockReq *mr_next;
> } VirtIOBlockReq;
>
> +#define MAX_MERGE_REQS 32
Why do you need to rename this macro after introducing it in previous patch?
> +
> +typedef struct MultiReqBuffer {
> + VirtIOBlockReq *reqs[MAX_MERGE_REQS];
> + unsigned int num_reqs;
> + bool is_write;
> + int niov;
> + int64_t sector_num;
> + int nb_sectors;
> +} MultiReqBuffer;
> +
> VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s);
>
> void virtio_blk_free_request(VirtIOBlockReq *req);
> @@ -160,6 +166,6 @@ int virtio_blk_handle_scsi_req(VirtIOBlock *blk,
>
> void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb);
>
> -void virtio_submit_multiwrite(BlockBackend *blk, MultiReqBuffer *mrb);
> +void virtio_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb);
>
> #endif
[Qemu-devel] [PATCH 3/4] block-backend: expose bs->bl.max_transfer_length, Peter Lieven, 2014/12/09