linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH rfc 2/2] fabrics: allow user to pass hostname instead of traddr
Date: Thu, 2 Apr 2020 05:43:36 +0900	[thread overview]
Message-ID: <20200401204336.GA16884@redsun51.ssa.fujisawa.hgst.com> (raw)
In-Reply-To: <66d26b09-7a9f-cd2c-c2c4-e7e311271f5d@grimberg.me>

On Wed, Apr 01, 2020 at 01:33:40PM -0700, Sagi Grimberg wrote:
> 
> > > Some users would like to use well known hostnames instead
> > > of remembering ip addresses. So, allow users to pass --hostname
> > > and we will attempt to resolve against the DNS.
> > > 
> > > Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> > > ---
> > >   fabrics.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >   1 file changed, 75 insertions(+)
> > > 
> > > diff --git a/fabrics.c b/fabrics.c
> > > index a7d628b1f0c9..7bd95c4b0d10 100644
> > > --- a/fabrics.c
> > > +++ b/fabrics.c
> > > @@ -33,6 +33,10 @@
> > >   #include <sys/stat.h>
> > >   #include <stddef.h>
> > > +#include <sys/types.h>
> > > +#include <arpa/inet.h>
> > > +#include <netdb.h>
> > > +
> > >   #include "util/parser.h"
> > >   #include "nvme-ioctl.h"
> > >   #include "nvme-status.h"
> > > @@ -60,6 +64,7 @@ static struct config {
> > >   	char *nqn;
> > >   	char *transport;
> > >   	char *traddr;
> > > +	char *hostname;
> > >   	char *trsvcid;
> > >   	char *host_traddr;
> > >   	char *hostnqn;
> > > @@ -857,6 +862,54 @@ static int build_options(char *argstr, int max_len, bool discover)
> > >   	return 0;
> > >   }
> > 
> > The code looks fine.
> > 
> > I realize 'hostname' in this context is referring to the remote host and
> > resolves the target's transport address, but it just sounds potentially
> > confusing given we have "host_traddr". I'm not sure of a better name,
> > though, so if this is normal convention, then okay.
> 
> We could do it like ssh that can accept either IP or hostname (we check
> if string is IP and if not, resort to name resolution)
> 
> Is that preferable?

Yah, that option sounds more appealing to me.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-04-01 20:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  9:03 [PATCH rfc 0/2] support ip resolution with hostnames Sagi Grimberg
2020-03-24  9:03 ` [PATCH rfc 1/2] fabrics: add fabrics_ prefix to fabrics operations Sagi Grimberg
2020-03-24  9:03 ` [PATCH rfc 2/2] fabrics: allow user to pass hostname instead of traddr Sagi Grimberg
2020-03-24  9:46   ` Max Gurtovoy
2020-03-24 16:21     ` Sagi Grimberg
2020-03-24 17:24       ` Max Gurtovoy
2020-03-24 19:11         ` Sagi Grimberg
2020-03-24 22:57           ` Max Gurtovoy
2020-04-01 19:39   ` Keith Busch
2020-04-01 20:33     ` Sagi Grimberg
2020-04-01 20:43       ` Keith Busch [this message]
2020-03-24  9:06 ` [PATCH rfc 0/2] support ip resolution with hostnames Sagi Grimberg
2020-04-01  6:03 ` 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=20200401204336.GA16884@redsun51.ssa.fujisawa.hgst.com \
    --to=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).