Also updating the documentation.
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
the provided namespace identifier, attaching to the provided list of
controller identifiers.
+The <device> parameter is mandatory NVMe character device (ex: /dev/nvme0) but
+not a namespace block device (ex: /dev/nvme0n1).
+
OPTIONS
-------
-n <nsid>::
--namespace-id=<nsid>::
- The namespace identifier to attach.
+ The namespace identifier to attach but not attached already.
-c <ctrl-list,>::
-controllers=<ctrl-list,>::
if (err)
return err;
+ if (is_blkdev(dev)) {
+ nvme_show_error("%s: a block device opened (dev: %s, nsid: %d)", cmd->name,
+ dev->name, cfg.namespace_id);
+ return -EINVAL;
+ }
+
if (!cfg.namespace_id) {
nvme_show_error("%s: namespace-id parameter required", cmd->name);
return -EINVAL;