hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace
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. Reviewed-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
a555af1707
commit
534a93d3a0
|
@ -561,6 +561,7 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
|
||||||
if (!qdev_set_parent_bus(dev, &subsys->bus.parent_bus, errp)) {
|
if (!qdev_set_parent_bus(dev, &subsys->bus.parent_bus, errp)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ns->subsys = subsys;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvme_ns_setup(ns, errp)) {
|
if (nvme_ns_setup(ns, errp)) {
|
||||||
|
|
|
@ -167,6 +167,7 @@ typedef struct NvmeNamespace {
|
||||||
int32_t nr_active_zones;
|
int32_t nr_active_zones;
|
||||||
|
|
||||||
NvmeNamespaceParams params;
|
NvmeNamespaceParams params;
|
||||||
|
NvmeSubsystem *subsys;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint32_t err_rec;
|
uint32_t err_rec;
|
||||||
|
|
Loading…
Reference in New Issue