hw/block/nvme: Add support for active/inactive namespaces
In NVMe, a namespace is active if it exists and is attached to the
controller.
CAP.CSS (together with the I/O Command Set data structure) defines what
command sets are supported by the controller.
CC.CSS (together with Set Profile) can be set to enable a subset of the
available command sets. The namespaces belonging to a disabled command set
will not be able to attach to the controller, and will thus be inactive.
E.g., if the user sets CC.CSS to Admin Only, NVM namespaces should be
marked as inactive.
The identify namespace, the identify namespace CSI specific, and the namespace
list commands have two different versions, one that only shows active
namespaces, and the other version that shows existing namespaces, regardless
of whether the namespace is attached or not.
Add an attached member to struct NvmeNamespace, and implement the missing CNS
commands.
The added functionality will also simplify the implementation of namespace
management in the future, since namespace management can also attach and
detach namespaces.