Message ID | 20201030023242.5204-1-dmitry.fomichev@wdc.com |
---|---|
Headers | show |
Series | hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set | expand |
On Oct 30 11:32, Dmitry Fomichev wrote: > From: Niklas Cassel <niklas.cassel@wdc.com> > > Many CNS commands have "allocated" command variants. These include > a namespace as long as it is allocated, that is a namespace is > included regardless if it is active (attached) or not. > > While these commands are optional (they are mandatory for controllers > supporting the namespace attachment command), our QEMU implementation > is more complete by actually providing support for these CNS values. > > However, since our QEMU model currently does not support the namespace > attachment command, these new allocated CNS commands will return the > same result as the active CNS command variants. > > In NVMe, a namespace is active if it exists and is attached to the > controller. > > Add a new Boolean namespace flag, "attached", to provide the most > basic namespace attachment support. The default value for this new > flag is true. Also, implement the logic in the new CNS values to > include/exclude namespaces based on this new property. The only thing > missing is hooking up the actual Namespace Attachment command opcode, > which will allow a user to toggle the "attached" flag per namespace. > > The reason for not hooking up this command completely is because the > NVMe specification requires the namespace management command to be > supported if the namespace attachment command is supported. > > Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> > Reviewed-by: Keith Busch <kbusch@kernel.org> > --- Please rip out all the ns->attached conditionals (it's dead code). Just add the new CNS values in the switch and let them fall through.