[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/5] hw/nvme: store a pointer to the NvmeSubsystem in the Nvme
From: |
Jesper Devantier |
Subject: |
[PATCH v2 2/5] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace |
Date: |
Fri, 17 Feb 2023 13:07:40 +0100 |
From: Niklas Cassel <niklas.cassel@wdc.com>
Each NvmeNamespace can be used by serveral controllers,
but a NvmeNamespace can at most belong to a single NvmeSubsystem.
Store a pointer to the NvmeSubsystem, if the namespace was realized
with a NvmeSubsystem.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ns.c | 1 +
hw/nvme/nvme.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
index 62a1f97be0..8ebab4fbce 100644
--- a/hw/nvme/ns.c
+++ b/hw/nvme/ns.c
@@ -561,6 +561,7 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
if (!qdev_set_parent_bus(dev, &subsys->bus.parent_bus, errp)) {
return;
}
+ ns->subsys = subsys;
}
if (nvme_ns_setup(ns, errp)) {
diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h
index 16da27a69b..5d221073ac 100644
--- a/hw/nvme/nvme.h
+++ b/hw/nvme/nvme.h
@@ -167,6 +167,7 @@ typedef struct NvmeNamespace {
int32_t nr_active_zones;
NvmeNamespaceParams params;
+ NvmeSubsystem *subsys;
struct {
uint32_t err_rec;
--
2.39.1
- [PATCH v2 0/5] Support Flexible Data Placement (FDP), Jesper Devantier, 2023/02/17
- [PATCH v2 1/5] hw/nvme: move adjustment of data_units{read,written}, Jesper Devantier, 2023/02/17
- [PATCH v2 2/5] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace,
Jesper Devantier <=
- [PATCH v2 3/5] hw/nvme: add basic endurance group support, Jesper Devantier, 2023/02/17
- [PATCH v2 4/5] hw/nvme: basic directives support, Jesper Devantier, 2023/02/17
- [PATCH v2 5/5] hw/nvme: flexible data placement emulation, Jesper Devantier, 2023/02/17