[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 11/15] block/nvme: Simplify nvme_init_queue() arguments
From: |
Stefano Garzarella |
Subject: |
Re: [PATCH v5 11/15] block/nvme: Simplify nvme_init_queue() arguments |
Date: |
Fri, 21 Aug 2020 12:10:01 +0200 |
On Thu, Aug 20, 2020 at 06:58:57PM +0200, Philippe Mathieu-Daudé wrote:
> nvme_init_queue() doesn't require BlockDriverState anymore.
> Replace it by BDRVNVMeState to simplify.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> block/nvme.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
> diff --git a/block/nvme.c b/block/nvme.c
> index f180078e781..5b69fc75a60 100644
> --- a/block/nvme.c
> +++ b/block/nvme.c
> @@ -165,10 +165,9 @@ static QemuOptsList runtime_opts = {
> },
> };
>
> -static void nvme_init_queue(BlockDriverState *bs, NVMeQueue *q,
> +static void nvme_init_queue(BDRVNVMeState *s, NVMeQueue *q,
> int nentries, int entry_bytes, Error **errp)
> {
> - BDRVNVMeState *s = bs->opaque;
> size_t bytes;
> int r;
>
> @@ -251,14 +250,14 @@ static NVMeQueuePair
> *nvme_create_queue_pair(BlockDriverState *bs,
> req->prp_list_iova = prp_list_iova + i * s->page_size;
> }
>
> - nvme_init_queue(bs, &q->sq, size, NVME_SQ_ENTRY_BYTES, &local_err);
> + nvme_init_queue(s, &q->sq, size, NVME_SQ_ENTRY_BYTES, &local_err);
> if (local_err) {
> error_propagate(errp, local_err);
> goto fail;
> }
> q->sq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale];
>
> - nvme_init_queue(bs, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err);
> + nvme_init_queue(s, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err);
> if (local_err) {
> error_propagate(errp, local_err);
> goto fail;
> --
> 2.26.2
>
>
- Re: [PATCH v5 07/15] block/nvme: Rename local variable, (continued)
- [PATCH v5 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset, Philippe Mathieu-Daudé, 2020/08/20
- [PATCH v5 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz), Philippe Mathieu-Daudé, 2020/08/20
- [PATCH v5 11/15] block/nvme: Simplify nvme_init_queue() arguments, Philippe Mathieu-Daudé, 2020/08/20
- Re: [PATCH v5 11/15] block/nvme: Simplify nvme_init_queue() arguments,
Stefano Garzarella <=
- [PATCH v5 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE, Philippe Mathieu-Daudé, 2020/08/20
[PATCH v5 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments, Philippe Mathieu-Daudé, 2020/08/20
[PATCH v5 14/15] block/nvme: Extract nvme_poll_queue(), Philippe Mathieu-Daudé, 2020/08/20
[PATCH v5 15/15] block/nvme: Use an array of EventNotifier, Philippe Mathieu-Daudé, 2020/08/20