Skip to contentSkip to conversation

hw/nvme: Move NVMe emulation out of hw/block/ directory

RFC PATCH Superseded Philippe Mathieu-Daudé 1 participant 1 message Oct 22, 2020 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 hw/nvme: Move NVMe emulation out of hw/block/ directory

As IDE used to be, NVMe emulation is becoming an active subsystem. Move it into its own namespace.

---
sent as RFC, it case it helps NVMe developers. As nvme-next has patches queues, if the idea of moving seems useful, this patch can resend later.

---
 meson.build                               |   1 +
 hw/{block/nvme.h => nvme/nvme-internal.h} |   4 +-
 hw/{block/nvme.c => nvme/core.c}          |   2 +-
 MAINTAINERS                               |   2 +-
 hw/Kconfig                                |   1 +
 hw/block/Kconfig                          |   5 -
 hw/block/meson.build                      |   1 -
 hw/block/trace-events                     | 124 ---------------------
 hw/meson.build                            |   1 +
 hw/nvme/Kconfig                           |   4 +
 hw/nvme/meson.build                       |   1 +
 hw/nvme/trace-events                      | 125 ++++++++++++++++++++++
 12 files changed, 137 insertions(+), 134 deletions(-)
 rename hw/{block/nvme.h => nvme/nvme-internal.h} (98%)
 rename hw/{block/nvme.c => nvme/core.c} (99%)
 create mode 100644 hw/nvme/Kconfig
 create mode 100644 hw/nvme/meson.build
 create mode 100644 hw/nvme/trace-events
meson.build +1 -0
index 7627a0ae46e..24234ebd473 100644
@@ -1356,6 +1356,7 @@
     'hw/misc',
     'hw/misc/macio',
     'hw/net',
+    'hw/nvme',
     'hw/nvram',
     'hw/pci',
     'hw/pci-host',
hw/nvme/nvme-internal.h renamed from hw/block/nvme.h +2 -2
similarity index 98%
rename from hw/block/nvme.h
rename to hw/nvme/nvme-internal.h
index 52ba794f2e9..824788d9c6e 100644
@@ -1,5 +1,5 @@
-#ifndef HW_NVME_H
-#define HW_NVME_H
+#ifndef HW_NVME_INTERNAL_H
+#define HW_NVME_INTERNAL_H
 
 #include "block/nvme.h"
 
hw/nvme/core.c renamed from hw/block/nvme.c +1 -1
similarity index 99%
rename from hw/block/nvme.c
rename to hw/nvme/core.c
index 44fa5b90769..04391fbb083 100644
@@ -67,8 +67,8 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "qemu/cutils.h"
+#include "nvme-internal.h"
 #include "trace.h"
-#include "nvme.h"
 
 #define NVME_MAX_IOQPAIRS 0xffff
 #define NVME_DB_SIZE  4
MAINTAINERS +1 -1
index 6a197bd358d..7132bbe3ff4 100644
@@ -1875,7 +1875,7 @@ M: Keith Busch <[email protected]>
 M: Klaus Jensen <[email protected]>
 L: [email protected]
 S: Supported
-F: hw/block/nvme*
+F: hw/nvme/
 F: tests/qtest/nvme-test.c
 T: git git://git.infradead.org/qemu-nvme.git nvme-next
 
hw/Kconfig +1 -0
index 4de1797ffda..4ef9ca40ab0 100644
@@ -21,6 +21,7 @@ source mem/Kconfig
 source misc/Kconfig
 source net/Kconfig
 source nubus/Kconfig
+source nvme/Kconfig
 source nvram/Kconfig
 source pci-bridge/Kconfig
 source pci-host/Kconfig
hw/block/Kconfig +0 -5
index 2d17f481adc..c2213173ffe 100644
@@ -22,11 +22,6 @@ config ECC
 config ONENAND
     bool
 
-config NVME_PCI
-    bool
-    default y if PCI_DEVICES
-    depends on PCI
-
 config VIRTIO_BLK
     bool
     default y
hw/block/meson.build +0 -1
index 78cad8f7cba..96697f739c0 100644
@@ -13,7 +13,6 @@
 softmmu_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
 softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c'))
 softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('tc58128.c'))
-softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('nvme.c'))
 
 specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
 specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
hw/block/trace-events +0 -124

130 lines not on this page · raw message

hw/meson.build +1 -0
index 010de7219c1..dcee944cf05 100644
@@ -21,6 +21,7 @@
 subdir('misc')
 subdir('net')
 subdir('nubus')
+subdir('nvme')
 subdir('nvram')
 subdir('pci')
 subdir('pci-bridge')
hw/nvme/Kconfig new file +4 -0
new file mode 100644
index 00000000000..8ac90942e55
@@ -0,0 +1,4 @@
+config NVME_PCI
+    bool
+    default y if PCI_DEVICES
+    depends on PCI
hw/nvme/meson.build new file +1 -0
new file mode 100644
index 00000000000..534c6b1dd17
@@ -0,0 +1 @@
+softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('core.c'))
hw/nvme/trace-events new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.26.2