All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Kevin Wolf" <kwolf@redhat.com>,
	qemu-block@nongnu.org, "Klaus Jensen" <k.jensen@samsung.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>
Subject: [PATCH v7 11/15] block/nvme: Simplify nvme_init_queue() arguments
Date: Thu,  3 Sep 2020 14:27:59 +0200	[thread overview]
Message-ID: <20200903122803.405265-12-philmd@redhat.com> (raw)
In-Reply-To: <20200903122803.405265-1-philmd@redhat.com>

nvme_init_queue() doesn't require BlockDriverState anymore.
Replace it by BDRVNVMeState to simplify.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 block/nvme.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/block/nvme.c b/block/nvme.c
index 0c8ad1d60b6..e04e1fa4f8f 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



  parent reply	other threads:[~2020-09-03 12:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 12:27 [PATCH v7 00/15] block/nvme: Various cleanups required to use multiple queues Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 01/15] block/nvme: Replace magic value by SCALE_MS definition Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 02/15] block/nvme: Avoid further processing if trace event not enabled Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 04/15] block/nvme: Define INDEX macros to ease code review Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 05/15] block/nvme: Improve error message when IO queue creation failed Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 06/15] block/nvme: Use common error path in nvme_add_io_queue() Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 07/15] block/nvme: Rename local variable Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset Philippe Mathieu-Daudé
2020-09-03 12:27 ` [PATCH v7 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz) Philippe Mathieu-Daudé
2020-09-03 12:27 ` Philippe Mathieu-Daudé [this message]
2020-09-03 12:28 ` [PATCH v7 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE Philippe Mathieu-Daudé
2020-09-03 12:28 ` [PATCH v7 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments Philippe Mathieu-Daudé
2020-09-03 12:28 ` [PATCH v7 14/15] block/nvme: Extract nvme_poll_queue() Philippe Mathieu-Daudé
2020-09-03 12:28 ` [PATCH v7 15/15] block/nvme: Use an array of EventNotifier Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903122803.405265-12-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=fam@euphon.net \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.