1
0
Fork 0

Merging upstream version 2.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 12:26:13 +01:00
parent 60735e10df
commit 2b9f904876
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
407 changed files with 2341 additions and 926 deletions

View file

@ -84,6 +84,7 @@ static const char *nvmf_disable_sqflow = "disable controller sq flow control (de
static const char *nvmf_hdr_digest = "enable transport protocol header digest (TCP transport)";
static const char *nvmf_data_digest = "enable transport protocol data digest (TCP transport)";
static const char *nvmf_tls = "enable TLS";
static const char *nvmf_concat = "enable secure concatenation";
static const char *nvmf_config_file = "Use specified JSON configuration file or 'none' to disable";
static const char *nvmf_context = "execution context identification string";
@ -113,6 +114,7 @@ static const char *nvmf_context = "execution context identification string";
OPT_FLAG("hdr-digest", 'g', &c.hdr_digest, nvmf_hdr_digest), \
OPT_FLAG("data-digest", 'G', &c.data_digest, nvmf_data_digest), \
OPT_FLAG("tls", 0, &c.tls, nvmf_tls), \
OPT_FLAG("concat", 0, &c.concat, nvmf_concat), \
__VA_ARGS__, \
OPT_END() \
}
@ -632,7 +634,7 @@ char *nvmf_hostid_from_hostnqn(const char *hostnqn)
return strdup(uuid + strlen("uuid:"));
}
void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn)
void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsigned int verbose)
{
char *hostid_from_file, *hostid_from_hostnqn;
@ -641,7 +643,9 @@ void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn)
hostid_from_file = nvmf_hostid_from_file();
if (hostid_from_file && strcmp(hostid_from_file, hostid)) {
fprintf(stderr, "warning: use generated hostid instead of hostid file\n");
if (verbose)
fprintf(stderr,
"warning: use generated hostid instead of hostid file\n");
free(hostid_from_file);
}
@ -650,7 +654,9 @@ void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn)
hostid_from_hostnqn = nvmf_hostid_from_hostnqn(hostnqn);
if (hostid_from_hostnqn && strcmp(hostid_from_hostnqn, hostid)) {
fprintf(stderr, "warning: use hostid which does not match uuid in hostnqn\n");
if (verbose)
fprintf(stderr,
"warning: use hostid which does not match uuid in hostnqn\n");
free(hostid_from_hostnqn);
}
}
@ -741,7 +747,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect)
hostid = hid = nvmf_hostid_from_file();
if (!hostid && hostnqn)
hostid = hid = nvmf_hostid_from_hostnqn(hostnqn);
nvmf_check_hostid_and_hostnqn(hostid, hostnqn);
nvmf_check_hostid_and_hostnqn(hostid, hostnqn, verbose);
h = nvme_lookup_host(r, hostnqn, hostid);
if (!h) {
ret = ENOMEM;
@ -964,7 +970,7 @@ int nvmf_connect(const char *desc, int argc, char **argv)
hostid = hid = nvmf_hostid_from_file();
if (!hostid && hostnqn)
hostid = hid = nvmf_hostid_from_hostnqn(hostnqn);
nvmf_check_hostid_and_hostnqn(hostid, hostnqn);
nvmf_check_hostid_and_hostnqn(hostid, hostnqn, verbose);
h = nvme_lookup_host(r, hostnqn, hostid);
if (!h) {
errno = ENOMEM;