On Jan 20 02:01, Minwoo Im wrote: > Introduced 'detached' parameter to nvme-ns device. If given, the > namespace will not be attached to controller(s) in the subsystem. If > 'subsys' is not given with this option, it should be provided with 'bus' > which is for private namespace. > > This patch also introduced 'ctrls_bitmap' in NvmeNamespace instance to > represent which controler id(cntlid) is attached to this namespace > device. A namespace can be attached to multiple controllers in a > subsystem so that this bitmap maps those two relationships. > > The ctrls_bitmap bitmap should not be accessed directly, but through the > helpers introduced in this patch: nvme_ns_is_attached(), > nvme_ns_attach(), nvme_ns_detach(). > > Note that this patch made identify namespace list data not hold > non-attached namespace ID in nvme_identify_nslist. Currently, this > command handler is for CNS 0x2(Active) and 0x10(Allocated) both. The > next patch will introduce a handler for later on. > > Signed-off-by: Minwoo Im <minwoo.im....@gmail.com> > --- > hw/block/nvme-ns.c | 9 +++++++++ > hw/block/nvme-ns.h | 6 ++++++ > hw/block/nvme-subsys.c | 2 ++ > hw/block/nvme.c | 31 ++++++++++++++++++++++++++++++- > hw/block/nvme.h | 15 +++++++++++++++ > 5 files changed, 62 insertions(+), 1 deletion(-) > > diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c > index 073f65e49cac..70d42c24065c 100644 > --- a/hw/block/nvme-ns.c > +++ b/hw/block/nvme-ns.c > @@ -17,6 +17,7 @@ > #include "qemu/cutils.h" > #include "qemu/log.h" > #include "qemu/error-report.h" > +#include "qemu/hbitmap.h"
Isn't the HBitmap slightly overkill? Can qemu/bitmap.h suffice? > #include "hw/block/block.h" > #include "hw/pci/pci.h" > #include "sysemu/sysemu.h"
signature.asc
Description: PGP signature