linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH rfc 2/2] fabrics: allow user to pass hostname instead of traddr
Date: Wed, 1 Apr 2020 13:33:40 -0700	[thread overview]
Message-ID: <66d26b09-7a9f-cd2c-c2c4-e7e311271f5d@grimberg.me> (raw)
In-Reply-To: <20200401193908.GB1144965@dhcp-10-100-145-180.wdl.wdc.com>


>> 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?

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

  reply	other threads:[~2020-04-01 20:33 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 [this message]
2020-04-01 20:43       ` Keith Busch
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=66d26b09-7a9f-cd2c-c2c4-e7e311271f5d@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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).