diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-08-21 21:53:55 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-09-07 12:31:30 +0200 |
commit | 3a6d34d0661d25215ca2bc92fa8aa0dbb22a4e81 (patch) | |
tree | 40cf44b319970b4f8ee8d8684844cb772d245ba4 /block/nvme.c | |
parent | 38e1f8186fc40054ae12b9b5e21f051c2f59cb9c (diff) |
block/nvme: Simplify nvme_init_queue() arguments
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>
Message-Id: <20200821195359.1285345-12-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/nvme.c')
-rw-r--r-- | block/nvme.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/nvme.c b/block/nvme.c index 0c8ad1d60b..e04e1fa4f8 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; |