summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-10-29 10:32:49 +0100
committerStefan Hajnoczi2020-11-03 20:06:21 +0100
commit3214b0f0948d5e01ccca62730e60a69e2ded8774 (patch)
tree366cff4b0f5e21d92c0aac986ce89b7c4765767e /block
parentblock/nvme: Trace queue pair creation/deletion (diff)
downloadqemu-3214b0f0948d5e01ccca62730e60a69e2ded8774.tar.gz
qemu-3214b0f0948d5e01ccca62730e60a69e2ded8774.tar.xz
qemu-3214b0f0948d5e01ccca62730e60a69e2ded8774.zip
block/nvme: Move definitions before structure declarations
To be able to use some definitions in structure declarations, move them earlier. No logical change. Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201029093306.1063879-9-philmd@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nvme.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/block/nvme.c b/block/nvme.c
index e95d59d312..b0629f5de8 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -41,6 +41,16 @@
typedef struct BDRVNVMeState BDRVNVMeState;
+/* Same index is used for queues and IRQs */
+#define INDEX_ADMIN 0
+#define INDEX_IO(n) (1 + n)
+
+/* This driver shares a single MSIX IRQ for the admin and I/O queues */
+enum {
+ MSIX_SHARED_IRQ_IDX = 0,
+ MSIX_IRQ_COUNT = 1
+};
+
typedef struct {
int32_t head, tail;
uint8_t *queue;
@@ -81,15 +91,6 @@ typedef struct {
QEMUBH *completion_bh;
} NVMeQueuePair;
-#define INDEX_ADMIN 0
-#define INDEX_IO(n) (1 + n)
-
-/* This driver shares a single MSIX IRQ for the admin and I/O queues */
-enum {
- MSIX_SHARED_IRQ_IDX = 0,
- MSIX_IRQ_COUNT = 1
-};
-
struct BDRVNVMeState {
AioContext *aio_context;
QEMUVFIOState *vfio;