hw/nvme: add basic endurance group support

Add the mandatory Endurance Group identify data structures and log
pages.

For now, all namespaces in a subsystem belongs to a single Endurance
Group.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
Klaus Jensen 2023-02-20 12:59:24 +01:00
parent 534a93d3a0
commit 771dbc3ac4
4 changed files with 93 additions and 8 deletions

View file

@ -592,6 +592,8 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
if (subsys) {
subsys->namespaces[nsid] = ns;
ns->id_ns.endgid = cpu_to_le16(0x1);
if (ns->params.detached) {
return;
}
@ -607,6 +609,7 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
return;
}
}
nvme_attach_ns(n, ns);