From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH rfc 3/6] nvme-cli: allow discover to address discovery controller by persistent name
Date: Thu, 11 Jul 2019 21:41:16 +0900 [thread overview]
Message-ID: <20190711124116.GC8398@minwoo-desktop> (raw)
In-Reply-To: <20190710232740.26734-4-jsmart2021@gmail.com>
On 19-07-10 16:27:37, James Smart wrote:
> To support discovery (connect/connect-all) to operate against a
> persistent discovery controller, let the discovery controller to
> be specified by its device node name rather than new connection
> attributes.
>
> Example:
> nvme connect-all ... --device=nvme5
>
> Also centralize extraction of controller instance from the controller
> name to a common helper.
>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> Signed-off-by: James Smart <jsmart2021 at gmail.com>
> Reviewed-by: Max Gurtovoy <maxg at mellanox.com>
Hi Sagi and James,
I think it might be too late review on this, but please have a look my
comments below :)
> +static int ctrl_instance(char *device)
> +{
> + int ret, instance;
> +
> + device = basename(device);
> + ret = sscanf(device, "nvme%d", &instance);
> + if (ret < 0)
> + return ret;
It's just nitpick, but could we just do like:
ret = sscanf(device, "nvme%d", &instance);
if (ret < 0)
return -errno;
> + if (!ret)
> + return -1;
Same here. Can we please do:
if (!ret)
return -EINVAL;
These two things are not from this commit, but if you don't like it to
be involved in this scope of the commit, I think I can make it later, if
you don't mind.
> + return instance;
> +}
I have a doubt here. In case of multipath, if this function is given an
argument like "nvme0n1", Is "0" really an instance of that controller?
I think it could be an instance of the subsystem. If so, can we just
prevent the argstr as a namespace node?
Please correct me if I'm wrong here.
next prev parent reply other threads:[~2019-07-11 12:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 23:27 [PATCH rfc 0/6] nvme-cli: nvmf auto-connect scripts James Smart
2019-07-10 23:27 ` [PATCH rfc 1/6] nvme-cli: ignore arguments that pass in "none" James Smart
2019-07-11 12:28 ` Minwoo Im
2019-07-10 23:27 ` [PATCH rfc 2/6] nvme-cli: support persistent connections to a discovery controller James Smart
2019-07-11 12:33 ` Minwoo Im
2019-07-10 23:27 ` [PATCH rfc 3/6] nvme-cli: allow discover to address discovery controller by persistent name James Smart
2019-07-11 12:41 ` Minwoo Im [this message]
2019-07-11 16:16 ` James Smart
2019-07-11 17:11 ` Minwoo Im
2019-07-10 23:27 ` [PATCH rfc 4/6] nvme-cli: expand --device argument processing James Smart
2019-07-11 0:43 ` Sagi Grimberg
2019-07-11 23:54 ` Sagi Grimberg
2019-07-10 23:27 ` [PATCH rfc 5/6] nvme-cli: add --quiet option James Smart
2019-07-11 12:53 ` Minwoo Im
2019-07-10 23:27 ` [PATCH rfc 6/6] nvme-cli: nvmf auto-connect scripts James Smart
2019-07-11 0:42 ` Sagi Grimberg
2019-07-11 16:18 ` James Smart
2019-07-11 23:47 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190711124116.GC8398@minwoo-desktop \
--to=minwoo.im.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox