From dee40aade137b91f85c209cd6f4b7194d85c0e1c Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 4 Mar 2022 14:37:03 +0100 Subject: [PATCH 01/52] * Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 - Update to 2.0-rc5 --- .gitignore | 1 + nvme-cli.spec | 48 ++++++++++++++++++++++++++++++------------------ sources | 2 +- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index bc5dcae..f3ed3a6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /v1.10.1.tar.gz /v1.11.tar.gz /v1.11.1.tar.gz +/nvme-cli-2.0-rc4.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 4ba7af5..82c5510 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,40 +1,44 @@ -#%%global commit0 bdbb4da0979fbdc079cf98410cdb31cf799e83b3 -#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7}) - Name: nvme-cli -Version: 1.11.1 -Release: 5%{?dist} +Version: 2.0~rc5 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli -#Source0: https://github.com/linux-nvme/%%{name}/archive/%%{commit0}.tar.gz -Source0: https://github.com/linux-nvme/%{name}/archive/v%{version}.tar.gz +Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -BuildRequires: make +BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel -BuildRequires: gcc +BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel +BuildRequires: zlib-devel +BuildRequires: openssl-devel + +BuildRequires: libnvme-devel >= 1.0~rc4 +BuildRequires: json-c-devel >= 0.14 +BuildRequires: python3-nose2 +BuildRequires: python3-mypy +BuildRequires: python3-flake8 +BuildRequires: python3-autopep8 +BuildRequires: python3-isort +BuildRequires: asciidoc +BuildRequires: xmlto + %description nvme-cli provides NVM-Express user space tooling for Linux. %prep -#%%setup -qn %%{name}-%%{commit0} -%setup -q +%autosetup -p1 -n %{name}-%{version_no_tilde} %build - -# CFLAGS on the command line breaks the build. It works okay as an -# environment variable, though. See: -# https://github.com/linux-nvme/nvme-cli/pull/480 -CFLAGS="%{optflags}" make PREFIX=/usr LDFLAGS="%{__global_ldflags}" %{?_smp_mflags} +%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} +%meson_build %install -%make_install PREFIX=/usr UDEVDIR="%{_udevrulesdir}/.." SYSTEMDDIR="%{_unitdir}/.." -mkdir -p %{buildroot}%{_sysconfdir}/nvme +%meson_install # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -44,10 +48,15 @@ rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn # Do not install the dracut rule yet. See rhbz 1742764 rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +# Move html docs into the right place +mv %{buildroot}%{_pkgdocdir}/nvme %{buildroot}%{_pkgdocdir}/html +rm -rf %{buildroot}%{_pkgdocdir}/nvme + %files %license LICENSE %doc README.md +%doc %{_pkgdocdir} %{_sbindir}/nvme %{_mandir}/man1/nvme*.gz %{_datadir}/bash-completion/completions/nvme @@ -65,6 +74,9 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %changelog +* Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 +- Update to 2.0-rc5 + * Thu Jan 20 2022 Fedora Release Engineering - 1.11.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index d9f6fa3..1707fe9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v1.11.1.tar.gz) = 467e327f45500d80cebd6e5e55d4e6d3731a754423e71180efa9d4f5e98f0774f7a31393fefc2794250b487446005dad8e7002a27aff1f2b285983d55ec0d0b3 +SHA512 (nvme-cli-2.0-rc4.tar.gz) = 875ebf9842f8b25ec1584d6336df3b1fc8961856cf04f3621e2dea25fc9a927d0caa850001de0dbf01785cfe4688adde3eb355be11b40fa1a90f0c298589f88c From cbb28bad5e6a2b8c9035bb5199892aff067c45ef Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 4 Mar 2022 15:42:57 +0100 Subject: [PATCH 02/52] Fix the srpm sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f3ed3a6..eb68f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /v1.11.tar.gz /v1.11.1.tar.gz /nvme-cli-2.0-rc4.tar.gz +/nvme-cli-2.0-rc5.tar.gz diff --git a/sources b/sources index 1707fe9..52eeb54 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc4.tar.gz) = 875ebf9842f8b25ec1584d6336df3b1fc8961856cf04f3621e2dea25fc9a927d0caa850001de0dbf01785cfe4688adde3eb355be11b40fa1a90f0c298589f88c +SHA512 (nvme-cli-2.0-rc5.tar.gz) = 499d1476aee77195f06aaaaf9543340605212554bbe731af8f03a62a221f26857f23e10dc2ef6e2555930b5e40601f64f01da303d91ed88d200ed11f94220e44 From c791897dc53538650a15be57eb203358ef43c828 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 4 Mar 2022 14:37:03 +0100 Subject: [PATCH 03/52] * Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 - Update to 2.0-rc5 --- .gitignore | 2 ++ nvme-cli.spec | 48 ++++++++++++++++++++++++++++++------------------ sources | 2 +- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index bc5dcae..eb68f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ /v1.10.1.tar.gz /v1.11.tar.gz /v1.11.1.tar.gz +/nvme-cli-2.0-rc4.tar.gz +/nvme-cli-2.0-rc5.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 4ba7af5..82c5510 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,40 +1,44 @@ -#%%global commit0 bdbb4da0979fbdc079cf98410cdb31cf799e83b3 -#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7}) - Name: nvme-cli -Version: 1.11.1 -Release: 5%{?dist} +Version: 2.0~rc5 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli -#Source0: https://github.com/linux-nvme/%%{name}/archive/%%{commit0}.tar.gz -Source0: https://github.com/linux-nvme/%{name}/archive/v%{version}.tar.gz +Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -BuildRequires: make +BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel -BuildRequires: gcc +BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel +BuildRequires: zlib-devel +BuildRequires: openssl-devel + +BuildRequires: libnvme-devel >= 1.0~rc4 +BuildRequires: json-c-devel >= 0.14 +BuildRequires: python3-nose2 +BuildRequires: python3-mypy +BuildRequires: python3-flake8 +BuildRequires: python3-autopep8 +BuildRequires: python3-isort +BuildRequires: asciidoc +BuildRequires: xmlto + %description nvme-cli provides NVM-Express user space tooling for Linux. %prep -#%%setup -qn %%{name}-%%{commit0} -%setup -q +%autosetup -p1 -n %{name}-%{version_no_tilde} %build - -# CFLAGS on the command line breaks the build. It works okay as an -# environment variable, though. See: -# https://github.com/linux-nvme/nvme-cli/pull/480 -CFLAGS="%{optflags}" make PREFIX=/usr LDFLAGS="%{__global_ldflags}" %{?_smp_mflags} +%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} +%meson_build %install -%make_install PREFIX=/usr UDEVDIR="%{_udevrulesdir}/.." SYSTEMDDIR="%{_unitdir}/.." -mkdir -p %{buildroot}%{_sysconfdir}/nvme +%meson_install # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -44,10 +48,15 @@ rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn # Do not install the dracut rule yet. See rhbz 1742764 rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +# Move html docs into the right place +mv %{buildroot}%{_pkgdocdir}/nvme %{buildroot}%{_pkgdocdir}/html +rm -rf %{buildroot}%{_pkgdocdir}/nvme + %files %license LICENSE %doc README.md +%doc %{_pkgdocdir} %{_sbindir}/nvme %{_mandir}/man1/nvme*.gz %{_datadir}/bash-completion/completions/nvme @@ -65,6 +74,9 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %changelog +* Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 +- Update to 2.0-rc5 + * Thu Jan 20 2022 Fedora Release Engineering - 1.11.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index d9f6fa3..52eeb54 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v1.11.1.tar.gz) = 467e327f45500d80cebd6e5e55d4e6d3731a754423e71180efa9d4f5e98f0774f7a31393fefc2794250b487446005dad8e7002a27aff1f2b285983d55ec0d0b3 +SHA512 (nvme-cli-2.0-rc5.tar.gz) = 499d1476aee77195f06aaaaf9543340605212554bbe731af8f03a62a221f26857f23e10dc2ef6e2555930b5e40601f64f01da303d91ed88d200ed11f94220e44 From 3f66b131c24f03aba546359763120fac7c184f43 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 15 Mar 2022 16:23:19 +0100 Subject: [PATCH 04/52] * Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 - Update to 2.0-rc6 --- .gitignore | 1 + connect_return_code.patch | 25 +++++++++++++++++++++++++ nvme-cli.spec | 8 +++++++- sources | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 connect_return_code.patch diff --git a/.gitignore b/.gitignore index eb68f3e..fc50d23 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /v1.11.1.tar.gz /nvme-cli-2.0-rc4.tar.gz /nvme-cli-2.0-rc5.tar.gz +/nvme-cli-2.0-rc6.tar.gz diff --git a/connect_return_code.patch b/connect_return_code.patch new file mode 100644 index 0000000..07f1fc4 --- /dev/null +++ b/connect_return_code.patch @@ -0,0 +1,25 @@ +commit 9ec18159f75512687a3df22eee15fbafc4c87c9a +Author: Tomas Bzatek +Date: Mon Mar 14 18:15:20 2022 +0100 + + connect: Set errno to zero on nvmf_add_ctrl() success + + The libnvme's nvmf_add_ctrl() might return zero (success) while + having errno set to a non-zero value due to lots of calls inside. + And since nvmf_connect() returns errno primarily, make sure + it's zeroed on success. + + See related https://github.com/linux-nvme/libnvme/pull/292 + +diff --git a/fabrics.c b/fabrics.c +index 49378dc..e08ffd6 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -688,6 +688,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) + fprintf(stderr, "no controller found: %s\n", + nvme_strerror(errno)); + else { ++ errno = 0; + if (flags == NORMAL) + print_connect_msg(c); + else if (flags == JSON) diff --git a/nvme-cli.spec b/nvme-cli.spec index 82c5510..29840a3 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc5 +Version: 2.0~rc6 Release: 1%{?dist} Summary: NVMe management command line interface @@ -7,6 +7,9 @@ License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +# backport from upstream +Patch0: connect_return_code.patch + BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ @@ -74,6 +77,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 +- Update to 2.0-rc6 + * Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 - Update to 2.0-rc5 diff --git a/sources b/sources index 52eeb54..36fb6ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc5.tar.gz) = 499d1476aee77195f06aaaaf9543340605212554bbe731af8f03a62a221f26857f23e10dc2ef6e2555930b5e40601f64f01da303d91ed88d200ed11f94220e44 +SHA512 (nvme-cli-2.0-rc6.tar.gz) = 00e0376f0a5b69c2a9192c8261da73492aeb6bfe19cd488382e18b50e247a4591b470349f42503bab5d4881c35a056a033213624503efa62de9f8e98dfe4b005 From 726694821cc427c0736a0f3e412d0faf4e5c11e6 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 4 Apr 2022 17:30:20 +0200 Subject: [PATCH 05/52] * Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 - Update to 2.0-rc8 - Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) --- .gitignore | 1 + connect_return_code.patch | 25 ------ ...c9_fabrics_Do_not_free_static_string.patch | 84 +++++++++++++++++ ...ect_even_when_no_hostnqn_file_exists.patch | 89 +++++++++++++++++++ nvme-cli.spec | 22 ++++- sources | 2 +- 6 files changed, 194 insertions(+), 29 deletions(-) delete mode 100644 connect_return_code.patch create mode 100644 nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch create mode 100644 nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch diff --git a/.gitignore b/.gitignore index fc50d23..e640b52 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /nvme-cli-2.0-rc4.tar.gz /nvme-cli-2.0-rc5.tar.gz /nvme-cli-2.0-rc6.tar.gz +/nvme-cli-2.0-rc8.tar.gz diff --git a/connect_return_code.patch b/connect_return_code.patch deleted file mode 100644 index 07f1fc4..0000000 --- a/connect_return_code.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 9ec18159f75512687a3df22eee15fbafc4c87c9a -Author: Tomas Bzatek -Date: Mon Mar 14 18:15:20 2022 +0100 - - connect: Set errno to zero on nvmf_add_ctrl() success - - The libnvme's nvmf_add_ctrl() might return zero (success) while - having errno set to a non-zero value due to lots of calls inside. - And since nvmf_connect() returns errno primarily, make sure - it's zeroed on success. - - See related https://github.com/linux-nvme/libnvme/pull/292 - -diff --git a/fabrics.c b/fabrics.c -index 49378dc..e08ffd6 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -688,6 +688,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) - fprintf(stderr, "no controller found: %s\n", - nvme_strerror(errno)); - else { -+ errno = 0; - if (flags == NORMAL) - print_connect_msg(c); - else if (flags == JSON) diff --git a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch new file mode 100644 index 0000000..9ba6f26 --- /dev/null +++ b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch @@ -0,0 +1,84 @@ +commit 539cc29a7cb290523652ea0cdfe0afb1affd0bf4 +Author: Daniel Wagner +Date: Mon Apr 4 12:48:55 2022 +0200 + + fabrics: Do not free static string + + 38f5a54a7306 ("fabrics: Support connect even when no /etc/nvme/hostnqn + file exists") introduce a regression. arg_parser() might assign a + static string to hostnqn and/or hostid. Can't free this. + + Signed-off-by: Daniel Wagner + +diff --git a/fabrics.c b/fabrics.c +index 30388f2d..76d78a91 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -505,6 +505,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; + char *transport = NULL, *traddr = NULL, *trsvcid = NULL; + char *config_file = PATH_NVMF_CONFIG; ++ char *hnqn = NULL, *hid = NULL; + enum nvme_print_flags flags; + nvme_root_t r; + nvme_host_t h; +@@ -559,11 +560,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + set_discovery_kato(&cfg); + + if (!hostnqn) +- hostnqn = nvmf_hostnqn_from_file(); ++ hostnqn = hnqn = nvmf_hostnqn_from_file(); + if (!hostnqn) +- hostnqn = nvmf_hostnqn_generate(); ++ hostnqn = hnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = nvmf_hostid_from_file(); ++ hostid = hid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + ret = ENOMEM; +@@ -658,8 +659,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + out_free_ctrl: + nvme_free_ctrl(c); + out_free: +- free(hostnqn); +- free(hostid); ++ free(hnqn); ++ free(hid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); +@@ -673,6 +674,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) + char *transport = NULL, *traddr = NULL; + char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; + char *hostkey = NULL, *ctrlkey = NULL; ++ char *hnqn = NULL, *hid = NULL; + char *config_file = PATH_NVMF_CONFIG; + unsigned int verbose = 0; + nvme_root_t r; +@@ -746,11 +748,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) + nvme_read_config(r, config_file); + + if (!hostnqn) +- hostnqn = nvmf_hostnqn_from_file(); ++ hostnqn = hnqn = nvmf_hostnqn_from_file(); + if (!hostnqn) +- hostnqn = nvmf_hostnqn_generate(); ++ hostnqn = hnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = nvmf_hostid_from_file(); ++ hostid = hid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + errno = ENOMEM; +@@ -781,8 +783,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) + } + + out_free: +- free(hostnqn); +- free(hostid); ++ free(hnqn); ++ free(hid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); diff --git a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch new file mode 100644 index 0000000..5a80f40 --- /dev/null +++ b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch @@ -0,0 +1,89 @@ +commit 38f5a54a73069cb8a56564f0b80db99c48633723 +Author: Daniel Wagner +Date: Mon Apr 4 11:56:15 2022 +0200 + + fabrics: Support connect even when no /etc/nvme/hostnqn file exists + + The connect call will fail if there is no /etc/nvme/hostnqn file + available. The 1.x version did have a fallback mechanisme in place + when the config file was missing. + + Let's add this feature back by calling nvmf_hostnqn_generate() when + there is no /etc/nvme/hostnqn file. + + Signed-off-by: Daniel Wagner + +diff --git a/fabrics.c b/fabrics.c +index ef80ec0d..30388f2d 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -504,7 +504,6 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + char *subsysnqn = NVME_DISC_SUBSYS_NAME; + char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; + char *transport = NULL, *traddr = NULL, *trsvcid = NULL; +- char *hnqn = NULL, *hid = NULL; + char *config_file = PATH_NVMF_CONFIG; + enum nvme_print_flags flags; + nvme_root_t r; +@@ -560,9 +559,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + set_discovery_kato(&cfg); + + if (!hostnqn) +- hostnqn = hnqn = nvmf_hostnqn_from_file(); ++ hostnqn = nvmf_hostnqn_from_file(); ++ if (!hostnqn) ++ hostnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = hid = nvmf_hostid_from_file(); ++ hostid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + ret = ENOMEM; +@@ -657,10 +658,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + out_free_ctrl: + nvme_free_ctrl(c); + out_free: +- if (hnqn) +- free(hnqn); +- if (hid) +- free(hid); ++ free(hostnqn); ++ free(hostid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); +@@ -670,7 +669,6 @@ out_free: + + int nvmf_connect(const char *desc, int argc, char **argv) + { +- char *hnqn = NULL, *hid = NULL; + char *subsysnqn = NULL; + char *transport = NULL, *traddr = NULL; + char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; +@@ -748,9 +746,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) + nvme_read_config(r, config_file); + + if (!hostnqn) +- hostnqn = hnqn = nvmf_hostnqn_from_file(); ++ hostnqn = nvmf_hostnqn_from_file(); ++ if (!hostnqn) ++ hostnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = hid = nvmf_hostid_from_file(); ++ hostid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + errno = ENOMEM; +@@ -781,10 +781,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) + } + + out_free: +- if (hnqn) +- free(hnqn); +- if (hid) +- free(hid); ++ free(hostnqn); ++ free(hostid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); diff --git a/nvme-cli.spec b/nvme-cli.spec index 29840a3..1ff06c9 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc6 +Version: 2.0~rc8 Release: 1%{?dist} Summary: NVMe management command line interface @@ -8,7 +8,8 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz # backport from upstream -Patch0: connect_return_code.patch +Patch0: nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch +Patch1: nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel @@ -17,7 +18,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.0~rc4 +BuildRequires: libnvme-devel >= 1.0~rc8 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -76,7 +77,22 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +%post +if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then + if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then + echo $(nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn + fi + if [ ! -s %{_sysconfdir}/nvme/hostid ]; then + uuidgen > %{_sysconfdir}/nvme/hostid + fi +fi + + %changelog +* Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 +- Update to 2.0-rc8 +- Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) + * Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 - Update to 2.0-rc6 diff --git a/sources b/sources index 36fb6ae..f3b3363 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc6.tar.gz) = 00e0376f0a5b69c2a9192c8261da73492aeb6bfe19cd488382e18b50e247a4591b470349f42503bab5d4881c35a056a033213624503efa62de9f8e98dfe4b005 +SHA512 (nvme-cli-2.0-rc8.tar.gz) = ebb4dcca3c23d0f1e586a55a0ce9e0b885f96cefce64521aaeb5419ffcd67595b146496865fe09b2f69870ee7dc4583430178ac71f724278b233cc970d217163 From ea4b1fb2237e2faef5d0414e65a2940886c1da33 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 11 Apr 2022 14:22:07 +0200 Subject: [PATCH 06/52] * Mon Apr 11 2022 Tomas Bzatek - 2.0-1 - Update to 2.0 --- .gitignore | 1 + ...c9_fabrics_Do_not_free_static_string.patch | 84 ----------------- ...ect_even_when_no_hostnqn_file_exists.patch | 89 ------------------- nvme-cli.spec | 11 ++- sources | 2 +- 5 files changed, 7 insertions(+), 180 deletions(-) delete mode 100644 nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch delete mode 100644 nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch diff --git a/.gitignore b/.gitignore index e640b52..6d1a9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /nvme-cli-2.0-rc5.tar.gz /nvme-cli-2.0-rc6.tar.gz /nvme-cli-2.0-rc8.tar.gz +/nvme-cli-2.0.tar.gz diff --git a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch deleted file mode 100644 index 9ba6f26..0000000 --- a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch +++ /dev/null @@ -1,84 +0,0 @@ -commit 539cc29a7cb290523652ea0cdfe0afb1affd0bf4 -Author: Daniel Wagner -Date: Mon Apr 4 12:48:55 2022 +0200 - - fabrics: Do not free static string - - 38f5a54a7306 ("fabrics: Support connect even when no /etc/nvme/hostnqn - file exists") introduce a regression. arg_parser() might assign a - static string to hostnqn and/or hostid. Can't free this. - - Signed-off-by: Daniel Wagner - -diff --git a/fabrics.c b/fabrics.c -index 30388f2d..76d78a91 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -505,6 +505,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; - char *transport = NULL, *traddr = NULL, *trsvcid = NULL; - char *config_file = PATH_NVMF_CONFIG; -+ char *hnqn = NULL, *hid = NULL; - enum nvme_print_flags flags; - nvme_root_t r; - nvme_host_t h; -@@ -559,11 +560,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - set_discovery_kato(&cfg); - - if (!hostnqn) -- hostnqn = nvmf_hostnqn_from_file(); -+ hostnqn = hnqn = nvmf_hostnqn_from_file(); - if (!hostnqn) -- hostnqn = nvmf_hostnqn_generate(); -+ hostnqn = hnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = nvmf_hostid_from_file(); -+ hostid = hid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - ret = ENOMEM; -@@ -658,8 +659,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - out_free_ctrl: - nvme_free_ctrl(c); - out_free: -- free(hostnqn); -- free(hostid); -+ free(hnqn); -+ free(hid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); -@@ -673,6 +674,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) - char *transport = NULL, *traddr = NULL; - char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; - char *hostkey = NULL, *ctrlkey = NULL; -+ char *hnqn = NULL, *hid = NULL; - char *config_file = PATH_NVMF_CONFIG; - unsigned int verbose = 0; - nvme_root_t r; -@@ -746,11 +748,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) - nvme_read_config(r, config_file); - - if (!hostnqn) -- hostnqn = nvmf_hostnqn_from_file(); -+ hostnqn = hnqn = nvmf_hostnqn_from_file(); - if (!hostnqn) -- hostnqn = nvmf_hostnqn_generate(); -+ hostnqn = hnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = nvmf_hostid_from_file(); -+ hostid = hid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; -@@ -781,8 +783,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) - } - - out_free: -- free(hostnqn); -- free(hostid); -+ free(hnqn); -+ free(hid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); diff --git a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch deleted file mode 100644 index 5a80f40..0000000 --- a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch +++ /dev/null @@ -1,89 +0,0 @@ -commit 38f5a54a73069cb8a56564f0b80db99c48633723 -Author: Daniel Wagner -Date: Mon Apr 4 11:56:15 2022 +0200 - - fabrics: Support connect even when no /etc/nvme/hostnqn file exists - - The connect call will fail if there is no /etc/nvme/hostnqn file - available. The 1.x version did have a fallback mechanisme in place - when the config file was missing. - - Let's add this feature back by calling nvmf_hostnqn_generate() when - there is no /etc/nvme/hostnqn file. - - Signed-off-by: Daniel Wagner - -diff --git a/fabrics.c b/fabrics.c -index ef80ec0d..30388f2d 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -504,7 +504,6 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - char *subsysnqn = NVME_DISC_SUBSYS_NAME; - char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; - char *transport = NULL, *traddr = NULL, *trsvcid = NULL; -- char *hnqn = NULL, *hid = NULL; - char *config_file = PATH_NVMF_CONFIG; - enum nvme_print_flags flags; - nvme_root_t r; -@@ -560,9 +559,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - set_discovery_kato(&cfg); - - if (!hostnqn) -- hostnqn = hnqn = nvmf_hostnqn_from_file(); -+ hostnqn = nvmf_hostnqn_from_file(); -+ if (!hostnqn) -+ hostnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = hid = nvmf_hostid_from_file(); -+ hostid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - ret = ENOMEM; -@@ -657,10 +658,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - out_free_ctrl: - nvme_free_ctrl(c); - out_free: -- if (hnqn) -- free(hnqn); -- if (hid) -- free(hid); -+ free(hostnqn); -+ free(hostid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); -@@ -670,7 +669,6 @@ out_free: - - int nvmf_connect(const char *desc, int argc, char **argv) - { -- char *hnqn = NULL, *hid = NULL; - char *subsysnqn = NULL; - char *transport = NULL, *traddr = NULL; - char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; -@@ -748,9 +746,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) - nvme_read_config(r, config_file); - - if (!hostnqn) -- hostnqn = hnqn = nvmf_hostnqn_from_file(); -+ hostnqn = nvmf_hostnqn_from_file(); -+ if (!hostnqn) -+ hostnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = hid = nvmf_hostid_from_file(); -+ hostid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; -@@ -781,10 +781,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) - } - - out_free: -- if (hnqn) -- free(hnqn); -- if (hid) -- free(hid); -+ free(hostnqn); -+ free(hostid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); diff --git a/nvme-cli.spec b/nvme-cli.spec index 1ff06c9..688a6d7 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc8 +Version: 2.0 Release: 1%{?dist} Summary: NVMe management command line interface @@ -7,10 +7,6 @@ License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -# backport from upstream -Patch0: nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch -Patch1: nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch - BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ @@ -18,7 +14,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.0~rc8 +BuildRequires: libnvme-devel >= 1.0 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -89,6 +85,9 @@ fi %changelog +* Mon Apr 11 2022 Tomas Bzatek - 2.0-1 +- Update to 2.0 + * Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 - Update to 2.0-rc8 - Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) diff --git a/sources b/sources index f3b3363..2b256e1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc8.tar.gz) = ebb4dcca3c23d0f1e586a55a0ce9e0b885f96cefce64521aaeb5419ffcd67595b146496865fe09b2f69870ee7dc4583430178ac71f724278b233cc970d217163 +SHA512 (nvme-cli-2.0.tar.gz) = 24a00ee8e0fc963c1757797413ff5725cec18f821a714d6bbbf37906010d72934d6fdd7b466c085f13716a5279d1a7bd3254ee474e37a0ecd00a85ef23e12417 From 5d7a9ab7393dc004b5f6adeb2f876e7944d8b106 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 15 Mar 2022 16:23:19 +0100 Subject: [PATCH 07/52] * Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 - Update to 2.0-rc6 --- .gitignore | 1 + connect_return_code.patch | 25 +++++++++++++++++++++++++ nvme-cli.spec | 8 +++++++- sources | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 connect_return_code.patch diff --git a/.gitignore b/.gitignore index eb68f3e..fc50d23 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /v1.11.1.tar.gz /nvme-cli-2.0-rc4.tar.gz /nvme-cli-2.0-rc5.tar.gz +/nvme-cli-2.0-rc6.tar.gz diff --git a/connect_return_code.patch b/connect_return_code.patch new file mode 100644 index 0000000..07f1fc4 --- /dev/null +++ b/connect_return_code.patch @@ -0,0 +1,25 @@ +commit 9ec18159f75512687a3df22eee15fbafc4c87c9a +Author: Tomas Bzatek +Date: Mon Mar 14 18:15:20 2022 +0100 + + connect: Set errno to zero on nvmf_add_ctrl() success + + The libnvme's nvmf_add_ctrl() might return zero (success) while + having errno set to a non-zero value due to lots of calls inside. + And since nvmf_connect() returns errno primarily, make sure + it's zeroed on success. + + See related https://github.com/linux-nvme/libnvme/pull/292 + +diff --git a/fabrics.c b/fabrics.c +index 49378dc..e08ffd6 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -688,6 +688,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) + fprintf(stderr, "no controller found: %s\n", + nvme_strerror(errno)); + else { ++ errno = 0; + if (flags == NORMAL) + print_connect_msg(c); + else if (flags == JSON) diff --git a/nvme-cli.spec b/nvme-cli.spec index 82c5510..29840a3 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc5 +Version: 2.0~rc6 Release: 1%{?dist} Summary: NVMe management command line interface @@ -7,6 +7,9 @@ License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +# backport from upstream +Patch0: connect_return_code.patch + BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ @@ -74,6 +77,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 +- Update to 2.0-rc6 + * Fri Mar 04 2022 Tomas Bzatek - 2.0~rc5-1 - Update to 2.0-rc5 diff --git a/sources b/sources index 52eeb54..36fb6ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc5.tar.gz) = 499d1476aee77195f06aaaaf9543340605212554bbe731af8f03a62a221f26857f23e10dc2ef6e2555930b5e40601f64f01da303d91ed88d200ed11f94220e44 +SHA512 (nvme-cli-2.0-rc6.tar.gz) = 00e0376f0a5b69c2a9192c8261da73492aeb6bfe19cd488382e18b50e247a4591b470349f42503bab5d4881c35a056a033213624503efa62de9f8e98dfe4b005 From cf593b1d1d56e6856b1a4b1ae9a45a4877675064 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 4 Apr 2022 17:30:20 +0200 Subject: [PATCH 08/52] * Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 - Update to 2.0-rc8 - Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) --- .gitignore | 1 + connect_return_code.patch | 25 ------ ...c9_fabrics_Do_not_free_static_string.patch | 84 +++++++++++++++++ ...ect_even_when_no_hostnqn_file_exists.patch | 89 +++++++++++++++++++ nvme-cli.spec | 22 ++++- sources | 2 +- 6 files changed, 194 insertions(+), 29 deletions(-) delete mode 100644 connect_return_code.patch create mode 100644 nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch create mode 100644 nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch diff --git a/.gitignore b/.gitignore index fc50d23..e640b52 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /nvme-cli-2.0-rc4.tar.gz /nvme-cli-2.0-rc5.tar.gz /nvme-cli-2.0-rc6.tar.gz +/nvme-cli-2.0-rc8.tar.gz diff --git a/connect_return_code.patch b/connect_return_code.patch deleted file mode 100644 index 07f1fc4..0000000 --- a/connect_return_code.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 9ec18159f75512687a3df22eee15fbafc4c87c9a -Author: Tomas Bzatek -Date: Mon Mar 14 18:15:20 2022 +0100 - - connect: Set errno to zero on nvmf_add_ctrl() success - - The libnvme's nvmf_add_ctrl() might return zero (success) while - having errno set to a non-zero value due to lots of calls inside. - And since nvmf_connect() returns errno primarily, make sure - it's zeroed on success. - - See related https://github.com/linux-nvme/libnvme/pull/292 - -diff --git a/fabrics.c b/fabrics.c -index 49378dc..e08ffd6 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -688,6 +688,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) - fprintf(stderr, "no controller found: %s\n", - nvme_strerror(errno)); - else { -+ errno = 0; - if (flags == NORMAL) - print_connect_msg(c); - else if (flags == JSON) diff --git a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch new file mode 100644 index 0000000..9ba6f26 --- /dev/null +++ b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch @@ -0,0 +1,84 @@ +commit 539cc29a7cb290523652ea0cdfe0afb1affd0bf4 +Author: Daniel Wagner +Date: Mon Apr 4 12:48:55 2022 +0200 + + fabrics: Do not free static string + + 38f5a54a7306 ("fabrics: Support connect even when no /etc/nvme/hostnqn + file exists") introduce a regression. arg_parser() might assign a + static string to hostnqn and/or hostid. Can't free this. + + Signed-off-by: Daniel Wagner + +diff --git a/fabrics.c b/fabrics.c +index 30388f2d..76d78a91 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -505,6 +505,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; + char *transport = NULL, *traddr = NULL, *trsvcid = NULL; + char *config_file = PATH_NVMF_CONFIG; ++ char *hnqn = NULL, *hid = NULL; + enum nvme_print_flags flags; + nvme_root_t r; + nvme_host_t h; +@@ -559,11 +560,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + set_discovery_kato(&cfg); + + if (!hostnqn) +- hostnqn = nvmf_hostnqn_from_file(); ++ hostnqn = hnqn = nvmf_hostnqn_from_file(); + if (!hostnqn) +- hostnqn = nvmf_hostnqn_generate(); ++ hostnqn = hnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = nvmf_hostid_from_file(); ++ hostid = hid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + ret = ENOMEM; +@@ -658,8 +659,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + out_free_ctrl: + nvme_free_ctrl(c); + out_free: +- free(hostnqn); +- free(hostid); ++ free(hnqn); ++ free(hid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); +@@ -673,6 +674,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) + char *transport = NULL, *traddr = NULL; + char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; + char *hostkey = NULL, *ctrlkey = NULL; ++ char *hnqn = NULL, *hid = NULL; + char *config_file = PATH_NVMF_CONFIG; + unsigned int verbose = 0; + nvme_root_t r; +@@ -746,11 +748,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) + nvme_read_config(r, config_file); + + if (!hostnqn) +- hostnqn = nvmf_hostnqn_from_file(); ++ hostnqn = hnqn = nvmf_hostnqn_from_file(); + if (!hostnqn) +- hostnqn = nvmf_hostnqn_generate(); ++ hostnqn = hnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = nvmf_hostid_from_file(); ++ hostid = hid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + errno = ENOMEM; +@@ -781,8 +783,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) + } + + out_free: +- free(hostnqn); +- free(hostid); ++ free(hnqn); ++ free(hid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); diff --git a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch new file mode 100644 index 0000000..5a80f40 --- /dev/null +++ b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch @@ -0,0 +1,89 @@ +commit 38f5a54a73069cb8a56564f0b80db99c48633723 +Author: Daniel Wagner +Date: Mon Apr 4 11:56:15 2022 +0200 + + fabrics: Support connect even when no /etc/nvme/hostnqn file exists + + The connect call will fail if there is no /etc/nvme/hostnqn file + available. The 1.x version did have a fallback mechanisme in place + when the config file was missing. + + Let's add this feature back by calling nvmf_hostnqn_generate() when + there is no /etc/nvme/hostnqn file. + + Signed-off-by: Daniel Wagner + +diff --git a/fabrics.c b/fabrics.c +index ef80ec0d..30388f2d 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -504,7 +504,6 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + char *subsysnqn = NVME_DISC_SUBSYS_NAME; + char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; + char *transport = NULL, *traddr = NULL, *trsvcid = NULL; +- char *hnqn = NULL, *hid = NULL; + char *config_file = PATH_NVMF_CONFIG; + enum nvme_print_flags flags; + nvme_root_t r; +@@ -560,9 +559,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + set_discovery_kato(&cfg); + + if (!hostnqn) +- hostnqn = hnqn = nvmf_hostnqn_from_file(); ++ hostnqn = nvmf_hostnqn_from_file(); ++ if (!hostnqn) ++ hostnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = hid = nvmf_hostid_from_file(); ++ hostid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + ret = ENOMEM; +@@ -657,10 +658,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + out_free_ctrl: + nvme_free_ctrl(c); + out_free: +- if (hnqn) +- free(hnqn); +- if (hid) +- free(hid); ++ free(hostnqn); ++ free(hostid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); +@@ -670,7 +669,6 @@ out_free: + + int nvmf_connect(const char *desc, int argc, char **argv) + { +- char *hnqn = NULL, *hid = NULL; + char *subsysnqn = NULL; + char *transport = NULL, *traddr = NULL; + char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; +@@ -748,9 +746,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) + nvme_read_config(r, config_file); + + if (!hostnqn) +- hostnqn = hnqn = nvmf_hostnqn_from_file(); ++ hostnqn = nvmf_hostnqn_from_file(); ++ if (!hostnqn) ++ hostnqn = nvmf_hostnqn_generate(); + if (!hostid) +- hostid = hid = nvmf_hostid_from_file(); ++ hostid = nvmf_hostid_from_file(); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + errno = ENOMEM; +@@ -781,10 +781,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) + } + + out_free: +- if (hnqn) +- free(hnqn); +- if (hid) +- free(hid); ++ free(hostnqn); ++ free(hostid); + if (dump_config) + nvme_dump_config(r); + nvme_free_tree(r); diff --git a/nvme-cli.spec b/nvme-cli.spec index 29840a3..1ff06c9 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc6 +Version: 2.0~rc8 Release: 1%{?dist} Summary: NVMe management command line interface @@ -8,7 +8,8 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz # backport from upstream -Patch0: connect_return_code.patch +Patch0: nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch +Patch1: nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel @@ -17,7 +18,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.0~rc4 +BuildRequires: libnvme-devel >= 1.0~rc8 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -76,7 +77,22 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +%post +if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then + if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then + echo $(nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn + fi + if [ ! -s %{_sysconfdir}/nvme/hostid ]; then + uuidgen > %{_sysconfdir}/nvme/hostid + fi +fi + + %changelog +* Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 +- Update to 2.0-rc8 +- Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) + * Tue Mar 15 2022 Tomas Bzatek - 2.0~rc6-1 - Update to 2.0-rc6 diff --git a/sources b/sources index 36fb6ae..f3b3363 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc6.tar.gz) = 00e0376f0a5b69c2a9192c8261da73492aeb6bfe19cd488382e18b50e247a4591b470349f42503bab5d4881c35a056a033213624503efa62de9f8e98dfe4b005 +SHA512 (nvme-cli-2.0-rc8.tar.gz) = ebb4dcca3c23d0f1e586a55a0ce9e0b885f96cefce64521aaeb5419ffcd67595b146496865fe09b2f69870ee7dc4583430178ac71f724278b233cc970d217163 From 08d796bb5afd60606a67bea697825a10fbb03b37 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 11 Apr 2022 14:22:07 +0200 Subject: [PATCH 09/52] * Mon Apr 11 2022 Tomas Bzatek - 2.0-1 - Update to 2.0 --- .gitignore | 1 + ...c9_fabrics_Do_not_free_static_string.patch | 84 ----------------- ...ect_even_when_no_hostnqn_file_exists.patch | 89 ------------------- nvme-cli.spec | 11 ++- sources | 2 +- 5 files changed, 7 insertions(+), 180 deletions(-) delete mode 100644 nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch delete mode 100644 nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch diff --git a/.gitignore b/.gitignore index e640b52..6d1a9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /nvme-cli-2.0-rc5.tar.gz /nvme-cli-2.0-rc6.tar.gz /nvme-cli-2.0-rc8.tar.gz +/nvme-cli-2.0.tar.gz diff --git a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch b/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch deleted file mode 100644 index 9ba6f26..0000000 --- a/nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch +++ /dev/null @@ -1,84 +0,0 @@ -commit 539cc29a7cb290523652ea0cdfe0afb1affd0bf4 -Author: Daniel Wagner -Date: Mon Apr 4 12:48:55 2022 +0200 - - fabrics: Do not free static string - - 38f5a54a7306 ("fabrics: Support connect even when no /etc/nvme/hostnqn - file exists") introduce a regression. arg_parser() might assign a - static string to hostnqn and/or hostid. Can't free this. - - Signed-off-by: Daniel Wagner - -diff --git a/fabrics.c b/fabrics.c -index 30388f2d..76d78a91 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -505,6 +505,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; - char *transport = NULL, *traddr = NULL, *trsvcid = NULL; - char *config_file = PATH_NVMF_CONFIG; -+ char *hnqn = NULL, *hid = NULL; - enum nvme_print_flags flags; - nvme_root_t r; - nvme_host_t h; -@@ -559,11 +560,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - set_discovery_kato(&cfg); - - if (!hostnqn) -- hostnqn = nvmf_hostnqn_from_file(); -+ hostnqn = hnqn = nvmf_hostnqn_from_file(); - if (!hostnqn) -- hostnqn = nvmf_hostnqn_generate(); -+ hostnqn = hnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = nvmf_hostid_from_file(); -+ hostid = hid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - ret = ENOMEM; -@@ -658,8 +659,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - out_free_ctrl: - nvme_free_ctrl(c); - out_free: -- free(hostnqn); -- free(hostid); -+ free(hnqn); -+ free(hid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); -@@ -673,6 +674,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) - char *transport = NULL, *traddr = NULL; - char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; - char *hostkey = NULL, *ctrlkey = NULL; -+ char *hnqn = NULL, *hid = NULL; - char *config_file = PATH_NVMF_CONFIG; - unsigned int verbose = 0; - nvme_root_t r; -@@ -746,11 +748,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) - nvme_read_config(r, config_file); - - if (!hostnqn) -- hostnqn = nvmf_hostnqn_from_file(); -+ hostnqn = hnqn = nvmf_hostnqn_from_file(); - if (!hostnqn) -- hostnqn = nvmf_hostnqn_generate(); -+ hostnqn = hnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = nvmf_hostid_from_file(); -+ hostid = hid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; -@@ -781,8 +783,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) - } - - out_free: -- free(hostnqn); -- free(hostid); -+ free(hnqn); -+ free(hid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); diff --git a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch b/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch deleted file mode 100644 index 5a80f40..0000000 --- a/nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch +++ /dev/null @@ -1,89 +0,0 @@ -commit 38f5a54a73069cb8a56564f0b80db99c48633723 -Author: Daniel Wagner -Date: Mon Apr 4 11:56:15 2022 +0200 - - fabrics: Support connect even when no /etc/nvme/hostnqn file exists - - The connect call will fail if there is no /etc/nvme/hostnqn file - available. The 1.x version did have a fallback mechanisme in place - when the config file was missing. - - Let's add this feature back by calling nvmf_hostnqn_generate() when - there is no /etc/nvme/hostnqn file. - - Signed-off-by: Daniel Wagner - -diff --git a/fabrics.c b/fabrics.c -index ef80ec0d..30388f2d 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -504,7 +504,6 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - char *subsysnqn = NVME_DISC_SUBSYS_NAME; - char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL, *ctrlkey = NULL; - char *transport = NULL, *traddr = NULL, *trsvcid = NULL; -- char *hnqn = NULL, *hid = NULL; - char *config_file = PATH_NVMF_CONFIG; - enum nvme_print_flags flags; - nvme_root_t r; -@@ -560,9 +559,11 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - set_discovery_kato(&cfg); - - if (!hostnqn) -- hostnqn = hnqn = nvmf_hostnqn_from_file(); -+ hostnqn = nvmf_hostnqn_from_file(); -+ if (!hostnqn) -+ hostnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = hid = nvmf_hostid_from_file(); -+ hostid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - ret = ENOMEM; -@@ -657,10 +658,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - out_free_ctrl: - nvme_free_ctrl(c); - out_free: -- if (hnqn) -- free(hnqn); -- if (hid) -- free(hid); -+ free(hostnqn); -+ free(hostid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); -@@ -670,7 +669,6 @@ out_free: - - int nvmf_connect(const char *desc, int argc, char **argv) - { -- char *hnqn = NULL, *hid = NULL; - char *subsysnqn = NULL; - char *transport = NULL, *traddr = NULL; - char *trsvcid = NULL, *hostnqn = NULL, *hostid = NULL; -@@ -748,9 +746,11 @@ int nvmf_connect(const char *desc, int argc, char **argv) - nvme_read_config(r, config_file); - - if (!hostnqn) -- hostnqn = hnqn = nvmf_hostnqn_from_file(); -+ hostnqn = nvmf_hostnqn_from_file(); -+ if (!hostnqn) -+ hostnqn = nvmf_hostnqn_generate(); - if (!hostid) -- hostid = hid = nvmf_hostid_from_file(); -+ hostid = nvmf_hostid_from_file(); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; -@@ -781,10 +781,8 @@ int nvmf_connect(const char *desc, int argc, char **argv) - } - - out_free: -- if (hnqn) -- free(hnqn); -- if (hid) -- free(hid); -+ free(hostnqn); -+ free(hostid); - if (dump_config) - nvme_dump_config(r); - nvme_free_tree(r); diff --git a/nvme-cli.spec b/nvme-cli.spec index 1ff06c9..688a6d7 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.0~rc8 +Version: 2.0 Release: 1%{?dist} Summary: NVMe management command line interface @@ -7,10 +7,6 @@ License: GPLv2+ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -# backport from upstream -Patch0: nvme-cli-2.0-rc9_fabrics_Support_connect_even_when_no_hostnqn_file_exists.patch -Patch1: nvme-cli-2.0-rc9_fabrics_Do_not_free_static_string.patch - BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ @@ -18,7 +14,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.0~rc8 +BuildRequires: libnvme-devel >= 1.0 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -89,6 +85,9 @@ fi %changelog +* Mon Apr 11 2022 Tomas Bzatek - 2.0-1 +- Update to 2.0 + * Mon Apr 04 2022 Tomas Bzatek - 2.0~rc8-1 - Update to 2.0-rc8 - Added scriptlet to generate /etc/nvme/hostnqn and hostid files (#2065886) diff --git a/sources b/sources index f3b3363..2b256e1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0-rc8.tar.gz) = ebb4dcca3c23d0f1e586a55a0ce9e0b885f96cefce64521aaeb5419ffcd67595b146496865fe09b2f69870ee7dc4583430178ac71f724278b233cc970d217163 +SHA512 (nvme-cli-2.0.tar.gz) = 24a00ee8e0fc963c1757797413ff5725cec18f821a714d6bbbf37906010d72934d6fdd7b466c085f13716a5279d1a7bd3254ee474e37a0ecd00a85ef23e12417 From 629f632c97ab888f2ae3a8bc3eb2bacf0959dd2d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 15 Jul 2022 19:32:46 +0200 Subject: [PATCH 10/52] * Fri Jul 15 2022 Tomas Bzatek - 2.1~rc0-1 - Update to 2.1-rc0 - Drop the hostnqn generate scriptlet (#2065886) --- .gitignore | 1 + nvme-cli.spec | 23 +++++++++-------------- sources | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 6d1a9b5..e00e4ef 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /nvme-cli-2.0-rc6.tar.gz /nvme-cli-2.0-rc8.tar.gz /nvme-cli-2.0.tar.gz +/nvme-cli-2.1-rc0.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 688a6d7..8b46b16 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,9 +1,9 @@ Name: nvme-cli -Version: 2.0 +Version: 2.1~rc0 Release: 1%{?dist} Summary: NVMe management command line interface -License: GPLv2+ +License: GPLv2 URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz @@ -14,7 +14,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.0 +BuildRequires: libnvme-devel >= 1.1~rc0 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -42,6 +42,8 @@ nvme-cli provides NVM-Express user space tooling for Linux. # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. +# nvme-stas ships the stas-config@.service that will take care +# of generating these files if missing. See rhbz 2065886#c19 rm -f %{buildroot}%{_sysconfdir}/nvme/hostid rm -f %{buildroot}%{_sysconfdir}/nvme/hostnqn @@ -73,18 +75,11 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf -%post -if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then - if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then - echo $(nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn - fi - if [ ! -s %{_sysconfdir}/nvme/hostid ]; then - uuidgen > %{_sysconfdir}/nvme/hostid - fi -fi - - %changelog +* Fri Jul 15 2022 Tomas Bzatek - 2.1~rc0-1 +- Update to 2.1-rc0 +- Drop the hostnqn generate scriptlet (#2065886) + * Mon Apr 11 2022 Tomas Bzatek - 2.0-1 - Update to 2.0 diff --git a/sources b/sources index 2b256e1..b5e8f28 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.0.tar.gz) = 24a00ee8e0fc963c1757797413ff5725cec18f821a714d6bbbf37906010d72934d6fdd7b466c085f13716a5279d1a7bd3254ee474e37a0ecd00a85ef23e12417 +SHA512 (nvme-cli-2.1-rc0.tar.gz) = 5d1387435a71d6a95343749f9284552890c81250c158d1efa12977fa17111efaf1b144609622ea81afd1cbb34a051806eedaec45f29a23b32cb39259caf1c0af From 074769f664d2af7dccdc40f3708bbfffca9e85a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 00:58:36 +0000 Subject: [PATCH 11/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 8b46b16..aed36c5 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,6 +1,6 @@ Name: nvme-cli Version: 2.1~rc0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -76,6 +76,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 2.1~rc0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri Jul 15 2022 Tomas Bzatek - 2.1~rc0-1 - Update to 2.1-rc0 - Drop the hostnqn generate scriptlet (#2065886) From 311eb520bde762493743ab30ee25846d8c574256 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 5 Aug 2022 17:25:01 +0200 Subject: [PATCH 12/52] * Fri Aug 05 2022 Tomas Bzatek - 2.1.1-1 - Update to 2.1.1 --- .gitignore | 1 + nvme-cli.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e00e4ef..5d7db6f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /nvme-cli-2.0-rc8.tar.gz /nvme-cli-2.0.tar.gz /nvme-cli-2.1-rc0.tar.gz +/nvme-cli-2.1.1.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index aed36c5..18bfc32 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,6 +1,6 @@ Name: nvme-cli -Version: 2.1~rc0 -Release: 2%{?dist} +Version: 2.1.1 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -14,7 +14,7 @@ BuildRequires: systemd-devel BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.1~rc0 +BuildRequires: libnvme-devel >= 1.1 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy @@ -24,6 +24,7 @@ BuildRequires: python3-isort BuildRequires: asciidoc BuildRequires: xmlto +Requires: util-linux %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -76,6 +77,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Aug 05 2022 Tomas Bzatek - 2.1.1-1 +- Update to 2.1.1 + * Fri Jul 22 2022 Fedora Release Engineering - 2.1~rc0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index b5e8f28..1953084 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.1-rc0.tar.gz) = 5d1387435a71d6a95343749f9284552890c81250c158d1efa12977fa17111efaf1b144609622ea81afd1cbb34a051806eedaec45f29a23b32cb39259caf1c0af +SHA512 (nvme-cli-2.1.1.tar.gz) = 61a8e7c0ae8da082ac0cda2fdf61ffe8d83ed5d4ee31640bde89fde929ba3fe6d788950bd232630af2c7fc5f3563f05f47f350e005c8556691e5aede73c88d74 From ceb740cdddbebfda5b5803fec3676dba387c426a Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 19 Aug 2022 16:28:47 +0200 Subject: [PATCH 13/52] * Fri Aug 19 2022 Tomas Bzatek - 2.1.2-1 - Update to 2.1.2 --- .gitignore | 1 + nvme-cli.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5d7db6f..1c281ce 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /nvme-cli-2.0.tar.gz /nvme-cli-2.1-rc0.tar.gz /nvme-cli-2.1.1.tar.gz +/nvme-cli-2.1.2.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 18bfc32..0914874 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.1.1 +Version: 2.1.2 Release: 1%{?dist} Summary: NVMe management command line interface @@ -77,6 +77,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Aug 19 2022 Tomas Bzatek - 2.1.2-1 +- Update to 2.1.2 + * Fri Aug 05 2022 Tomas Bzatek - 2.1.1-1 - Update to 2.1.1 diff --git a/sources b/sources index 1953084..23e468f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.1.1.tar.gz) = 61a8e7c0ae8da082ac0cda2fdf61ffe8d83ed5d4ee31640bde89fde929ba3fe6d788950bd232630af2c7fc5f3563f05f47f350e005c8556691e5aede73c88d74 +SHA512 (nvme-cli-2.1.2.tar.gz) = 2162a6967a221a4ae7e0261748c26a10ff43d5b592039e29578d8310cf176428d528c2d510c0b58419b70bd6d28f4d2c77f0cd27606d87079c64289d5d14f930 From 1e7f7af0841ddace501d518c3aa78e3e42a78f27 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 19 Aug 2022 17:15:32 +0200 Subject: [PATCH 14/52] Require systemd-rpm-macros --- nvme-cli.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nvme-cli.spec b/nvme-cli.spec index 0914874..c3bacd7 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -11,6 +11,7 @@ BuildRequires: meson >= 0.47.0 BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel From 6b68767989bbbc679cb2f4e1d3e30b12418bba01 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 19 Aug 2022 18:02:26 +0200 Subject: [PATCH 15/52] * Fri Aug 19 2022 Tomas Bzatek - 2.0-2 - Fix bash completion (#2115983) --- nvme-cli.spec | 12 +++- ...better_fix_for_readonly_with_bash_5x.patch | 33 ++++++++++ ...on.sh_fixed_error_when_sourced_twice.patch | 25 +++++++ ...on.sh_fixed_typo_with_seagate_plugin.patch | 23 +++++++ ...declaration_and_attribute_assignment.patch | 66 +++++++++++++++++++ 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 nvme-cli_2.1-bash-nvme-completion.sh_a_better_fix_for_readonly_with_bash_5x.patch create mode 100644 nvme-cli_2.1-bash-nvme-completion.sh_fixed_error_when_sourced_twice.patch create mode 100644 nvme-cli_2.1-bash-nvme-completion.sh_fixed_typo_with_seagate_plugin.patch create mode 100644 nvme-cli_2.1-completions_Collapse_declaration_and_attribute_assignment.patch diff --git a/nvme-cli.spec b/nvme-cli.spec index 688a6d7..d2516c4 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,6 +1,6 @@ Name: nvme-cli Version: 2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPLv2+ @@ -24,6 +24,13 @@ BuildRequires: python3-isort BuildRequires: asciidoc BuildRequires: xmlto +# https://bugzilla.redhat.com/show_bug.cgi?id=2115983 +# backport of bash completion fixes from git master +Patch0: nvme-cli_2.1-completions_Collapse_declaration_and_attribute_assignment.patch +Patch1: nvme-cli_2.1-bash-nvme-completion.sh_fixed_error_when_sourced_twice.patch +Patch2: nvme-cli_2.1-bash-nvme-completion.sh_fixed_typo_with_seagate_plugin.patch +Patch3: nvme-cli_2.1-bash-nvme-completion.sh_a_better_fix_for_readonly_with_bash_5x.patch + %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -85,6 +92,9 @@ fi %changelog +* Fri Aug 19 2022 Tomas Bzatek - 2.0-2 +- Fix bash completion (#2115983) + * Mon Apr 11 2022 Tomas Bzatek - 2.0-1 - Update to 2.0 diff --git a/nvme-cli_2.1-bash-nvme-completion.sh_a_better_fix_for_readonly_with_bash_5x.patch b/nvme-cli_2.1-bash-nvme-completion.sh_a_better_fix_for_readonly_with_bash_5x.patch new file mode 100644 index 0000000..60eca5a --- /dev/null +++ b/nvme-cli_2.1-bash-nvme-completion.sh_a_better_fix_for_readonly_with_bash_5x.patch @@ -0,0 +1,33 @@ +From 86b73b3136ec96dd3eefd5a721744ed2d6d7bd41 Mon Sep 17 00:00:00 2001 +From: Evgeny Grin +Date: Fri, 17 Jun 2022 15:00:39 +0300 +Subject: [PATCH] bash-nvme-completion.sh: a better fix for "readonly" with + bash 5.x + +The error with one-line "readonly" with assignment on bash 5.x was fixed +by 25fd8c707b106ca0763402566ad657ef710bf09e. This commit restores "readonly" +functionality and adds some uniformity. +--- + completions/bash-nvme-completion.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh +index 00593b96a..e8177018a 100644 +--- a/completions/bash-nvme-completion.sh ++++ b/completions/bash-nvme-completion.sh +@@ -55,6 +55,7 @@ typeset -Ar _plugin_subcmds=( + [nvidia]="id-ctrl" + [ymtc]="smart-log-add" + ) ++readonly _plugin_subcmds + + # Associative array mapping plugins to coresponding option completions + typeset -Ar _plugin_funcs=( +@@ -75,6 +76,7 @@ typeset -Ar _plugin_funcs=( + [nvidia]="plugin_nvidia_opts" + [ymtc]="plugin_ymtc_opts" + ) ++readonly _plugin_funcs + + # Top level commands + _cmds="list list-subsys id-ctrl id-ns \ diff --git a/nvme-cli_2.1-bash-nvme-completion.sh_fixed_error_when_sourced_twice.patch b/nvme-cli_2.1-bash-nvme-completion.sh_fixed_error_when_sourced_twice.patch new file mode 100644 index 0000000..e513247 --- /dev/null +++ b/nvme-cli_2.1-bash-nvme-completion.sh_fixed_error_when_sourced_twice.patch @@ -0,0 +1,25 @@ +From eac9f9b70081ff2df2e2ea11efb8fc6ec3754f64 Mon Sep 17 00:00:00 2001 +From: Evgeny Grin +Date: Fri, 17 Jun 2022 15:00:39 +0300 +Subject: [PATCH] bash-nvme-completion.sh: fixed error when sourced twice + +One-line "readonly" with assignment produce error if completion file +is sourced for the second time (/etc/profile reload, su etc.) +--- + completions/bash-nvme-completion.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh +index e5d9ff190..7b8a2121d 100644 +--- a/completions/bash-nvme-completion.sh ++++ b/completions/bash-nvme-completion.sh +@@ -5,7 +5,8 @@ + # Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015 + + # Constant to indicate command has no options +-readonly NO_OPTS="" ++NO_OPTS="" ++readonly NO_OPTS + + # Associative array of plugins and associated subcommands + # Order here is same as PLUGIN_OBJS in Makefile diff --git a/nvme-cli_2.1-bash-nvme-completion.sh_fixed_typo_with_seagate_plugin.patch b/nvme-cli_2.1-bash-nvme-completion.sh_fixed_typo_with_seagate_plugin.patch new file mode 100644 index 0000000..84bcd87 --- /dev/null +++ b/nvme-cli_2.1-bash-nvme-completion.sh_fixed_typo_with_seagate_plugin.patch @@ -0,0 +1,23 @@ +From 4284d4cc299e8604f898856bdd38fc4979e56586 Mon Sep 17 00:00:00 2001 +From: Evgeny Grin +Date: Fri, 17 Jun 2022 15:08:02 +0300 +Subject: [PATCH] bash-nvme-completion.sh: fixed typo with seagate plugin + +Obvious typo resulted in broken completion for seagete plugin +--- + completions/bash-nvme-completion.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh +index 7b8a2121d..00593b96a 100644 +--- a/completions/bash-nvme-completion.sh ++++ b/completions/bash-nvme-completion.sh +@@ -940,7 +940,7 @@ plugin_micron_opts () { + return 0 + } + +-lugin_seagate_opts () { ++plugin_seagate_opts () { + local opts="" + local compargs="" + diff --git a/nvme-cli_2.1-completions_Collapse_declaration_and_attribute_assignment.patch b/nvme-cli_2.1-completions_Collapse_declaration_and_attribute_assignment.patch new file mode 100644 index 0000000..12268f9 --- /dev/null +++ b/nvme-cli_2.1-completions_Collapse_declaration_and_attribute_assignment.patch @@ -0,0 +1,66 @@ +From 25fd8c707b106ca0763402566ad657ef710bf09e Mon Sep 17 00:00:00 2001 +From: Brad Mouring +Date: Mon, 2 May 2022 22:38:24 -0500 +Subject: [PATCH] completions: Collapse declaration and attribute assignment + +Previously, the associative arrays for the vendor/subcommands and +vendor/functions listings were split into a declaration of type +(using "typeset") and attribute definition (using "readonly"). On +bash 5.1.16 (at least), this lead to the following error (reported +after enabling -xv to expand and print shell inputs) + + ... + + . /usr/share/bash-completion/completions/nvme + # bash tab completion for the nvme command line utility + # (unfortunately, bash won't let me add descriptions to cmds) + # Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015 + + # Constant to indicate command has no options + readonly NO_OPTS="" + ++ readonly NO_OPTS= + ++ NO_OPTS= + + # Associative array of plugins and associated subcommands + # Order here is same as PLUGIN_OBJS in Makefile + typeset -A _plugin_subcmds + ++ typeset -A _plugin_subcmds + readonly _plugin_subcmds=( + [intel]="id-ctrl internal-log lat-stats \ + ... + ++ _plugin_subcmds=(['intel']='id-ctrl internal-log lat-stats... + bash: 'intel': syntax error: operand expected (error token is "'intel'") + ... + +Using the available flags for "typeset" to declare the variables as +readonly arrays resolved the issue (and allows for bash completion +to work as-expected) + +Signed-off-by: Brad Mouring +--- + completions/bash-nvme-completion.sh | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh +index 5e0eb23bb..51931bc19 100644 +--- a/completions/bash-nvme-completion.sh ++++ b/completions/bash-nvme-completion.sh +@@ -7,8 +7,7 @@ readonly NO_OPTS="" + + # Associative array of plugins and associated subcommands + # Order here is same as PLUGIN_OBJS in Makefile +-typeset -A _plugin_subcmds +-readonly _plugin_subcmds=( ++typeset -Ar _plugin_subcmds=( + [intel]="id-ctrl internal-log lat-stats \ + set-bucket-thresholds lat-stats-tracking \ + market-name smart-log-add temp-stats" +@@ -55,8 +54,7 @@ readonly _plugin_subcmds=( + ) + + # Associative array mapping plugins to coresponding option completions +-typeset -A _plugin_funcs +-readonly _plugin_funcs=( ++typeset -Ar _plugin_funcs=( + [intel]="plugin_intel_opts" + [amzn]="plugin_amzn_opts" + [memblaze]="plugin_memblaze_opts" From 349f559f2bf5ad9106ad83a2bf5628b1cc864968 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 1 Nov 2022 14:40:37 +0100 Subject: [PATCH 16/52] * Tue Nov 01 2022 Tomas Bzatek - 2.2-1 - Update to 2.2 --- .gitignore | 1 + nvme-cli.spec | 10 ++++++---- sources | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1c281ce..9398b26 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /nvme-cli-2.1-rc0.tar.gz /nvme-cli-2.1.1.tar.gz /nvme-cli-2.1.2.tar.gz +/nvme-cli-2.2.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index c3bacd7..de9f1ca 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,5 +1,5 @@ Name: nvme-cli -Version: 2.1.2 +Version: 2.2 Release: 1%{?dist} Summary: NVMe management command line interface @@ -7,8 +7,7 @@ License: GPLv2 URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -BuildRequires: meson >= 0.47.0 -BuildRequires: libuuid-devel +BuildRequires: meson >= 0.48.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros @@ -41,6 +40,7 @@ nvme-cli provides NVM-Express user space tooling for Linux. %install %meson_install +%{__install} -pm 644 README.md %{buildroot}%{_pkgdocdir} # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -59,7 +59,6 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %files %license LICENSE -%doc README.md %doc %{_pkgdocdir} %{_sbindir}/nvme %{_mandir}/man1/nvme*.gz @@ -78,6 +77,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Nov 01 2022 Tomas Bzatek - 2.2-1 +- Update to 2.2 + * Fri Aug 19 2022 Tomas Bzatek - 2.1.2-1 - Update to 2.1.2 diff --git a/sources b/sources index 23e468f..a062355 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.1.2.tar.gz) = 2162a6967a221a4ae7e0261748c26a10ff43d5b592039e29578d8310cf176428d528c2d510c0b58419b70bd6d28f4d2c77f0cd27606d87079c64289d5d14f930 +SHA512 (nvme-cli-2.2.tar.gz) = a3f572bb1bbd4ba56eb3a4c1e1aa95c4ed5e7bc1d5adb80125fe54a894c470838cad5457a0420692deb39f4302cefc4fc1eab92c08c134faabe03a654b9542f4 From 71457a08c3718a3dc0e127ab9d1a76daa6b0a561 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 1 Nov 2022 14:52:09 +0100 Subject: [PATCH 17/52] Requires libnvme-devel-1.2 Although not required by meson, compilation actually fails on removed uuid symbols. --- nvme-cli.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index de9f1ca..a81f08f 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -14,7 +14,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.1 +BuildRequires: libnvme-devel >= 1.2 BuildRequires: json-c-devel >= 0.14 BuildRequires: python3-nose2 BuildRequires: python3-mypy From e2153a0191d7815b295f4fc1dd47f1294365a7db Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 1 Nov 2022 15:43:48 +0100 Subject: [PATCH 18/52] Require libuuid Also libuuid seems to be still in use despite the release notes and the meson requirements state otherwise. --- nvme-cli.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nvme-cli.spec b/nvme-cli.spec index a81f08f..338b03a 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -8,6 +8,7 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz BuildRequires: meson >= 0.48.0 +BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros From 20edefb1c0fba3ce9b652907c13f67fe6fd00e6e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 1 Nov 2022 17:05:47 +0100 Subject: [PATCH 19/52] CentOS Stream 8+9 compability It is still possible to build this package for RHEL/CentOS (Stream) 8 and 9 given that recent libnvme is built the same way (e.g. in Copr). --- nvme-cli.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 338b03a..98cfccf 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,3 +1,6 @@ +# RHEL 8 compatibility +%{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} + Name: nvme-cli Version: 2.2 Release: 1%{?dist} @@ -16,12 +19,15 @@ BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: libnvme-devel >= 1.2 -BuildRequires: json-c-devel >= 0.14 +BuildRequires: json-c-devel >= 0.13 + +%if (0%{?rhel} == 0) BuildRequires: python3-nose2 BuildRequires: python3-mypy BuildRequires: python3-flake8 BuildRequires: python3-autopep8 BuildRequires: python3-isort +%endif BuildRequires: asciidoc BuildRequires: xmlto From f5a97bd483b7abaef4b0fd3aff3a854ce362f5e0 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 4 Nov 2022 17:31:58 +0100 Subject: [PATCH 20/52] * Fri Nov 04 2022 Tomas Bzatek - 2.2.1-1 - Update to 2.2.1 --- .gitignore | 1 + nvme-cli.spec | 6 ++++-- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9398b26..702e65f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /nvme-cli-2.1.1.tar.gz /nvme-cli-2.1.2.tar.gz /nvme-cli-2.2.tar.gz +/nvme-cli-2.2.1.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 98cfccf..390dfba 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,7 +2,7 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.2 +Version: 2.2.1 Release: 1%{?dist} Summary: NVMe management command line interface @@ -11,7 +11,6 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz BuildRequires: meson >= 0.48.0 -BuildRequires: libuuid-devel BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros @@ -84,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Nov 04 2022 Tomas Bzatek - 2.2.1-1 +- Update to 2.2.1 + * Tue Nov 01 2022 Tomas Bzatek - 2.2-1 - Update to 2.2 diff --git a/sources b/sources index a062355..4ca9056 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.2.tar.gz) = a3f572bb1bbd4ba56eb3a4c1e1aa95c4ed5e7bc1d5adb80125fe54a894c470838cad5457a0420692deb39f4302cefc4fc1eab92c08c134faabe03a654b9542f4 +SHA512 (nvme-cli-2.2.1.tar.gz) = 8efa94d49a4d443cdb0310386733e88117f17719b05044f11e63e2a09143fce55918171b457a467371263ebb2e36552558aad249ae4dbd27941af79fe9722e26 From fad149c74cd166b2f41f585ff32a43c21aff8881 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 21:55:29 +0000 Subject: [PATCH 21/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 390dfba..1a9476a 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -83,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 2.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Nov 04 2022 Tomas Bzatek - 2.2.1-1 - Update to 2.2.1 From 430ad218e61c7cc8b710babe6f9f3c483f7b5f92 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 1 Feb 2023 12:08:41 +0100 Subject: [PATCH 22/52] * Wed Feb 01 2023 Tomas Bzatek - 2.3-1 - Update to 2.3 --- .gitignore | 1 + nvme-cli.spec | 11 +++++++---- sources | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 702e65f..57b4e2e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /nvme-cli-2.1.2.tar.gz /nvme-cli-2.2.tar.gz /nvme-cli-2.2.1.tar.gz +/nvme-cli-2.3.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 1a9476a..f40b989 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,22 +2,22 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.2.1 -Release: 2%{?dist} +Version: 2.3 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2 URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -BuildRequires: meson >= 0.48.0 +BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.2 +BuildRequires: libnvme-devel >= 1.3 BuildRequires: json-c-devel >= 0.13 %if (0%{?rhel} == 0) @@ -83,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Wed Feb 01 2023 Tomas Bzatek - 2.3-1 +- Update to 2.3 + * Thu Jan 19 2023 Fedora Release Engineering - 2.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 4ca9056..e16fa7e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.2.1.tar.gz) = 8efa94d49a4d443cdb0310386733e88117f17719b05044f11e63e2a09143fce55918171b457a467371263ebb2e36552558aad249ae4dbd27941af79fe9722e26 +SHA512 (nvme-cli-2.3.tar.gz) = 9ef654e782ba737d3858fb11f24caf27aea820480179d07d32599731be204e52693062cdb86786ab5cdd1d94fe32ae9028baa0a58693d2eaee5a2b71155e3db2 From c34515574f7a609d84fc6558b452344a961abcc0 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 3 Apr 2023 16:15:39 +0200 Subject: [PATCH 23/52] * Mon Apr 03 2023 Tomas Bzatek - 2.4-1 - Update to 2.4 --- .gitignore | 1 + nvme-cli.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 57b4e2e..5add3b2 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /nvme-cli-2.2.tar.gz /nvme-cli-2.2.1.tar.gz /nvme-cli-2.3.tar.gz +/nvme-cli-2.4.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index f40b989..fd84a01 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,7 +2,7 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.3 +Version: 2.4 Release: 1%{?dist} Summary: NVMe management command line interface @@ -17,7 +17,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.3 +BuildRequires: libnvme-devel >= 1.4 BuildRequires: json-c-devel >= 0.13 %if (0%{?rhel} == 0) @@ -83,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Mon Apr 03 2023 Tomas Bzatek - 2.4-1 +- Update to 2.4 + * Wed Feb 01 2023 Tomas Bzatek - 2.3-1 - Update to 2.3 diff --git a/sources b/sources index e16fa7e..edbc0db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.3.tar.gz) = 9ef654e782ba737d3858fb11f24caf27aea820480179d07d32599731be204e52693062cdb86786ab5cdd1d94fe32ae9028baa0a58693d2eaee5a2b71155e3db2 +SHA512 (nvme-cli-2.4.tar.gz) = 155667a0b91e15267e3f991a30cf1d4ae26cb4c53b20c002e3d3341496dd463397e1afbfefcd7a8df88370d28417940ce44a060bda87c04482bbe3be4e901b73 From 986ba7710f55c9e651366d774fe009ff3c0bc21f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 20 Apr 2023 16:11:25 +0200 Subject: [PATCH 24/52] * Thu Apr 20 2023 Tomas Bzatek - 2.4-2 - Backport the NBFT support from git master --- ...bft-make-lookup_ctrl-function-public.patch | 75 ++ nvme-cli-2.5-nbft.patch | 451 ++++++++++++ nvme-cli-2.5-nbft_plugin.patch | 640 ++++++++++++++++++ nvme-cli.spec | 11 +- 4 files changed, 1175 insertions(+), 2 deletions(-) create mode 100644 nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch create mode 100644 nvme-cli-2.5-nbft.patch create mode 100644 nvme-cli-2.5-nbft_plugin.patch diff --git a/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch b/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch new file mode 100644 index 0000000..78529b9 --- /dev/null +++ b/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch @@ -0,0 +1,75 @@ +From 34c197e0ac2d57734ab775f00b2d0758aca7b82f Mon Sep 17 00:00:00 2001 +From: John Meneghini +Date: Fri, 14 Apr 2023 10:53:58 -0400 +Subject: [PATCH 01/11] nbft: make lookup_ctrl function public + +To prepare for the addition of nbft functionality fixup the fabrics +declarations. + +Signed-off-by: John Meneghini +--- + fabrics.c | 12 ++---------- + fabrics.h | 10 ++++++++++ + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/fabrics.c b/fabrics.c +index f8078e59..80827b16 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -43,6 +43,7 @@ + #include "libnvme.h" + #include "nvme-print.h" + #include "nvme-print-json.h" ++#include "fabrics.h" + + #define PATH_NVMF_DISC SYSCONFDIR "/nvme/discovery.conf" + #define PATH_NVMF_CONFIG SYSCONFDIR "/nvme/config.json" +@@ -110,15 +111,6 @@ static const char *nvmf_config_file = "Use specified JSON configuration file or + OPT_FLAG("data-digest", 'G', &c.data_digest, nvmf_data_digest), \ + OPT_FLAG("tls", 0, &c.tls, nvmf_tls) \ + +-struct tr_config { +- const char *subsysnqn; +- const char *transport; +- const char *traddr; +- const char *host_traddr; +- const char *host_iface; +- const char *trsvcid; +-}; +- + /* + * Compare two C strings and handle NULL pointers gracefully. + * If either of the two strings is NULL, return 0 +@@ -202,7 +194,7 @@ static nvme_ctrl_t lookup_discovery_ctrl(nvme_root_t r, struct tr_config *trcfg) + return __lookup_ctrl(r, trcfg, disc_ctrl_config_match); + } + +-static nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg) ++nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg) + { + return __lookup_ctrl(r, trcfg, ctrl_config_match); + } +diff --git a/fabrics.h b/fabrics.h +index d1e16fc5..02cebf5d 100644 +--- a/fabrics.h ++++ b/fabrics.h +@@ -2,6 +2,16 @@ + #ifndef _FABRICS_H + #define _FABRICS_H + ++struct tr_config { ++ const char *subsysnqn; ++ const char *transport; ++ const char *traddr; ++ const char *host_traddr; ++ const char *host_iface; ++ const char *trsvcid; ++}; ++ ++extern nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg); + extern int nvmf_discover(const char *desc, int argc, char **argv, bool connect); + extern int nvmf_connect(const char *desc, int argc, char **argv); + extern int nvmf_disconnect(const char *desc, int argc, char **argv); +-- +2.39.2 + diff --git a/nvme-cli-2.5-nbft.patch b/nvme-cli-2.5-nbft.patch new file mode 100644 index 0000000..e54da19 --- /dev/null +++ b/nvme-cli-2.5-nbft.patch @@ -0,0 +1,451 @@ +From a71a08532b5f06ee19ee2ff118a23cec4ecb6719 Mon Sep 17 00:00:00 2001 +From: Stuart Hayes +Date: Wed, 15 Jun 2022 11:42:50 -0500 +Subject: [PATCH 02/11] nbft: added NBFT v1.0 table support + +Added support for parsing the contents of the NBFT table (per NVMe-oF +boot specification v1.0) with the connect-all and discover commands. + +nvme discover/connect-all --nbft ignore /etc/nvme config and use NBFT tables +nvme discover/connect-all --no-nbft ignore NBFT tables and use /etc/nvme config +nvme discover/connect-all --nbft-path= user-defined path for NBFT tables + +Signed-off-by: Stuart Hayes +Signed-off-by: Martin Belanger + +Use the new nbft public API. + +Signed-off-by: Tomas Bzatek +Signed-off-by: Martin Wilck +Signed-off-by: John Meneghini +--- + Documentation/nvme-connect-all.txt | 25 ++++ + Documentation/nvme-discover.txt | 27 +++- + fabrics.c | 17 +++ + meson.build | 1 + + nbft.c | 202 +++++++++++++++++++++++++++++ + nbft.h | 19 +++ + 6 files changed, 290 insertions(+), 1 deletion(-) + create mode 100644 nbft.c + create mode 100644 nbft.h + +diff --git a/Documentation/nvme-connect-all.txt b/Documentation/nvme-connect-all.txt +index 44bb4f94..cbb7ca6c 100644 +--- a/Documentation/nvme-connect-all.txt ++++ b/Documentation/nvme-connect-all.txt +@@ -35,6 +35,9 @@ SYNOPSIS + [--tls ] + [--quiet | -S] + [--dump-config | -O] ++ [--nbft] ++ [--no-nbft] ++ [--nbft-path=] + + DESCRIPTION + ----------- +@@ -198,6 +201,16 @@ OPTIONS + --dump-config:: + Print out resulting JSON configuration file to stdout. + ++--nbft:: ++ Only look at NBFT tables ++ ++--no-nbft:: ++ Do not look at NBFT tables ++ ++--nbft-path=:: ++ Use a user-defined path to the NBFT tables ++ ++ + + EXAMPLES + -------- +@@ -210,6 +223,18 @@ the RDMA network. Port 4420 is used by default: + --hostnqn=host1-rogue-nqn + ------------ + + ++* Issue a 'nvme connect-all' command using the default system defined NBFT tables: +++ ++----------- ++# nvme connect-all --nbft ++------------ +++ ++* Issue a 'nvme connect-all' command with a user-defined path for the NBFT table: +++ ++----------- ++# nvme connet-all --nbft-path=/sys/firmware/acpi/tables/NBFT1 ++------------ +++ + * Issue a 'nvme connect-all' command using a @SYSCONFDIR@/nvme/discovery.conf file: + + + ----------- +diff --git a/Documentation/nvme-discover.txt b/Documentation/nvme-discover.txt +index d4df75c2..b040c688 100644 +--- a/Documentation/nvme-discover.txt ++++ b/Documentation/nvme-discover.txt +@@ -37,6 +37,9 @@ SYNOPSIS + [--dump-config | -O] + [--output-format= | -o ] + [--force] ++ [--nbft] ++ [--no-nbft] ++ [--nbft-path=] + + DESCRIPTION + ----------- +@@ -68,7 +71,7 @@ Note that the base NVMe specification defines the NQN (NVMe Qualified + Name) format which an NVMe endpoint (device, subsystem, etc) must + follow to guarantee a unique name under the NVMe standard. + In particular, the Host NQN uniquely identifies the NVMe Host, and +-may be used by the the Discovery Controller to control what NVMe Target ++may be used by the Discovery Controller to control what NVMe Target + resources are allocated to the NVMe Host for a connection. + + A Discovery Controller has it's own NQN defined in the NVMe-over-Fabrics +@@ -229,6 +232,16 @@ OPTIONS + Combined with --persistent flag, always create new + persistent discovery connection. + ++--nbft:: ++ Only look at NBFT tables ++ ++--no-nbft:: ++ Do not look at NBFT tables ++ ++--nbft-path=:: ++ Use a user-defined path to the NBFT tables ++ ++ + EXAMPLES + -------- + * Query the Discover Controller with IP4 address 192.168.1.3 for all +@@ -240,6 +253,18 @@ Port 4420 is used by default: + --hostnqn=host1-rogue-nqn + ------------ + + ++* Issue a 'nvme discover' command using the default system defined NBFT tables: +++ ++----------- ++# nvme discover --nbft ++------------ +++ ++* Issue a 'nvme discover' command with a user-defined path for the NBFT table: +++ ++----------- ++# nvme discover --nbft-path=/sys/firmware/acpi/tables/NBFT1 ++------------ +++ + * Issue a 'nvme discover' command using a @SYSCONFDIR@/nvme/discovery.conf file: + + + ----------- +diff --git a/fabrics.c b/fabrics.c +index 80827b16..0edbd299 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -40,6 +40,7 @@ + + #include "common.h" + #include "nvme.h" ++#include "nbft.h" + #include "libnvme.h" + #include "nvme-print.h" + #include "nvme-print-json.h" +@@ -710,6 +711,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + { + char *subsysnqn = NVME_DISC_SUBSYS_NAME; + char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL; ++ char *hostnqn_arg, *hostid_arg; + char *transport = NULL, *traddr = NULL, *trsvcid = NULL; + char *config_file = PATH_NVMF_CONFIG; + char *hnqn = NULL, *hid = NULL; +@@ -724,6 +726,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + char *device = NULL; + bool force = false; + bool json_config = false; ++ bool nbft = false, nonbft = false; ++ char *nbft_path = NBFT_SYSFS_PATH; + + OPT_ARGS(opts) = { + OPT_STRING("device", 'd', "DEV", &device, "use existing discovery controller device"), +@@ -736,6 +740,9 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"), + OPT_FLAG("dump-config", 'O', &dump_config, "Dump configuration file to stdout"), + OPT_FLAG("force", 0, &force, "Force persistent discovery controller creation"), ++ OPT_FLAG("nbft", 0, &nbft, "Only look at NBFT tables"), ++ OPT_FLAG("no-nbft", 0, &nonbft, "Do not look at NBFT tables"), ++ OPT_STRING("nbft-path", 0, "STR", &nbft_path, "user-defined path for NBFT tables"), + OPT_END() + }; + +@@ -768,6 +775,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + if (!nvme_read_config(r, config_file)) + json_config = true; + ++ hostnqn_arg = hostnqn; ++ hostid_arg = hostid; + if (!hostnqn) + hostnqn = hnqn = nvmf_hostnqn_from_file(); + if (!hostnqn) +@@ -789,6 +798,14 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + nvme_host_set_dhchap_key(h, hostkey); + + if (!device && !transport && !traddr) { ++ if (!nonbft) ++ discover_from_nbft(r, hostnqn_arg, hostid_arg, ++ hostnqn, hostid, desc, connect, ++ &cfg, nbft_path, flags, verbose); ++ ++ if (nbft) ++ goto out_free; ++ + if (json_config) + ret = discover_from_json_config_file(r, h, desc, + connect, &cfg, +diff --git a/meson.build b/meson.build +index 43ce5f9b..7ec357a9 100644 +--- a/meson.build ++++ b/meson.build +@@ -240,6 +240,7 @@ incdir = include_directories(['ccan']) + + ################################################################################ + sources = [ ++ 'nbft.c', + 'fabrics.c', + 'nvme.c', + 'nvme-models.c', +diff --git a/nbft.c b/nbft.c +new file mode 100644 +index 00000000..14347287 +--- /dev/null ++++ b/nbft.c +@@ -0,0 +1,202 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++#include ++#include ++#include ++ ++#include "nvme.h" ++#include "nbft.h" ++#include "libnvme.h" ++#include "fabrics.h" ++ ++#define NBFT_SYSFS_FILENAME "NBFT*" ++ ++static void print_connect_msg(nvme_ctrl_t c) ++{ ++ printf("device: %s\n", nvme_ctrl_get_name(c)); ++} ++ ++static void json_connect_msg(nvme_ctrl_t c) ++{ ++ struct json_object *root; ++ ++ root = json_create_object(); ++ json_object_add_value_string(root, "device", nvme_ctrl_get_name(c)); ++ ++ json_print_object(root, NULL); ++ printf("\n"); ++ json_free_object(root); ++} ++ ++int nbft_filter(const struct dirent *dent) ++{ ++ return !fnmatch(NBFT_SYSFS_FILENAME, dent->d_name, FNM_PATHNAME); ++} ++ ++int read_nbft_files(struct list_head *nbft_list, char *path) ++{ ++ struct dirent **dent; ++ char filename[PATH_MAX]; ++ int i, count, ret; ++ struct nbft_file_entry *entry; ++ struct nbft_info *nbft; ++ ++ count = scandir(path, &dent, nbft_filter, NULL); ++ if (count < 0) { ++ fprintf(stderr, "Failed to open %s.\n", path); ++ return -1; ++ } ++ ++ for (i = 0; i < count; i++) { ++ snprintf(filename, sizeof(filename), "%s/%s", path, dent[i]->d_name); ++ ret = nvme_nbft_read(&nbft, filename); ++ if (!ret) { ++ entry = calloc(1, sizeof(*entry)); ++ entry->nbft = nbft; ++ list_add_tail(nbft_list, &entry->node); ++ } ++ free(dent[i]); ++ } ++ free(dent); ++ return 0; ++} ++ ++void free_nbfts(struct list_head *nbft_list) ++{ ++ struct nbft_file_entry *entry; ++ ++ while ((entry = list_pop(nbft_list, struct nbft_file_entry, node))) { ++ nvme_nbft_free(entry->nbft); ++ free(entry); ++ } ++} ++ ++int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, ++ char *hostnqn_sys, char *hostid_sys, ++ const char *desc, bool connect, ++ const struct nvme_fabrics_config *cfg, char *nbft_path, ++ enum nvme_print_flags flags, bool verbose) ++{ ++ char *hostnqn = NULL, *hostid = NULL, *host_traddr = NULL; ++ nvme_host_t h; ++ nvme_ctrl_t c; ++ int ret, i; ++ struct list_head nbft_list; ++ struct nbft_file_entry *entry; ++ struct nbft_info_subsystem_ns **ss; ++ struct nbft_info_hfi *hfi; ++ ++ if (!connect) ++ /* to do: print discovery-type info from NBFT tables */ ++ return 0; ++ ++ list_head_init(&nbft_list); ++ ret = read_nbft_files(&nbft_list, nbft_path); ++ if (ret) ++ goto out_free_2; ++ ++ list_for_each(&nbft_list, entry, node) ++ for (ss = entry->nbft->subsystem_ns_list; ss && *ss; ss++) ++ for (i = 0; i < (*ss)->num_hfis; i++) { ++ nvme_ctrl_t cl; ++ ++ hfi = (*ss)->hfis[i]; ++ if (hostnqn_arg) ++ hostnqn = hostnqn_arg; ++ else { ++ hostnqn = entry->nbft->host.nqn; ++ if (!hostnqn) ++ hostnqn = hostnqn_sys; ++ } ++ ++ if (hostid_arg) ++ hostid = hostid_arg; ++ else if (*entry->nbft->host.id) { ++ hostid = (char *)util_uuid_to_string(entry->nbft->host.id); ++ if (!hostid) ++ hostid = hostid_sys; ++ } ++ ++ h = nvme_lookup_host(r, hostnqn, hostid); ++ if (!h) { ++ errno = ENOMEM; ++ goto out_free; ++ } ++ ++ if (!cfg->host_traddr) { ++ host_traddr = NULL; ++ if (!strncmp((*ss)->transport, "tcp", 3)) ++ host_traddr = hfi->tcp_info.ipaddr; ++ } ++ ++ struct tr_config trcfg = { ++ .subsysnqn = (*ss)->subsys_nqn, ++ .transport = (*ss)->transport, ++ .traddr = (*ss)->traddr, ++ .host_traddr = host_traddr, ++ .host_iface = NULL, ++ .trsvcid = (*ss)->trsvcid, ++ }; ++ ++ /* Already connected ? */ ++ cl = lookup_ctrl(r, &trcfg); ++ if (cl && nvme_ctrl_get_name(cl)) ++ continue; ++ ++ c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, ++ (*ss)->traddr, host_traddr, NULL, ++ (*ss)->trsvcid); ++ if (!c) { ++ errno = ENOMEM; ++ goto out_free; ++ } ++ ++ errno = 0; ++ ret = nvmf_add_ctrl(h, c, cfg); ++ ++ /* ++ * With TCP/DHCP, it can happen that the OS ++ * obtains a different local IP address than the ++ * firmware had. Retry without host_traddr. ++ */ ++ if (ret == -1 && errno == ENVME_CONNECT_WRITE && ++ !strcmp((*ss)->transport, "tcp") && ++ strlen(hfi->tcp_info.dhcp_server_ipaddr) > 0) { ++ nvme_free_ctrl(c); ++ ++ trcfg.host_traddr = NULL; ++ cl = lookup_ctrl(r, &trcfg); ++ if (cl && nvme_ctrl_get_name(cl)) ++ continue; ++ ++ c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, ++ (*ss)->traddr, ++ NULL, NULL, (*ss)->trsvcid); ++ if (!c) { ++ errno = ENOMEM; ++ goto out_free; ++ } ++ errno = 0; ++ ret = nvmf_add_ctrl(h, c, cfg); ++ if (ret == 0 && verbose >= 1) ++ fprintf(stderr, ++ "connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n", ++ host_traddr); ++ } ++ ++ if (ret) ++ fprintf(stderr, "no controller found\n"); ++ else { ++ if (flags == NORMAL) ++ print_connect_msg(c); ++ else if (flags == JSON) ++ json_connect_msg(c); ++ } ++out_free: ++ if (errno == ENOMEM) ++ goto out_free_2; ++ } ++out_free_2: ++ free_nbfts(&nbft_list); ++ return errno; ++} +diff --git a/nbft.h b/nbft.h +new file mode 100644 +index 00000000..0e09733f +--- /dev/null ++++ b/nbft.h +@@ -0,0 +1,19 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++ ++#include ++ ++#define NBFT_SYSFS_PATH "/sys/firmware/acpi/tables" ++ ++struct nbft_file_entry { ++ struct list_node node; ++ struct nbft_info *nbft; ++}; ++ ++int read_nbft_files(struct list_head *nbft_list, char *path); ++void free_nbfts(struct list_head *nbft_list); ++ ++extern int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, ++ char *hostnqn_sys, char *hostid_sys, ++ const char *desc, bool connect, ++ const struct nvme_fabrics_config *cfg, char *nbft_path, ++ enum nvme_print_flags flags, bool verbose); +-- +2.39.2 + diff --git a/nvme-cli-2.5-nbft_plugin.patch b/nvme-cli-2.5-nbft_plugin.patch new file mode 100644 index 0000000..b70d26e --- /dev/null +++ b/nvme-cli-2.5-nbft_plugin.patch @@ -0,0 +1,640 @@ +From 23daeedc53be9b5225cc6806434888c0a7a8e9bf Mon Sep 17 00:00:00 2001 +From: Stuart Hayes +Date: Fri, 14 Apr 2023 22:01:07 -0400 +Subject: [PATCH 03/11] nbft: add the nbft show plugin + +Display contents of the ACPI NBFT files. + +Usage: nvme nbft show [OPTIONS] + +Options: + [ --output-format=, -o ] --- Output format: normal|json + [ --subsystem, -s ] --- show NBFT subsystems + [ --hfi, -H ] --- show NBFT HFIs + [ --discovery, -d ] --- show NBFT discovery controllers + [ --nbft-path= ] --- user-defined path for NBFT tables + +Signed-off-by: Stuart Hayes +Signed-off-by: Martin Wilck +Signed-off-by: John Meneghini +--- + plugins/meson.build | 1 + + plugins/nbft/nbft-plugin.c | 568 +++++++++++++++++++++++++++++++++++++ + plugins/nbft/nbft-plugin.h | 18 ++ + 3 files changed, 587 insertions(+) + create mode 100644 plugins/nbft/nbft-plugin.c + create mode 100644 plugins/nbft/nbft-plugin.h + +diff --git a/plugins/meson.build b/plugins/meson.build +index 2cf2486f..38b7cded 100644 +--- a/plugins/meson.build ++++ b/plugins/meson.build +@@ -12,6 +12,7 @@ if json_c_dep.found() + 'plugins/intel/intel-nvme.c', + 'plugins/memblaze/memblaze-nvme.c', + 'plugins/micron/micron-nvme.c', ++ 'plugins/nbft/nbft-plugin.c', + 'plugins/netapp/netapp-nvme.c', + 'plugins/nvidia/nvidia-nvme.c', + 'plugins/scaleflux/sfx-nvme.c', +diff --git a/plugins/nbft/nbft-plugin.c b/plugins/nbft/nbft-plugin.c +new file mode 100644 +index 00000000..6ae2525a +--- /dev/null ++++ b/plugins/nbft/nbft-plugin.c +@@ -0,0 +1,568 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++#include ++#include ++#include ++ ++#include "nvme-print.h" ++#include "nvme.h" ++#include "nbft.h" ++#include "libnvme.h" ++#include "fabrics.h" ++ ++#define CREATE_CMD ++#include "nbft-plugin.h" ++ ++static const char dash[100] = {[0 ... 98] = '-', [99] = '\0'}; ++ ++#define PCI_SEGMENT(sbdf) ((sbdf & 0xffff0000) >> 16) ++#define PCI_BUS(sbdf) ((sbdf & 0x0000ff00) >> 8) ++#define PCI_DEV(sbdf) ((sbdf & 0x000000f8) >> 3) ++#define PCI_FUNC(sbdf) ((sbdf & 0x00000007) >> 0) ++ ++static const char *pci_sbdf_to_string(__u16 pci_sbdf) ++{ ++ static char pcidev[13]; ++ ++ snprintf(pcidev, sizeof(pcidev), "%x:%x:%x.%x", ++ PCI_SEGMENT(pci_sbdf), ++ PCI_BUS(pci_sbdf), ++ PCI_DEV(pci_sbdf), ++ PCI_FUNC(pci_sbdf)); ++ return pcidev; ++} ++ ++static char *mac_addr_to_string(unsigned char mac_addr[6]) ++{ ++ static char mac_string[18]; ++ ++ snprintf(mac_string, sizeof(mac_string), "%02x:%02x:%02x:%02x:%02x:%02x", ++ mac_addr[0], ++ mac_addr[1], ++ mac_addr[2], ++ mac_addr[3], ++ mac_addr[4], ++ mac_addr[5]); ++ return mac_string; ++} ++ ++static json_object *hfi_to_json(struct nbft_info_hfi *hfi) ++{ ++ struct json_object *hfi_json; ++ ++ hfi_json = json_create_object(); ++ if (!hfi_json) ++ return NULL; ++ ++ if (json_object_add_value_int(hfi_json, "index", hfi->index) ++ || json_object_add_value_string(hfi_json, "transport", hfi->transport)) ++ goto fail; ++ ++ if (strcmp(hfi->transport, "tcp") == 0) { ++ if (json_object_add_value_string(hfi_json, "pcidev", ++ pci_sbdf_to_string(hfi->tcp_info.pci_sbdf)) ++ || json_object_add_value_string(hfi_json, "mac_addr", ++ mac_addr_to_string(hfi->tcp_info.mac_addr)) ++ || json_object_add_value_int(hfi_json, "vlan", ++ hfi->tcp_info.vlan) ++ || json_object_add_value_int(hfi_json, "ip_origin", ++ hfi->tcp_info.ip_origin) ++ || json_object_add_value_string(hfi_json, "ipaddr", ++ hfi->tcp_info.ipaddr) ++ || json_object_add_value_int(hfi_json, "subnet_mask_prefix", ++ hfi->tcp_info.subnet_mask_prefix) ++ || json_object_add_value_string(hfi_json, "gateway_ipaddr", ++ hfi->tcp_info.gateway_ipaddr) ++ || json_object_add_value_int(hfi_json, "route_metric", ++ hfi->tcp_info.route_metric) ++ || json_object_add_value_string(hfi_json, "primary_dns_ipaddr", ++ hfi->tcp_info.primary_dns_ipaddr) ++ || json_object_add_value_string(hfi_json, "secondary_dns_ipaddr", ++ hfi->tcp_info.secondary_dns_ipaddr) ++ || json_object_add_value_string(hfi_json, "dhcp_server_ipaddr", ++ hfi->tcp_info.dhcp_server_ipaddr) ++ || (hfi->tcp_info.host_name ++ && json_object_add_value_string(hfi_json, "host_name", ++ hfi->tcp_info.host_name)) ++ || json_object_add_value_int(hfi_json, "this_hfi_is_default_route", ++ hfi->tcp_info.this_hfi_is_default_route) ++ || json_object_add_value_int(hfi_json, "dhcp_override", ++ hfi->tcp_info.dhcp_override)) ++ goto fail; ++ else ++ return hfi_json; ++ } ++fail: ++ json_free_object(hfi_json); ++ return NULL; ++} ++ ++static json_object *ssns_to_json(struct nbft_info_subsystem_ns *ss) ++{ ++ struct json_object *ss_json; ++ struct json_object *hfi_array_json; ++ char json_str[40]; ++ char *json_str_p; ++ int i; ++ ++ ss_json = json_create_object(); ++ if (!ss_json) ++ return NULL; ++ ++ hfi_array_json = json_create_array(); ++ if (!hfi_array_json) ++ goto fail; ++ ++ for (i = 0; i < ss->num_hfis; i++) ++ if (json_array_add_value_object(hfi_array_json, ++ json_object_new_int(ss->hfis[i]->index))) ++ goto fail; ++ ++ if (json_object_add_value_int(ss_json, "index", ss->index) ++ || json_object_add_value_int(ss_json, "num_hfis", ss->num_hfis) ++ || json_object_object_add(ss_json, "hfis", hfi_array_json) ++ || json_object_add_value_string(ss_json, "transport", ss->transport) ++ || json_object_add_value_string(ss_json, "traddr", ss->traddr) ++ || json_object_add_value_string(ss_json, "trsvcid", ss->trsvcid) ++ || json_object_add_value_int(ss_json, "subsys_port_id", ss->subsys_port_id) ++ || json_object_add_value_int(ss_json, "nsid", ss->nsid)) ++ goto fail; ++ ++ memset(json_str, 0, sizeof(json_str)); ++ json_str_p = json_str; ++ ++ switch (ss->nid_type) { ++ case NBFT_INFO_NID_TYPE_EUI64: ++ if (json_object_add_value_string(ss_json, "nid_type", "eui64")) ++ goto fail; ++ for (i = 0; i < 8; i++) ++ json_str_p += sprintf(json_str_p, "%02x", ss->nid[i]); ++ break; ++ ++ case NBFT_INFO_NID_TYPE_NGUID: ++ if (json_object_add_value_string(ss_json, "nid_type", "nguid")) ++ goto fail; ++ for (i = 0; i < 16; i++) ++ json_str_p += sprintf(json_str_p, "%02x", ss->nid[i]); ++ break; ++ ++ case NBFT_INFO_NID_TYPE_NS_UUID: ++ if (json_object_add_value_string(ss_json, "nid_type", "uuid")) ++ goto fail; ++ nvme_uuid_to_string(ss->nid, json_str); ++ break; ++ ++ default: ++ break; ++ } ++ if (json_object_add_value_string(ss_json, "nid", json_str)) ++ goto fail; ++ ++ if ((ss->subsys_nqn ++ && json_object_add_value_string(ss_json, "subsys_nqn", ss->subsys_nqn)) ++ || json_object_add_value_int(ss_json, "controller_id", ss->controller_id) ++ || json_object_add_value_int(ss_json, "asqsz", ss->asqsz) ++ || (ss->dhcp_root_path_string ++ && json_object_add_value_string(ss_json, "dhcp_root_path_string", ++ ss->dhcp_root_path_string)) ++ || json_object_add_value_int(ss_json, "pdu_header_digest_required", ++ ss->pdu_header_digest_required) ++ || json_object_add_value_int(ss_json, "data_digest_required", ++ ss->data_digest_required)) ++ goto fail; ++ ++ return ss_json; ++fail: ++ json_free_object(ss_json); ++ return NULL; ++} ++ ++static json_object *discovery_to_json(struct nbft_info_discovery *disc) ++{ ++ struct json_object *disc_json; ++ ++ disc_json = json_create_object(); ++ if (!disc_json) ++ return NULL; ++ ++ if (json_object_add_value_int(disc_json, "index", disc->index) ++ || (disc->security ++ && json_object_add_value_int(disc_json, "security", disc->security->index)) ++ || (disc->hfi ++ && json_object_add_value_int(disc_json, "hfi", disc->hfi->index)) ++ || (disc->uri ++ && json_object_add_value_string(disc_json, "uri", disc->uri)) ++ || (disc->nqn ++ && json_object_add_value_string(disc_json, "nqn", disc->nqn))) { ++ json_free_object(disc_json); ++ return NULL; ++ } else ++ return disc_json; ++} ++ ++static const char *primary_admin_host_flag_to_str(unsigned int primary) ++{ ++ static const char * const str[] = { ++ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED] = "not indicated", ++ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED] = "unselected", ++ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_SELECTED] = "selected", ++ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_RESERVED] = "reserved", ++ }; ++ ++ if (primary > NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_RESERVED) ++ return "INVALID"; ++ return str[primary]; ++} ++ ++static struct json_object *nbft_to_json(struct nbft_info *nbft, bool show_subsys, ++ bool show_hfi, bool show_discovery) ++{ ++ struct json_object *nbft_json, *host_json; ++ ++ nbft_json = json_create_object(); ++ if (!nbft_json) ++ return NULL; ++ ++ if (json_object_add_value_string(nbft_json, "filename", nbft->filename)) ++ goto fail; ++ ++ host_json = json_create_object(); ++ if (!host_json) ++ goto fail; ++ if ((nbft->host.nqn ++ && json_object_add_value_string(host_json, "nqn", nbft->host.nqn)) ++ || (nbft->host.id ++ && json_object_add_value_string(host_json, "id", ++ util_uuid_to_string(nbft->host.id)))) ++ goto fail; ++ json_object_add_value_int(host_json, "host_id_configured", ++ nbft->host.host_id_configured); ++ json_object_add_value_int(host_json, "host_nqn_configured", ++ nbft->host.host_nqn_configured); ++ json_object_add_value_string(host_json, "primary_admin_host_flag", ++ primary_admin_host_flag_to_str(nbft->host.primary)); ++ if (json_object_object_add(nbft_json, "host", host_json)) { ++ json_free_object(host_json); ++ goto fail; ++ } ++ ++ if (show_subsys) { ++ struct json_object *subsys_array_json, *subsys_json; ++ struct nbft_info_subsystem_ns **ss; ++ ++ subsys_array_json = json_create_array(); ++ if (!subsys_array_json) ++ goto fail; ++ for (ss = nbft->subsystem_ns_list; ss && *ss; ss++) { ++ subsys_json = ssns_to_json(*ss); ++ if (!subsys_json) ++ goto fail; ++ if (json_object_array_add(subsys_array_json, subsys_json)) { ++ json_free_object(subsys_json); ++ goto fail; ++ } ++ } ++ if (json_object_object_add(nbft_json, "subsystem", subsys_array_json)) { ++ json_free_object(subsys_array_json); ++ goto fail; ++ } ++ } ++ if (show_hfi) { ++ struct json_object *hfi_array_json, *hfi_json; ++ struct nbft_info_hfi **hfi; ++ ++ hfi_array_json = json_create_array(); ++ if (!hfi_array_json) ++ goto fail; ++ for (hfi = nbft->hfi_list; hfi && *hfi; hfi++) { ++ hfi_json = hfi_to_json(*hfi); ++ if (!hfi_json) ++ goto fail; ++ if (json_object_array_add(hfi_array_json, hfi_json)) { ++ json_free_object(hfi_json); ++ goto fail; ++ } ++ } ++ if (json_object_object_add(nbft_json, "hfi", hfi_array_json)) { ++ json_free_object(hfi_array_json); ++ goto fail; ++ } ++ } ++ if (show_discovery) { ++ struct json_object *discovery_array_json, *discovery_json; ++ struct nbft_info_discovery **disc; ++ ++ discovery_array_json = json_create_array(); ++ if (!discovery_array_json) ++ goto fail; ++ for (disc = nbft->discovery_list; disc && *disc; disc++) { ++ discovery_json = discovery_to_json(*disc); ++ if (!discovery_json) ++ goto fail; ++ if (json_object_array_add(discovery_array_json, discovery_json)) { ++ json_free_object(discovery_json); ++ goto fail; ++ } ++ } ++ if (json_object_object_add(nbft_json, "discovery", discovery_array_json)) { ++ json_free_object(discovery_array_json); ++ goto fail; ++ } ++ } ++ return nbft_json; ++fail: ++ json_free_object(nbft_json); ++ return NULL; ++} ++ ++static int json_show_nbfts(struct list_head *nbft_list, bool show_subsys, ++ bool show_hfi, bool show_discovery) ++{ ++ struct json_object *nbft_json_array, *nbft_json; ++ struct nbft_file_entry *entry; ++ ++ nbft_json_array = json_create_array(); ++ if (!nbft_json_array) ++ return ENOMEM; ++ ++ list_for_each(nbft_list, entry, node) { ++ nbft_json = nbft_to_json(entry->nbft, show_subsys, show_hfi, show_discovery); ++ if (!nbft_json) ++ goto fail; ++ if (json_object_array_add(nbft_json_array, nbft_json)) { ++ json_free_object(nbft_json); ++ goto fail; ++ } ++ } ++ ++ json_print_object(nbft_json_array, NULL); ++ printf("\n"); ++ json_free_object(nbft_json_array); ++ return 0; ++fail: ++ json_free_object(nbft_json_array); ++ return ENOMEM; ++} ++ ++static void print_nbft_hfi_info(struct nbft_info *nbft) ++{ ++ struct nbft_info_hfi **hfi; ++ unsigned int ip_width = 8, gw_width = 8, dns_width = 8; ++ ++ hfi = nbft->hfi_list; ++ if (!hfi || !*hfi) ++ return; ++ ++ for (; *hfi; hfi++) { ++ unsigned int len; ++ ++ len = strlen((*hfi)->tcp_info.ipaddr); ++ if (len > ip_width) ++ ip_width = len; ++ len = strlen((*hfi)->tcp_info.gateway_ipaddr); ++ if (len > gw_width) ++ gw_width = len; ++ len = strlen((*hfi)->tcp_info.primary_dns_ipaddr); ++ if (len > dns_width) ++ dns_width = len; ++ } ++ ++ printf("\nNBFT HFIs:\n\n"); ++ printf("%-3.3s|%-4.4s|%-10.10s|%-17.17s|%-4.4s|%-*.*s|%-4.4s|%-*.*s|%-*.*s\n", ++ "Idx", "Trsp", "PCI Addr", "MAC Addr", "DHCP", ++ ip_width, ip_width, "IP Addr", "Mask", ++ gw_width, gw_width, "Gateway", dns_width, dns_width, "DNS"); ++ printf("%-.3s+%-.4s+%-.10s+%-.17s+%-.4s+%-.*s+%-.4s+%-.*s+%-.*s\n", ++ dash, dash, dash, dash, dash, ip_width, dash, dash, ++ gw_width, dash, dns_width, dash); ++ for (hfi = nbft->hfi_list; *hfi; hfi++) ++ printf("%-3d|%-4.4s|%-10.10s|%-17.17s|%-4.4s|%-*.*s|%-4d|%-*.*s|%-*.*s\n", ++ (*hfi)->index, ++ (*hfi)->transport, ++ pci_sbdf_to_string((*hfi)->tcp_info.pci_sbdf), ++ mac_addr_to_string((*hfi)->tcp_info.mac_addr), ++ (*hfi)->tcp_info.dhcp_override ? "yes" : "no", ++ ip_width, ip_width, (*hfi)->tcp_info.ipaddr, ++ (*hfi)->tcp_info.subnet_mask_prefix, ++ gw_width, gw_width, (*hfi)->tcp_info.gateway_ipaddr, ++ dns_width, dns_width, (*hfi)->tcp_info.primary_dns_ipaddr); ++} ++ ++static void print_nbft_discovery_info(struct nbft_info *nbft) ++{ ++ struct nbft_info_discovery **disc; ++ unsigned int nqn_width = 20, uri_width = 12; ++ ++ disc = nbft->discovery_list; ++ if (!disc || !*disc) ++ return; ++ ++ for (; *disc; disc++) { ++ size_t len; ++ ++ len = strlen((*disc)->uri); ++ if (len > uri_width) ++ uri_width = len; ++ len = strlen((*disc)->nqn); ++ if (len > nqn_width) ++ nqn_width = len; ++ } ++ ++ printf("\nNBFT Discovery Controllers:\n\n"); ++ printf("%-3.3s|%-*.*s|%-*.*s\n", "Idx", uri_width, uri_width, "URI", ++ nqn_width, nqn_width, "NQN"); ++ printf("%-.3s+%-.*s+%-.*s\n", dash, uri_width, dash, nqn_width, dash); ++ for (disc = nbft->discovery_list; *disc; disc++) ++ printf("%-3d|%-*.*s|%-*.*s\n", (*disc)->index, ++ uri_width, uri_width, (*disc)->uri, ++ nqn_width, nqn_width, (*disc)->nqn); ++} ++ ++#define HFIS_LEN 20 ++static size_t print_hfis(const struct nbft_info_subsystem_ns *ss, char buf[HFIS_LEN]) ++{ ++ char hfi_buf[HFIS_LEN]; ++ size_t len, ofs; ++ int i; ++ ++ len = snprintf(hfi_buf, sizeof(hfi_buf), "%d", ss->hfis[0]->index); ++ for (i = 1; i < ss->num_hfis; i++) { ++ ofs = len; ++ len += snprintf(hfi_buf + ofs, sizeof(hfi_buf) - ofs, ",%d", ++ ss->hfis[i]->index); ++ /* ++ * If the list doesn't fit in HFIS_LEN characters, ++ * truncate and end with "..." ++ */ ++ if (len >= sizeof(hfi_buf)) { ++ while (ofs < sizeof(hfi_buf) - 1) ++ hfi_buf[ofs++] = '.'; ++ hfi_buf[ofs] = '\0'; ++ len = sizeof(hfi_buf) - 1; ++ break; ++ } ++ } ++ if (buf) ++ memcpy(buf, hfi_buf, len + 1); ++ return len; ++} ++ ++ ++static void print_nbft_subsys_info(struct nbft_info *nbft) ++{ ++ struct nbft_info_subsystem_ns **ss; ++ unsigned int nqn_width = 20, adr_width = 8, hfi_width = 4; ++ ++ ss = nbft->subsystem_ns_list; ++ if (!ss || !*ss) ++ return; ++ for (; *ss; ss++) { ++ size_t len; ++ ++ len = strlen((*ss)->subsys_nqn); ++ if (len > nqn_width) ++ nqn_width = len; ++ len = strlen((*ss)->traddr); ++ if (len > adr_width) ++ adr_width = len; ++ len = print_hfis(*ss, NULL); ++ if (len > hfi_width) ++ hfi_width = len; ++ } ++ ++ printf("\nNBFT Subsystems:\n\n"); ++ printf("%-3.3s|%-*.*s|%-4.4s|%-*.*s|%-5.5s|%-*.*s\n", ++ "Idx", nqn_width, nqn_width, "NQN", ++ "Trsp", adr_width, adr_width, "Address", "SvcId", hfi_width, hfi_width, "HFIs"); ++ printf("%-.3s+%-.*s+%-.4s+%-.*s+%-.5s+%-.*s\n", ++ dash, nqn_width, dash, dash, adr_width, dash, dash, hfi_width, dash); ++ for (ss = nbft->subsystem_ns_list; *ss; ss++) { ++ char hfi_buf[HFIS_LEN]; ++ ++ print_hfis(*ss, hfi_buf); ++ printf("%-3d|%-*.*s|%-4.4s|%-*.*s|%-5.5s|%-*.*s\n", ++ (*ss)->index, nqn_width, nqn_width, (*ss)->subsys_nqn, ++ (*ss)->transport, adr_width, adr_width, (*ss)->traddr, ++ (*ss)->trsvcid, hfi_width, hfi_width, hfi_buf); ++ } ++} ++ ++static void normal_show_nbft(struct nbft_info *nbft, bool show_subsys, ++ bool show_hfi, bool show_discovery) ++{ ++ printf("%s:\n", nbft->filename); ++ if ((!nbft->hfi_list || !*nbft->hfi_list) && ++ (!nbft->security_list || !*nbft->security_list) && ++ (!nbft->discovery_list || !*nbft->discovery_list) && ++ (!nbft->subsystem_ns_list || !*nbft->subsystem_ns_list)) ++ printf("(empty)\n"); ++ else { ++ if (show_subsys) ++ print_nbft_subsys_info(nbft); ++ if (show_hfi) ++ print_nbft_hfi_info(nbft); ++ if (show_discovery) ++ print_nbft_discovery_info(nbft); ++ } ++} ++ ++static void normal_show_nbfts(struct list_head *nbft_list, bool show_subsys, ++ bool show_hfi, bool show_discovery) ++{ ++ bool not_first = false; ++ struct nbft_file_entry *entry; ++ ++ list_for_each(nbft_list, entry, node) { ++ if (not_first) ++ printf("\n"); ++ normal_show_nbft(entry->nbft, show_subsys, show_hfi, show_discovery); ++ not_first = true; ++ } ++} ++ ++int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) ++{ ++ const char *desc = "Display contents of the ACPI NBFT files."; ++ struct list_head nbft_list; ++ char *format = "normal"; ++ char *nbft_path = NBFT_SYSFS_PATH; ++ enum nvme_print_flags flags = -1; ++ int ret; ++ bool show_subsys = false, show_hfi = false, show_discovery = false; ++ ++ OPT_ARGS(opts) = { ++ OPT_FMT("output-format", 'o', &format, "Output format: normal|json"), ++ OPT_FLAG("subsystem", 's', &show_subsys, "show NBFT subsystems"), ++ OPT_FLAG("hfi", 'H', &show_hfi, "show NBFT HFIs"), ++ OPT_FLAG("discovery", 'd', &show_discovery, "show NBFT discovery controllers"), ++ OPT_STRING("nbft-path", 0, "STR", &nbft_path, "user-defined path for NBFT tables"), ++ OPT_END() ++ }; ++ ++ ret = argconfig_parse(argc, argv, desc, opts); ++ if (ret) ++ return ret; ++ ++ if (!(show_subsys || show_hfi || show_discovery)) ++ show_subsys = show_hfi = show_discovery = true; ++ ++ if (!strcmp(format, "")) ++ flags = -1; ++ else if (!strcmp(format, "normal")) ++ flags = NORMAL; ++ else if (!strcmp(format, "json")) ++ flags = JSON; ++ else ++ return EINVAL; ++ ++ list_head_init(&nbft_list); ++ ret = read_nbft_files(&nbft_list, nbft_path); ++ if (!ret) { ++ if (flags == NORMAL) ++ normal_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery); ++ else if (flags == JSON) ++ ret = json_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery); ++ free_nbfts(&nbft_list); ++ } ++ return ret; ++} +diff --git a/plugins/nbft/nbft-plugin.h b/plugins/nbft/nbft-plugin.h +new file mode 100644 +index 00000000..018349d9 +--- /dev/null ++++ b/plugins/nbft/nbft-plugin.h +@@ -0,0 +1,18 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++#undef CMD_INC_FILE ++#define CMD_INC_FILE plugins/nbft/nbft-plugin ++ ++#if !defined(NBFT) || defined(CMD_HEADER_MULTI_READ) ++#define NBFT ++ ++#include "cmd.h" ++ ++PLUGIN(NAME("nbft", "ACPI NBFT table extensions", NVME_VERSION), ++ COMMAND_LIST( ++ ENTRY("show", "Show contents of ACPI NBFT tables", show_nbft) ++ ) ++); ++ ++#endif ++ ++#include "define_cmd.h" +-- +2.39.2 + diff --git a/nvme-cli.spec b/nvme-cli.spec index fd84a01..06bb083 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,13 +3,17 @@ Name: nvme-cli Version: 2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPLv2 URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +Patch100: nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch +Patch101: nvme-cli-2.5-nbft.patch +Patch102: nvme-cli-2.5-nbft_plugin.patch + BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -17,7 +21,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.4 +BuildRequires: libnvme-devel >= 1.4-2 BuildRequires: json-c-devel >= 0.13 %if (0%{?rhel} == 0) @@ -83,6 +87,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Apr 20 2023 Tomas Bzatek - 2.4-2 +- Backport the NBFT support from git master + * Mon Apr 03 2023 Tomas Bzatek - 2.4-1 - Update to 2.4 From aa5fc08451b6ae8febbda2adeb918dd99de62d7f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 4 Jul 2023 15:47:56 +0200 Subject: [PATCH 25/52] * Tue Jul 04 2023 Tomas Bzatek - 2.5-1 - Update to 2.5 --- .gitignore | 1 + ...bft-make-lookup_ctrl-function-public.patch | 75 -- nvme-cli-2.5-nbft.patch | 451 ------------ nvme-cli-2.5-nbft_plugin.patch | 640 ------------------ nvme-cli.spec | 15 +- sources | 2 +- 6 files changed, 9 insertions(+), 1175 deletions(-) delete mode 100644 nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch delete mode 100644 nvme-cli-2.5-nbft.patch delete mode 100644 nvme-cli-2.5-nbft_plugin.patch diff --git a/.gitignore b/.gitignore index 5add3b2..3555f05 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /nvme-cli-2.2.1.tar.gz /nvme-cli-2.3.tar.gz /nvme-cli-2.4.tar.gz +/nvme-cli-2.5.tar.gz diff --git a/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch b/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch deleted file mode 100644 index 78529b9..0000000 --- a/nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 34c197e0ac2d57734ab775f00b2d0758aca7b82f Mon Sep 17 00:00:00 2001 -From: John Meneghini -Date: Fri, 14 Apr 2023 10:53:58 -0400 -Subject: [PATCH 01/11] nbft: make lookup_ctrl function public - -To prepare for the addition of nbft functionality fixup the fabrics -declarations. - -Signed-off-by: John Meneghini ---- - fabrics.c | 12 ++---------- - fabrics.h | 10 ++++++++++ - 2 files changed, 12 insertions(+), 10 deletions(-) - -diff --git a/fabrics.c b/fabrics.c -index f8078e59..80827b16 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -43,6 +43,7 @@ - #include "libnvme.h" - #include "nvme-print.h" - #include "nvme-print-json.h" -+#include "fabrics.h" - - #define PATH_NVMF_DISC SYSCONFDIR "/nvme/discovery.conf" - #define PATH_NVMF_CONFIG SYSCONFDIR "/nvme/config.json" -@@ -110,15 +111,6 @@ static const char *nvmf_config_file = "Use specified JSON configuration file or - OPT_FLAG("data-digest", 'G', &c.data_digest, nvmf_data_digest), \ - OPT_FLAG("tls", 0, &c.tls, nvmf_tls) \ - --struct tr_config { -- const char *subsysnqn; -- const char *transport; -- const char *traddr; -- const char *host_traddr; -- const char *host_iface; -- const char *trsvcid; --}; -- - /* - * Compare two C strings and handle NULL pointers gracefully. - * If either of the two strings is NULL, return 0 -@@ -202,7 +194,7 @@ static nvme_ctrl_t lookup_discovery_ctrl(nvme_root_t r, struct tr_config *trcfg) - return __lookup_ctrl(r, trcfg, disc_ctrl_config_match); - } - --static nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg) -+nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg) - { - return __lookup_ctrl(r, trcfg, ctrl_config_match); - } -diff --git a/fabrics.h b/fabrics.h -index d1e16fc5..02cebf5d 100644 ---- a/fabrics.h -+++ b/fabrics.h -@@ -2,6 +2,16 @@ - #ifndef _FABRICS_H - #define _FABRICS_H - -+struct tr_config { -+ const char *subsysnqn; -+ const char *transport; -+ const char *traddr; -+ const char *host_traddr; -+ const char *host_iface; -+ const char *trsvcid; -+}; -+ -+extern nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg); - extern int nvmf_discover(const char *desc, int argc, char **argv, bool connect); - extern int nvmf_connect(const char *desc, int argc, char **argv); - extern int nvmf_disconnect(const char *desc, int argc, char **argv); --- -2.39.2 - diff --git a/nvme-cli-2.5-nbft.patch b/nvme-cli-2.5-nbft.patch deleted file mode 100644 index e54da19..0000000 --- a/nvme-cli-2.5-nbft.patch +++ /dev/null @@ -1,451 +0,0 @@ -From a71a08532b5f06ee19ee2ff118a23cec4ecb6719 Mon Sep 17 00:00:00 2001 -From: Stuart Hayes -Date: Wed, 15 Jun 2022 11:42:50 -0500 -Subject: [PATCH 02/11] nbft: added NBFT v1.0 table support - -Added support for parsing the contents of the NBFT table (per NVMe-oF -boot specification v1.0) with the connect-all and discover commands. - -nvme discover/connect-all --nbft ignore /etc/nvme config and use NBFT tables -nvme discover/connect-all --no-nbft ignore NBFT tables and use /etc/nvme config -nvme discover/connect-all --nbft-path= user-defined path for NBFT tables - -Signed-off-by: Stuart Hayes -Signed-off-by: Martin Belanger - -Use the new nbft public API. - -Signed-off-by: Tomas Bzatek -Signed-off-by: Martin Wilck -Signed-off-by: John Meneghini ---- - Documentation/nvme-connect-all.txt | 25 ++++ - Documentation/nvme-discover.txt | 27 +++- - fabrics.c | 17 +++ - meson.build | 1 + - nbft.c | 202 +++++++++++++++++++++++++++++ - nbft.h | 19 +++ - 6 files changed, 290 insertions(+), 1 deletion(-) - create mode 100644 nbft.c - create mode 100644 nbft.h - -diff --git a/Documentation/nvme-connect-all.txt b/Documentation/nvme-connect-all.txt -index 44bb4f94..cbb7ca6c 100644 ---- a/Documentation/nvme-connect-all.txt -+++ b/Documentation/nvme-connect-all.txt -@@ -35,6 +35,9 @@ SYNOPSIS - [--tls ] - [--quiet | -S] - [--dump-config | -O] -+ [--nbft] -+ [--no-nbft] -+ [--nbft-path=] - - DESCRIPTION - ----------- -@@ -198,6 +201,16 @@ OPTIONS - --dump-config:: - Print out resulting JSON configuration file to stdout. - -+--nbft:: -+ Only look at NBFT tables -+ -+--no-nbft:: -+ Do not look at NBFT tables -+ -+--nbft-path=:: -+ Use a user-defined path to the NBFT tables -+ -+ - - EXAMPLES - -------- -@@ -210,6 +223,18 @@ the RDMA network. Port 4420 is used by default: - --hostnqn=host1-rogue-nqn - ------------ - + -+* Issue a 'nvme connect-all' command using the default system defined NBFT tables: -++ -+----------- -+# nvme connect-all --nbft -+------------ -++ -+* Issue a 'nvme connect-all' command with a user-defined path for the NBFT table: -++ -+----------- -+# nvme connet-all --nbft-path=/sys/firmware/acpi/tables/NBFT1 -+------------ -++ - * Issue a 'nvme connect-all' command using a @SYSCONFDIR@/nvme/discovery.conf file: - + - ----------- -diff --git a/Documentation/nvme-discover.txt b/Documentation/nvme-discover.txt -index d4df75c2..b040c688 100644 ---- a/Documentation/nvme-discover.txt -+++ b/Documentation/nvme-discover.txt -@@ -37,6 +37,9 @@ SYNOPSIS - [--dump-config | -O] - [--output-format= | -o ] - [--force] -+ [--nbft] -+ [--no-nbft] -+ [--nbft-path=] - - DESCRIPTION - ----------- -@@ -68,7 +71,7 @@ Note that the base NVMe specification defines the NQN (NVMe Qualified - Name) format which an NVMe endpoint (device, subsystem, etc) must - follow to guarantee a unique name under the NVMe standard. - In particular, the Host NQN uniquely identifies the NVMe Host, and --may be used by the the Discovery Controller to control what NVMe Target -+may be used by the Discovery Controller to control what NVMe Target - resources are allocated to the NVMe Host for a connection. - - A Discovery Controller has it's own NQN defined in the NVMe-over-Fabrics -@@ -229,6 +232,16 @@ OPTIONS - Combined with --persistent flag, always create new - persistent discovery connection. - -+--nbft:: -+ Only look at NBFT tables -+ -+--no-nbft:: -+ Do not look at NBFT tables -+ -+--nbft-path=:: -+ Use a user-defined path to the NBFT tables -+ -+ - EXAMPLES - -------- - * Query the Discover Controller with IP4 address 192.168.1.3 for all -@@ -240,6 +253,18 @@ Port 4420 is used by default: - --hostnqn=host1-rogue-nqn - ------------ - + -+* Issue a 'nvme discover' command using the default system defined NBFT tables: -++ -+----------- -+# nvme discover --nbft -+------------ -++ -+* Issue a 'nvme discover' command with a user-defined path for the NBFT table: -++ -+----------- -+# nvme discover --nbft-path=/sys/firmware/acpi/tables/NBFT1 -+------------ -++ - * Issue a 'nvme discover' command using a @SYSCONFDIR@/nvme/discovery.conf file: - + - ----------- -diff --git a/fabrics.c b/fabrics.c -index 80827b16..0edbd299 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -40,6 +40,7 @@ - - #include "common.h" - #include "nvme.h" -+#include "nbft.h" - #include "libnvme.h" - #include "nvme-print.h" - #include "nvme-print-json.h" -@@ -710,6 +711,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - { - char *subsysnqn = NVME_DISC_SUBSYS_NAME; - char *hostnqn = NULL, *hostid = NULL, *hostkey = NULL; -+ char *hostnqn_arg, *hostid_arg; - char *transport = NULL, *traddr = NULL, *trsvcid = NULL; - char *config_file = PATH_NVMF_CONFIG; - char *hnqn = NULL, *hid = NULL; -@@ -724,6 +726,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - char *device = NULL; - bool force = false; - bool json_config = false; -+ bool nbft = false, nonbft = false; -+ char *nbft_path = NBFT_SYSFS_PATH; - - OPT_ARGS(opts) = { - OPT_STRING("device", 'd', "DEV", &device, "use existing discovery controller device"), -@@ -736,6 +740,9 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - OPT_INCR("verbose", 'v', &verbose, "Increase logging verbosity"), - OPT_FLAG("dump-config", 'O', &dump_config, "Dump configuration file to stdout"), - OPT_FLAG("force", 0, &force, "Force persistent discovery controller creation"), -+ OPT_FLAG("nbft", 0, &nbft, "Only look at NBFT tables"), -+ OPT_FLAG("no-nbft", 0, &nonbft, "Do not look at NBFT tables"), -+ OPT_STRING("nbft-path", 0, "STR", &nbft_path, "user-defined path for NBFT tables"), - OPT_END() - }; - -@@ -768,6 +775,8 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - if (!nvme_read_config(r, config_file)) - json_config = true; - -+ hostnqn_arg = hostnqn; -+ hostid_arg = hostid; - if (!hostnqn) - hostnqn = hnqn = nvmf_hostnqn_from_file(); - if (!hostnqn) -@@ -789,6 +798,14 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - nvme_host_set_dhchap_key(h, hostkey); - - if (!device && !transport && !traddr) { -+ if (!nonbft) -+ discover_from_nbft(r, hostnqn_arg, hostid_arg, -+ hostnqn, hostid, desc, connect, -+ &cfg, nbft_path, flags, verbose); -+ -+ if (nbft) -+ goto out_free; -+ - if (json_config) - ret = discover_from_json_config_file(r, h, desc, - connect, &cfg, -diff --git a/meson.build b/meson.build -index 43ce5f9b..7ec357a9 100644 ---- a/meson.build -+++ b/meson.build -@@ -240,6 +240,7 @@ incdir = include_directories(['ccan']) - - ################################################################################ - sources = [ -+ 'nbft.c', - 'fabrics.c', - 'nvme.c', - 'nvme-models.c', -diff --git a/nbft.c b/nbft.c -new file mode 100644 -index 00000000..14347287 ---- /dev/null -+++ b/nbft.c -@@ -0,0 +1,202 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+ -+#include -+#include -+#include -+ -+#include "nvme.h" -+#include "nbft.h" -+#include "libnvme.h" -+#include "fabrics.h" -+ -+#define NBFT_SYSFS_FILENAME "NBFT*" -+ -+static void print_connect_msg(nvme_ctrl_t c) -+{ -+ printf("device: %s\n", nvme_ctrl_get_name(c)); -+} -+ -+static void json_connect_msg(nvme_ctrl_t c) -+{ -+ struct json_object *root; -+ -+ root = json_create_object(); -+ json_object_add_value_string(root, "device", nvme_ctrl_get_name(c)); -+ -+ json_print_object(root, NULL); -+ printf("\n"); -+ json_free_object(root); -+} -+ -+int nbft_filter(const struct dirent *dent) -+{ -+ return !fnmatch(NBFT_SYSFS_FILENAME, dent->d_name, FNM_PATHNAME); -+} -+ -+int read_nbft_files(struct list_head *nbft_list, char *path) -+{ -+ struct dirent **dent; -+ char filename[PATH_MAX]; -+ int i, count, ret; -+ struct nbft_file_entry *entry; -+ struct nbft_info *nbft; -+ -+ count = scandir(path, &dent, nbft_filter, NULL); -+ if (count < 0) { -+ fprintf(stderr, "Failed to open %s.\n", path); -+ return -1; -+ } -+ -+ for (i = 0; i < count; i++) { -+ snprintf(filename, sizeof(filename), "%s/%s", path, dent[i]->d_name); -+ ret = nvme_nbft_read(&nbft, filename); -+ if (!ret) { -+ entry = calloc(1, sizeof(*entry)); -+ entry->nbft = nbft; -+ list_add_tail(nbft_list, &entry->node); -+ } -+ free(dent[i]); -+ } -+ free(dent); -+ return 0; -+} -+ -+void free_nbfts(struct list_head *nbft_list) -+{ -+ struct nbft_file_entry *entry; -+ -+ while ((entry = list_pop(nbft_list, struct nbft_file_entry, node))) { -+ nvme_nbft_free(entry->nbft); -+ free(entry); -+ } -+} -+ -+int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, -+ char *hostnqn_sys, char *hostid_sys, -+ const char *desc, bool connect, -+ const struct nvme_fabrics_config *cfg, char *nbft_path, -+ enum nvme_print_flags flags, bool verbose) -+{ -+ char *hostnqn = NULL, *hostid = NULL, *host_traddr = NULL; -+ nvme_host_t h; -+ nvme_ctrl_t c; -+ int ret, i; -+ struct list_head nbft_list; -+ struct nbft_file_entry *entry; -+ struct nbft_info_subsystem_ns **ss; -+ struct nbft_info_hfi *hfi; -+ -+ if (!connect) -+ /* to do: print discovery-type info from NBFT tables */ -+ return 0; -+ -+ list_head_init(&nbft_list); -+ ret = read_nbft_files(&nbft_list, nbft_path); -+ if (ret) -+ goto out_free_2; -+ -+ list_for_each(&nbft_list, entry, node) -+ for (ss = entry->nbft->subsystem_ns_list; ss && *ss; ss++) -+ for (i = 0; i < (*ss)->num_hfis; i++) { -+ nvme_ctrl_t cl; -+ -+ hfi = (*ss)->hfis[i]; -+ if (hostnqn_arg) -+ hostnqn = hostnqn_arg; -+ else { -+ hostnqn = entry->nbft->host.nqn; -+ if (!hostnqn) -+ hostnqn = hostnqn_sys; -+ } -+ -+ if (hostid_arg) -+ hostid = hostid_arg; -+ else if (*entry->nbft->host.id) { -+ hostid = (char *)util_uuid_to_string(entry->nbft->host.id); -+ if (!hostid) -+ hostid = hostid_sys; -+ } -+ -+ h = nvme_lookup_host(r, hostnqn, hostid); -+ if (!h) { -+ errno = ENOMEM; -+ goto out_free; -+ } -+ -+ if (!cfg->host_traddr) { -+ host_traddr = NULL; -+ if (!strncmp((*ss)->transport, "tcp", 3)) -+ host_traddr = hfi->tcp_info.ipaddr; -+ } -+ -+ struct tr_config trcfg = { -+ .subsysnqn = (*ss)->subsys_nqn, -+ .transport = (*ss)->transport, -+ .traddr = (*ss)->traddr, -+ .host_traddr = host_traddr, -+ .host_iface = NULL, -+ .trsvcid = (*ss)->trsvcid, -+ }; -+ -+ /* Already connected ? */ -+ cl = lookup_ctrl(r, &trcfg); -+ if (cl && nvme_ctrl_get_name(cl)) -+ continue; -+ -+ c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, -+ (*ss)->traddr, host_traddr, NULL, -+ (*ss)->trsvcid); -+ if (!c) { -+ errno = ENOMEM; -+ goto out_free; -+ } -+ -+ errno = 0; -+ ret = nvmf_add_ctrl(h, c, cfg); -+ -+ /* -+ * With TCP/DHCP, it can happen that the OS -+ * obtains a different local IP address than the -+ * firmware had. Retry without host_traddr. -+ */ -+ if (ret == -1 && errno == ENVME_CONNECT_WRITE && -+ !strcmp((*ss)->transport, "tcp") && -+ strlen(hfi->tcp_info.dhcp_server_ipaddr) > 0) { -+ nvme_free_ctrl(c); -+ -+ trcfg.host_traddr = NULL; -+ cl = lookup_ctrl(r, &trcfg); -+ if (cl && nvme_ctrl_get_name(cl)) -+ continue; -+ -+ c = nvme_create_ctrl(r, (*ss)->subsys_nqn, (*ss)->transport, -+ (*ss)->traddr, -+ NULL, NULL, (*ss)->trsvcid); -+ if (!c) { -+ errno = ENOMEM; -+ goto out_free; -+ } -+ errno = 0; -+ ret = nvmf_add_ctrl(h, c, cfg); -+ if (ret == 0 && verbose >= 1) -+ fprintf(stderr, -+ "connect with host_traddr=\"%s\" failed, success after omitting host_traddr\n", -+ host_traddr); -+ } -+ -+ if (ret) -+ fprintf(stderr, "no controller found\n"); -+ else { -+ if (flags == NORMAL) -+ print_connect_msg(c); -+ else if (flags == JSON) -+ json_connect_msg(c); -+ } -+out_free: -+ if (errno == ENOMEM) -+ goto out_free_2; -+ } -+out_free_2: -+ free_nbfts(&nbft_list); -+ return errno; -+} -diff --git a/nbft.h b/nbft.h -new file mode 100644 -index 00000000..0e09733f ---- /dev/null -+++ b/nbft.h -@@ -0,0 +1,19 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+ -+#include -+ -+#define NBFT_SYSFS_PATH "/sys/firmware/acpi/tables" -+ -+struct nbft_file_entry { -+ struct list_node node; -+ struct nbft_info *nbft; -+}; -+ -+int read_nbft_files(struct list_head *nbft_list, char *path); -+void free_nbfts(struct list_head *nbft_list); -+ -+extern int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg, -+ char *hostnqn_sys, char *hostid_sys, -+ const char *desc, bool connect, -+ const struct nvme_fabrics_config *cfg, char *nbft_path, -+ enum nvme_print_flags flags, bool verbose); --- -2.39.2 - diff --git a/nvme-cli-2.5-nbft_plugin.patch b/nvme-cli-2.5-nbft_plugin.patch deleted file mode 100644 index b70d26e..0000000 --- a/nvme-cli-2.5-nbft_plugin.patch +++ /dev/null @@ -1,640 +0,0 @@ -From 23daeedc53be9b5225cc6806434888c0a7a8e9bf Mon Sep 17 00:00:00 2001 -From: Stuart Hayes -Date: Fri, 14 Apr 2023 22:01:07 -0400 -Subject: [PATCH 03/11] nbft: add the nbft show plugin - -Display contents of the ACPI NBFT files. - -Usage: nvme nbft show [OPTIONS] - -Options: - [ --output-format=, -o ] --- Output format: normal|json - [ --subsystem, -s ] --- show NBFT subsystems - [ --hfi, -H ] --- show NBFT HFIs - [ --discovery, -d ] --- show NBFT discovery controllers - [ --nbft-path= ] --- user-defined path for NBFT tables - -Signed-off-by: Stuart Hayes -Signed-off-by: Martin Wilck -Signed-off-by: John Meneghini ---- - plugins/meson.build | 1 + - plugins/nbft/nbft-plugin.c | 568 +++++++++++++++++++++++++++++++++++++ - plugins/nbft/nbft-plugin.h | 18 ++ - 3 files changed, 587 insertions(+) - create mode 100644 plugins/nbft/nbft-plugin.c - create mode 100644 plugins/nbft/nbft-plugin.h - -diff --git a/plugins/meson.build b/plugins/meson.build -index 2cf2486f..38b7cded 100644 ---- a/plugins/meson.build -+++ b/plugins/meson.build -@@ -12,6 +12,7 @@ if json_c_dep.found() - 'plugins/intel/intel-nvme.c', - 'plugins/memblaze/memblaze-nvme.c', - 'plugins/micron/micron-nvme.c', -+ 'plugins/nbft/nbft-plugin.c', - 'plugins/netapp/netapp-nvme.c', - 'plugins/nvidia/nvidia-nvme.c', - 'plugins/scaleflux/sfx-nvme.c', -diff --git a/plugins/nbft/nbft-plugin.c b/plugins/nbft/nbft-plugin.c -new file mode 100644 -index 00000000..6ae2525a ---- /dev/null -+++ b/plugins/nbft/nbft-plugin.c -@@ -0,0 +1,568 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+ -+#include -+#include -+#include -+ -+#include "nvme-print.h" -+#include "nvme.h" -+#include "nbft.h" -+#include "libnvme.h" -+#include "fabrics.h" -+ -+#define CREATE_CMD -+#include "nbft-plugin.h" -+ -+static const char dash[100] = {[0 ... 98] = '-', [99] = '\0'}; -+ -+#define PCI_SEGMENT(sbdf) ((sbdf & 0xffff0000) >> 16) -+#define PCI_BUS(sbdf) ((sbdf & 0x0000ff00) >> 8) -+#define PCI_DEV(sbdf) ((sbdf & 0x000000f8) >> 3) -+#define PCI_FUNC(sbdf) ((sbdf & 0x00000007) >> 0) -+ -+static const char *pci_sbdf_to_string(__u16 pci_sbdf) -+{ -+ static char pcidev[13]; -+ -+ snprintf(pcidev, sizeof(pcidev), "%x:%x:%x.%x", -+ PCI_SEGMENT(pci_sbdf), -+ PCI_BUS(pci_sbdf), -+ PCI_DEV(pci_sbdf), -+ PCI_FUNC(pci_sbdf)); -+ return pcidev; -+} -+ -+static char *mac_addr_to_string(unsigned char mac_addr[6]) -+{ -+ static char mac_string[18]; -+ -+ snprintf(mac_string, sizeof(mac_string), "%02x:%02x:%02x:%02x:%02x:%02x", -+ mac_addr[0], -+ mac_addr[1], -+ mac_addr[2], -+ mac_addr[3], -+ mac_addr[4], -+ mac_addr[5]); -+ return mac_string; -+} -+ -+static json_object *hfi_to_json(struct nbft_info_hfi *hfi) -+{ -+ struct json_object *hfi_json; -+ -+ hfi_json = json_create_object(); -+ if (!hfi_json) -+ return NULL; -+ -+ if (json_object_add_value_int(hfi_json, "index", hfi->index) -+ || json_object_add_value_string(hfi_json, "transport", hfi->transport)) -+ goto fail; -+ -+ if (strcmp(hfi->transport, "tcp") == 0) { -+ if (json_object_add_value_string(hfi_json, "pcidev", -+ pci_sbdf_to_string(hfi->tcp_info.pci_sbdf)) -+ || json_object_add_value_string(hfi_json, "mac_addr", -+ mac_addr_to_string(hfi->tcp_info.mac_addr)) -+ || json_object_add_value_int(hfi_json, "vlan", -+ hfi->tcp_info.vlan) -+ || json_object_add_value_int(hfi_json, "ip_origin", -+ hfi->tcp_info.ip_origin) -+ || json_object_add_value_string(hfi_json, "ipaddr", -+ hfi->tcp_info.ipaddr) -+ || json_object_add_value_int(hfi_json, "subnet_mask_prefix", -+ hfi->tcp_info.subnet_mask_prefix) -+ || json_object_add_value_string(hfi_json, "gateway_ipaddr", -+ hfi->tcp_info.gateway_ipaddr) -+ || json_object_add_value_int(hfi_json, "route_metric", -+ hfi->tcp_info.route_metric) -+ || json_object_add_value_string(hfi_json, "primary_dns_ipaddr", -+ hfi->tcp_info.primary_dns_ipaddr) -+ || json_object_add_value_string(hfi_json, "secondary_dns_ipaddr", -+ hfi->tcp_info.secondary_dns_ipaddr) -+ || json_object_add_value_string(hfi_json, "dhcp_server_ipaddr", -+ hfi->tcp_info.dhcp_server_ipaddr) -+ || (hfi->tcp_info.host_name -+ && json_object_add_value_string(hfi_json, "host_name", -+ hfi->tcp_info.host_name)) -+ || json_object_add_value_int(hfi_json, "this_hfi_is_default_route", -+ hfi->tcp_info.this_hfi_is_default_route) -+ || json_object_add_value_int(hfi_json, "dhcp_override", -+ hfi->tcp_info.dhcp_override)) -+ goto fail; -+ else -+ return hfi_json; -+ } -+fail: -+ json_free_object(hfi_json); -+ return NULL; -+} -+ -+static json_object *ssns_to_json(struct nbft_info_subsystem_ns *ss) -+{ -+ struct json_object *ss_json; -+ struct json_object *hfi_array_json; -+ char json_str[40]; -+ char *json_str_p; -+ int i; -+ -+ ss_json = json_create_object(); -+ if (!ss_json) -+ return NULL; -+ -+ hfi_array_json = json_create_array(); -+ if (!hfi_array_json) -+ goto fail; -+ -+ for (i = 0; i < ss->num_hfis; i++) -+ if (json_array_add_value_object(hfi_array_json, -+ json_object_new_int(ss->hfis[i]->index))) -+ goto fail; -+ -+ if (json_object_add_value_int(ss_json, "index", ss->index) -+ || json_object_add_value_int(ss_json, "num_hfis", ss->num_hfis) -+ || json_object_object_add(ss_json, "hfis", hfi_array_json) -+ || json_object_add_value_string(ss_json, "transport", ss->transport) -+ || json_object_add_value_string(ss_json, "traddr", ss->traddr) -+ || json_object_add_value_string(ss_json, "trsvcid", ss->trsvcid) -+ || json_object_add_value_int(ss_json, "subsys_port_id", ss->subsys_port_id) -+ || json_object_add_value_int(ss_json, "nsid", ss->nsid)) -+ goto fail; -+ -+ memset(json_str, 0, sizeof(json_str)); -+ json_str_p = json_str; -+ -+ switch (ss->nid_type) { -+ case NBFT_INFO_NID_TYPE_EUI64: -+ if (json_object_add_value_string(ss_json, "nid_type", "eui64")) -+ goto fail; -+ for (i = 0; i < 8; i++) -+ json_str_p += sprintf(json_str_p, "%02x", ss->nid[i]); -+ break; -+ -+ case NBFT_INFO_NID_TYPE_NGUID: -+ if (json_object_add_value_string(ss_json, "nid_type", "nguid")) -+ goto fail; -+ for (i = 0; i < 16; i++) -+ json_str_p += sprintf(json_str_p, "%02x", ss->nid[i]); -+ break; -+ -+ case NBFT_INFO_NID_TYPE_NS_UUID: -+ if (json_object_add_value_string(ss_json, "nid_type", "uuid")) -+ goto fail; -+ nvme_uuid_to_string(ss->nid, json_str); -+ break; -+ -+ default: -+ break; -+ } -+ if (json_object_add_value_string(ss_json, "nid", json_str)) -+ goto fail; -+ -+ if ((ss->subsys_nqn -+ && json_object_add_value_string(ss_json, "subsys_nqn", ss->subsys_nqn)) -+ || json_object_add_value_int(ss_json, "controller_id", ss->controller_id) -+ || json_object_add_value_int(ss_json, "asqsz", ss->asqsz) -+ || (ss->dhcp_root_path_string -+ && json_object_add_value_string(ss_json, "dhcp_root_path_string", -+ ss->dhcp_root_path_string)) -+ || json_object_add_value_int(ss_json, "pdu_header_digest_required", -+ ss->pdu_header_digest_required) -+ || json_object_add_value_int(ss_json, "data_digest_required", -+ ss->data_digest_required)) -+ goto fail; -+ -+ return ss_json; -+fail: -+ json_free_object(ss_json); -+ return NULL; -+} -+ -+static json_object *discovery_to_json(struct nbft_info_discovery *disc) -+{ -+ struct json_object *disc_json; -+ -+ disc_json = json_create_object(); -+ if (!disc_json) -+ return NULL; -+ -+ if (json_object_add_value_int(disc_json, "index", disc->index) -+ || (disc->security -+ && json_object_add_value_int(disc_json, "security", disc->security->index)) -+ || (disc->hfi -+ && json_object_add_value_int(disc_json, "hfi", disc->hfi->index)) -+ || (disc->uri -+ && json_object_add_value_string(disc_json, "uri", disc->uri)) -+ || (disc->nqn -+ && json_object_add_value_string(disc_json, "nqn", disc->nqn))) { -+ json_free_object(disc_json); -+ return NULL; -+ } else -+ return disc_json; -+} -+ -+static const char *primary_admin_host_flag_to_str(unsigned int primary) -+{ -+ static const char * const str[] = { -+ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED] = "not indicated", -+ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED] = "unselected", -+ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_SELECTED] = "selected", -+ [NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_RESERVED] = "reserved", -+ }; -+ -+ if (primary > NBFT_INFO_PRIMARY_ADMIN_HOST_FLAG_RESERVED) -+ return "INVALID"; -+ return str[primary]; -+} -+ -+static struct json_object *nbft_to_json(struct nbft_info *nbft, bool show_subsys, -+ bool show_hfi, bool show_discovery) -+{ -+ struct json_object *nbft_json, *host_json; -+ -+ nbft_json = json_create_object(); -+ if (!nbft_json) -+ return NULL; -+ -+ if (json_object_add_value_string(nbft_json, "filename", nbft->filename)) -+ goto fail; -+ -+ host_json = json_create_object(); -+ if (!host_json) -+ goto fail; -+ if ((nbft->host.nqn -+ && json_object_add_value_string(host_json, "nqn", nbft->host.nqn)) -+ || (nbft->host.id -+ && json_object_add_value_string(host_json, "id", -+ util_uuid_to_string(nbft->host.id)))) -+ goto fail; -+ json_object_add_value_int(host_json, "host_id_configured", -+ nbft->host.host_id_configured); -+ json_object_add_value_int(host_json, "host_nqn_configured", -+ nbft->host.host_nqn_configured); -+ json_object_add_value_string(host_json, "primary_admin_host_flag", -+ primary_admin_host_flag_to_str(nbft->host.primary)); -+ if (json_object_object_add(nbft_json, "host", host_json)) { -+ json_free_object(host_json); -+ goto fail; -+ } -+ -+ if (show_subsys) { -+ struct json_object *subsys_array_json, *subsys_json; -+ struct nbft_info_subsystem_ns **ss; -+ -+ subsys_array_json = json_create_array(); -+ if (!subsys_array_json) -+ goto fail; -+ for (ss = nbft->subsystem_ns_list; ss && *ss; ss++) { -+ subsys_json = ssns_to_json(*ss); -+ if (!subsys_json) -+ goto fail; -+ if (json_object_array_add(subsys_array_json, subsys_json)) { -+ json_free_object(subsys_json); -+ goto fail; -+ } -+ } -+ if (json_object_object_add(nbft_json, "subsystem", subsys_array_json)) { -+ json_free_object(subsys_array_json); -+ goto fail; -+ } -+ } -+ if (show_hfi) { -+ struct json_object *hfi_array_json, *hfi_json; -+ struct nbft_info_hfi **hfi; -+ -+ hfi_array_json = json_create_array(); -+ if (!hfi_array_json) -+ goto fail; -+ for (hfi = nbft->hfi_list; hfi && *hfi; hfi++) { -+ hfi_json = hfi_to_json(*hfi); -+ if (!hfi_json) -+ goto fail; -+ if (json_object_array_add(hfi_array_json, hfi_json)) { -+ json_free_object(hfi_json); -+ goto fail; -+ } -+ } -+ if (json_object_object_add(nbft_json, "hfi", hfi_array_json)) { -+ json_free_object(hfi_array_json); -+ goto fail; -+ } -+ } -+ if (show_discovery) { -+ struct json_object *discovery_array_json, *discovery_json; -+ struct nbft_info_discovery **disc; -+ -+ discovery_array_json = json_create_array(); -+ if (!discovery_array_json) -+ goto fail; -+ for (disc = nbft->discovery_list; disc && *disc; disc++) { -+ discovery_json = discovery_to_json(*disc); -+ if (!discovery_json) -+ goto fail; -+ if (json_object_array_add(discovery_array_json, discovery_json)) { -+ json_free_object(discovery_json); -+ goto fail; -+ } -+ } -+ if (json_object_object_add(nbft_json, "discovery", discovery_array_json)) { -+ json_free_object(discovery_array_json); -+ goto fail; -+ } -+ } -+ return nbft_json; -+fail: -+ json_free_object(nbft_json); -+ return NULL; -+} -+ -+static int json_show_nbfts(struct list_head *nbft_list, bool show_subsys, -+ bool show_hfi, bool show_discovery) -+{ -+ struct json_object *nbft_json_array, *nbft_json; -+ struct nbft_file_entry *entry; -+ -+ nbft_json_array = json_create_array(); -+ if (!nbft_json_array) -+ return ENOMEM; -+ -+ list_for_each(nbft_list, entry, node) { -+ nbft_json = nbft_to_json(entry->nbft, show_subsys, show_hfi, show_discovery); -+ if (!nbft_json) -+ goto fail; -+ if (json_object_array_add(nbft_json_array, nbft_json)) { -+ json_free_object(nbft_json); -+ goto fail; -+ } -+ } -+ -+ json_print_object(nbft_json_array, NULL); -+ printf("\n"); -+ json_free_object(nbft_json_array); -+ return 0; -+fail: -+ json_free_object(nbft_json_array); -+ return ENOMEM; -+} -+ -+static void print_nbft_hfi_info(struct nbft_info *nbft) -+{ -+ struct nbft_info_hfi **hfi; -+ unsigned int ip_width = 8, gw_width = 8, dns_width = 8; -+ -+ hfi = nbft->hfi_list; -+ if (!hfi || !*hfi) -+ return; -+ -+ for (; *hfi; hfi++) { -+ unsigned int len; -+ -+ len = strlen((*hfi)->tcp_info.ipaddr); -+ if (len > ip_width) -+ ip_width = len; -+ len = strlen((*hfi)->tcp_info.gateway_ipaddr); -+ if (len > gw_width) -+ gw_width = len; -+ len = strlen((*hfi)->tcp_info.primary_dns_ipaddr); -+ if (len > dns_width) -+ dns_width = len; -+ } -+ -+ printf("\nNBFT HFIs:\n\n"); -+ printf("%-3.3s|%-4.4s|%-10.10s|%-17.17s|%-4.4s|%-*.*s|%-4.4s|%-*.*s|%-*.*s\n", -+ "Idx", "Trsp", "PCI Addr", "MAC Addr", "DHCP", -+ ip_width, ip_width, "IP Addr", "Mask", -+ gw_width, gw_width, "Gateway", dns_width, dns_width, "DNS"); -+ printf("%-.3s+%-.4s+%-.10s+%-.17s+%-.4s+%-.*s+%-.4s+%-.*s+%-.*s\n", -+ dash, dash, dash, dash, dash, ip_width, dash, dash, -+ gw_width, dash, dns_width, dash); -+ for (hfi = nbft->hfi_list; *hfi; hfi++) -+ printf("%-3d|%-4.4s|%-10.10s|%-17.17s|%-4.4s|%-*.*s|%-4d|%-*.*s|%-*.*s\n", -+ (*hfi)->index, -+ (*hfi)->transport, -+ pci_sbdf_to_string((*hfi)->tcp_info.pci_sbdf), -+ mac_addr_to_string((*hfi)->tcp_info.mac_addr), -+ (*hfi)->tcp_info.dhcp_override ? "yes" : "no", -+ ip_width, ip_width, (*hfi)->tcp_info.ipaddr, -+ (*hfi)->tcp_info.subnet_mask_prefix, -+ gw_width, gw_width, (*hfi)->tcp_info.gateway_ipaddr, -+ dns_width, dns_width, (*hfi)->tcp_info.primary_dns_ipaddr); -+} -+ -+static void print_nbft_discovery_info(struct nbft_info *nbft) -+{ -+ struct nbft_info_discovery **disc; -+ unsigned int nqn_width = 20, uri_width = 12; -+ -+ disc = nbft->discovery_list; -+ if (!disc || !*disc) -+ return; -+ -+ for (; *disc; disc++) { -+ size_t len; -+ -+ len = strlen((*disc)->uri); -+ if (len > uri_width) -+ uri_width = len; -+ len = strlen((*disc)->nqn); -+ if (len > nqn_width) -+ nqn_width = len; -+ } -+ -+ printf("\nNBFT Discovery Controllers:\n\n"); -+ printf("%-3.3s|%-*.*s|%-*.*s\n", "Idx", uri_width, uri_width, "URI", -+ nqn_width, nqn_width, "NQN"); -+ printf("%-.3s+%-.*s+%-.*s\n", dash, uri_width, dash, nqn_width, dash); -+ for (disc = nbft->discovery_list; *disc; disc++) -+ printf("%-3d|%-*.*s|%-*.*s\n", (*disc)->index, -+ uri_width, uri_width, (*disc)->uri, -+ nqn_width, nqn_width, (*disc)->nqn); -+} -+ -+#define HFIS_LEN 20 -+static size_t print_hfis(const struct nbft_info_subsystem_ns *ss, char buf[HFIS_LEN]) -+{ -+ char hfi_buf[HFIS_LEN]; -+ size_t len, ofs; -+ int i; -+ -+ len = snprintf(hfi_buf, sizeof(hfi_buf), "%d", ss->hfis[0]->index); -+ for (i = 1; i < ss->num_hfis; i++) { -+ ofs = len; -+ len += snprintf(hfi_buf + ofs, sizeof(hfi_buf) - ofs, ",%d", -+ ss->hfis[i]->index); -+ /* -+ * If the list doesn't fit in HFIS_LEN characters, -+ * truncate and end with "..." -+ */ -+ if (len >= sizeof(hfi_buf)) { -+ while (ofs < sizeof(hfi_buf) - 1) -+ hfi_buf[ofs++] = '.'; -+ hfi_buf[ofs] = '\0'; -+ len = sizeof(hfi_buf) - 1; -+ break; -+ } -+ } -+ if (buf) -+ memcpy(buf, hfi_buf, len + 1); -+ return len; -+} -+ -+ -+static void print_nbft_subsys_info(struct nbft_info *nbft) -+{ -+ struct nbft_info_subsystem_ns **ss; -+ unsigned int nqn_width = 20, adr_width = 8, hfi_width = 4; -+ -+ ss = nbft->subsystem_ns_list; -+ if (!ss || !*ss) -+ return; -+ for (; *ss; ss++) { -+ size_t len; -+ -+ len = strlen((*ss)->subsys_nqn); -+ if (len > nqn_width) -+ nqn_width = len; -+ len = strlen((*ss)->traddr); -+ if (len > adr_width) -+ adr_width = len; -+ len = print_hfis(*ss, NULL); -+ if (len > hfi_width) -+ hfi_width = len; -+ } -+ -+ printf("\nNBFT Subsystems:\n\n"); -+ printf("%-3.3s|%-*.*s|%-4.4s|%-*.*s|%-5.5s|%-*.*s\n", -+ "Idx", nqn_width, nqn_width, "NQN", -+ "Trsp", adr_width, adr_width, "Address", "SvcId", hfi_width, hfi_width, "HFIs"); -+ printf("%-.3s+%-.*s+%-.4s+%-.*s+%-.5s+%-.*s\n", -+ dash, nqn_width, dash, dash, adr_width, dash, dash, hfi_width, dash); -+ for (ss = nbft->subsystem_ns_list; *ss; ss++) { -+ char hfi_buf[HFIS_LEN]; -+ -+ print_hfis(*ss, hfi_buf); -+ printf("%-3d|%-*.*s|%-4.4s|%-*.*s|%-5.5s|%-*.*s\n", -+ (*ss)->index, nqn_width, nqn_width, (*ss)->subsys_nqn, -+ (*ss)->transport, adr_width, adr_width, (*ss)->traddr, -+ (*ss)->trsvcid, hfi_width, hfi_width, hfi_buf); -+ } -+} -+ -+static void normal_show_nbft(struct nbft_info *nbft, bool show_subsys, -+ bool show_hfi, bool show_discovery) -+{ -+ printf("%s:\n", nbft->filename); -+ if ((!nbft->hfi_list || !*nbft->hfi_list) && -+ (!nbft->security_list || !*nbft->security_list) && -+ (!nbft->discovery_list || !*nbft->discovery_list) && -+ (!nbft->subsystem_ns_list || !*nbft->subsystem_ns_list)) -+ printf("(empty)\n"); -+ else { -+ if (show_subsys) -+ print_nbft_subsys_info(nbft); -+ if (show_hfi) -+ print_nbft_hfi_info(nbft); -+ if (show_discovery) -+ print_nbft_discovery_info(nbft); -+ } -+} -+ -+static void normal_show_nbfts(struct list_head *nbft_list, bool show_subsys, -+ bool show_hfi, bool show_discovery) -+{ -+ bool not_first = false; -+ struct nbft_file_entry *entry; -+ -+ list_for_each(nbft_list, entry, node) { -+ if (not_first) -+ printf("\n"); -+ normal_show_nbft(entry->nbft, show_subsys, show_hfi, show_discovery); -+ not_first = true; -+ } -+} -+ -+int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin) -+{ -+ const char *desc = "Display contents of the ACPI NBFT files."; -+ struct list_head nbft_list; -+ char *format = "normal"; -+ char *nbft_path = NBFT_SYSFS_PATH; -+ enum nvme_print_flags flags = -1; -+ int ret; -+ bool show_subsys = false, show_hfi = false, show_discovery = false; -+ -+ OPT_ARGS(opts) = { -+ OPT_FMT("output-format", 'o', &format, "Output format: normal|json"), -+ OPT_FLAG("subsystem", 's', &show_subsys, "show NBFT subsystems"), -+ OPT_FLAG("hfi", 'H', &show_hfi, "show NBFT HFIs"), -+ OPT_FLAG("discovery", 'd', &show_discovery, "show NBFT discovery controllers"), -+ OPT_STRING("nbft-path", 0, "STR", &nbft_path, "user-defined path for NBFT tables"), -+ OPT_END() -+ }; -+ -+ ret = argconfig_parse(argc, argv, desc, opts); -+ if (ret) -+ return ret; -+ -+ if (!(show_subsys || show_hfi || show_discovery)) -+ show_subsys = show_hfi = show_discovery = true; -+ -+ if (!strcmp(format, "")) -+ flags = -1; -+ else if (!strcmp(format, "normal")) -+ flags = NORMAL; -+ else if (!strcmp(format, "json")) -+ flags = JSON; -+ else -+ return EINVAL; -+ -+ list_head_init(&nbft_list); -+ ret = read_nbft_files(&nbft_list, nbft_path); -+ if (!ret) { -+ if (flags == NORMAL) -+ normal_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery); -+ else if (flags == JSON) -+ ret = json_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery); -+ free_nbfts(&nbft_list); -+ } -+ return ret; -+} -diff --git a/plugins/nbft/nbft-plugin.h b/plugins/nbft/nbft-plugin.h -new file mode 100644 -index 00000000..018349d9 ---- /dev/null -+++ b/plugins/nbft/nbft-plugin.h -@@ -0,0 +1,18 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+#undef CMD_INC_FILE -+#define CMD_INC_FILE plugins/nbft/nbft-plugin -+ -+#if !defined(NBFT) || defined(CMD_HEADER_MULTI_READ) -+#define NBFT -+ -+#include "cmd.h" -+ -+PLUGIN(NAME("nbft", "ACPI NBFT table extensions", NVME_VERSION), -+ COMMAND_LIST( -+ ENTRY("show", "Show contents of ACPI NBFT tables", show_nbft) -+ ) -+); -+ -+#endif -+ -+#include "define_cmd.h" --- -2.39.2 - diff --git a/nvme-cli.spec b/nvme-cli.spec index 06bb083..00a530b 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,18 +2,14 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.4 -Release: 2%{?dist} +Version: 2.5 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPLv2 URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -Patch100: nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch -Patch101: nvme-cli-2.5-nbft.patch -Patch102: nvme-cli-2.5-nbft_plugin.patch - BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -21,7 +17,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.4-2 +BuildRequires: libnvme-devel >= 1.5 BuildRequires: json-c-devel >= 0.13 %if (0%{?rhel} == 0) @@ -44,7 +40,7 @@ nvme-cli provides NVM-Express user space tooling for Linux. %build -%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} +%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Dpdc-enabled=true -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} %meson_build @@ -87,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Jul 04 2023 Tomas Bzatek - 2.5-1 +- Update to 2.5 + * Thu Apr 20 2023 Tomas Bzatek - 2.4-2 - Backport the NBFT support from git master diff --git a/sources b/sources index edbc0db..f820245 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.4.tar.gz) = 155667a0b91e15267e3f991a30cf1d4ae26cb4c53b20c002e3d3341496dd463397e1afbfefcd7a8df88370d28417940ce44a060bda87c04482bbe3be4e901b73 +SHA512 (nvme-cli-2.5.tar.gz) = 50c557e86e95b27a0ad57779c33bbb847e12dd45c30e792f5ce1d52dedd4bc704ac25fa0af2fdebd281c9dfe0059f7ed7c1620fccfde9323f6f9a97afdf8c3cb From f698c8b972212757ca4381b3647358bc1c048bca Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 17:02:07 +0000 Subject: [PATCH 26/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 00a530b..ee910bc 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -83,6 +83,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 2.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jul 04 2023 Tomas Bzatek - 2.5-1 - Update to 2.5 From cab2a0bb500c09e6b02b406d4f735b9d865664bc Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 1 Aug 2023 23:59:03 -0400 Subject: [PATCH 27/52] Drop linter and formatter dependencies This is to conform to Python packaging guidelines, not to mention that the tests are not even run during the build. Additionally, autopep8 is not yet compatible with Python 3.12, thereby blocking this from building. https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters --- nvme-cli.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index ee910bc..8f80740 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -22,10 +22,11 @@ BuildRequires: json-c-devel >= 0.13 %if (0%{?rhel} == 0) BuildRequires: python3-nose2 -BuildRequires: python3-mypy -BuildRequires: python3-flake8 -BuildRequires: python3-autopep8 -BuildRequires: python3-isort +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +#BuildRequires: python3-mypy +#BuildRequires: python3-flake8 +#BuildRequires: python3-autopep8 +#BuildRequires: python3-isort %endif BuildRequires: asciidoc BuildRequires: xmlto From 9814f5822c50b1de675ba865339f7e851ddbc041 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 14 Aug 2023 17:47:53 +0200 Subject: [PATCH 28/52] * Mon Aug 14 2023 Tomas Bzatek - 2.5-3 - Backport 'fabrics: Use corresponding hostid when hostnqn is generated' --- ...ing_hostid_when_hostnqn_is_generated.patch | 103 ++++++++++++++++++ nvme-cli.spec | 15 +-- 2 files changed, 109 insertions(+), 9 deletions(-) create mode 100644 nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch diff --git a/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch b/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch new file mode 100644 index 0000000..f9fc2fe --- /dev/null +++ b/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch @@ -0,0 +1,103 @@ +From 7d1c18f581e489e0cedfd9991bc97a2f8239cf82 Mon Sep 17 00:00:00 2001 +From: Shin'ichiro Kawasaki +Date: Thu, 3 Aug 2023 20:21:39 +0900 +Subject: [PATCH] fabrics: Use corresponding hostid when hostnqn is generated + +After the kernel commit ae8bd606e09b ("nvme-fabrics: prevent overriding +of existing host"), kernel ensures hostid and hostnqn maintain 1:1 +mapping and "non 1:1 mapping will be rejected". This makes 'nvme +discover' and 'nvme connect' commands fail when they generate hostnqn, +since it does not use corresponding hostid. + +To avoid the failures, prepare and use corresponding hostid to the +generated hostnqn, taking the hostid from the hostnqn string. Also add +checks for prepared hostnqn and hostid. If the hostid taken from the +generated hostnqn is different from the hostid from file, print a +warning message. Also, if the prepared hostnqn are inconsistent with the +prepared hostid, print a warning. + +Link: https://lore.kernel.org/linux-nvme/l7vk7fnzltpmvkwujsbf2btrzip6wh7ug62iwa3totqcda25l6@siqx7tj6lt3l/ +Signed-off-by: Shin'ichiro Kawasaki +Signed-off-by: Daniel Wagner +--- + fabrics.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 45 insertions(+), 2 deletions(-) + +diff --git a/fabrics.c b/fabrics.c +index 14a91cc6b..40aef6932 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -689,6 +689,43 @@ static int nvme_read_volatile_config(nvme_root_t r) + return ret; + } + ++char *nvmf_hostid_from_hostnqn(const char *hostnqn) ++{ ++ const char *uuid; ++ ++ if (!hostnqn) ++ return NULL; ++ ++ uuid = strstr(hostnqn, "uuid:"); ++ if (!uuid) ++ return NULL; ++ ++ return strdup(uuid + strlen("uuid:")); ++} ++ ++void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn) ++{ ++ char *hostid_from_file, *hostid_from_hostnqn; ++ ++ if (!hostid) ++ return; ++ ++ 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"); ++ free(hostid_from_file); ++ } ++ ++ if (!hostnqn) ++ return; ++ ++ 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"); ++ free(hostid_from_hostnqn); ++ } ++} ++ + int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + { + char *subsysnqn = NVME_DISC_SUBSYS_NAME; +@@ -765,10 +802,13 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) + hostid_arg = hostid; + if (!hostnqn) + hostnqn = hnqn = nvmf_hostnqn_from_file(); +- if (!hostnqn) ++ if (!hostnqn) { + hostnqn = hnqn = nvmf_hostnqn_generate(); ++ hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); ++ } + if (!hostid) + hostid = hid = nvmf_hostid_from_file(); ++ nvmf_check_hostid_and_hostnqn(hostid, hostnqn); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + ret = ENOMEM; +@@ -978,10 +1018,13 @@ int nvmf_connect(const char *desc, int argc, char **argv) + + if (!hostnqn) + hostnqn = hnqn = nvmf_hostnqn_from_file(); +- if (!hostnqn) ++ if (!hostnqn) { + hostnqn = hnqn = nvmf_hostnqn_generate(); ++ hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); ++ } + if (!hostid) + hostid = hid = nvmf_hostid_from_file(); ++ nvmf_check_hostid_and_hostnqn(hostid, hostnqn); + h = nvme_lookup_host(r, hostnqn, hostid); + if (!h) { + errno = ENOMEM; diff --git a/nvme-cli.spec b/nvme-cli.spec index 8f80740..e5145ac 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -20,19 +20,13 @@ BuildRequires: openssl-devel BuildRequires: libnvme-devel >= 1.5 BuildRequires: json-c-devel >= 0.13 -%if (0%{?rhel} == 0) -BuildRequires: python3-nose2 -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters -#BuildRequires: python3-mypy -#BuildRequires: python3-flake8 -#BuildRequires: python3-autopep8 -#BuildRequires: python3-isort -%endif BuildRequires: asciidoc BuildRequires: xmlto Requires: util-linux +Patch0: nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch + %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -84,6 +78,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Mon Aug 14 2023 Tomas Bzatek - 2.5-3 +- Backport 'fabrics: Use corresponding hostid when hostnqn is generated' + * Thu Jul 20 2023 Fedora Release Engineering - 2.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 75620ef422c534b51d3542e81a07e9e0d12ffe33 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 17 Aug 2023 17:31:51 +0200 Subject: [PATCH 29/52] * Thu Aug 17 2023 Tomas Bzatek - 2.5-4 - Mark /etc/nvme/discovery.conf as (noreplace) --- nvme-cli.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index e5145ac..0a029d2 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: NVMe management command line interface License: GPLv2 @@ -66,7 +66,7 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_datadir}/bash-completion/completions/nvme %{_datadir}/zsh/site-functions/_nvme %dir %{_sysconfdir}/nvme -%{_sysconfdir}/nvme/discovery.conf +%config(noreplace) %{_sysconfdir}/nvme/discovery.conf %{_unitdir}/nvmefc-boot-connections.service %{_unitdir}/nvmf-autoconnect.service %{_unitdir}/nvmf-connect.target @@ -78,6 +78,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Aug 17 2023 Tomas Bzatek - 2.5-4 +- Mark /etc/nvme/discovery.conf as (noreplace) + * Mon Aug 14 2023 Tomas Bzatek - 2.5-3 - Backport 'fabrics: Use corresponding hostid when hostnqn is generated' From 1f94235a8ff2acd2a8a80376fdafd0d66e17404e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 29 Sep 2023 15:49:48 +0200 Subject: [PATCH 30/52] * Fri Sep 29 2023 Tomas Bzatek - 2.6-1 - Update to 2.6 --- .gitignore | 1 + ...ing_hostid_when_hostnqn_is_generated.patch | 103 ------------------ nvme-cli.spec | 13 ++- sources | 2 +- 4 files changed, 9 insertions(+), 110 deletions(-) delete mode 100644 nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch diff --git a/.gitignore b/.gitignore index 3555f05..c0a99be 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /nvme-cli-2.3.tar.gz /nvme-cli-2.4.tar.gz /nvme-cli-2.5.tar.gz +/nvme-cli-2.6.tar.gz diff --git a/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch b/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch deleted file mode 100644 index f9fc2fe..0000000 --- a/nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 7d1c18f581e489e0cedfd9991bc97a2f8239cf82 Mon Sep 17 00:00:00 2001 -From: Shin'ichiro Kawasaki -Date: Thu, 3 Aug 2023 20:21:39 +0900 -Subject: [PATCH] fabrics: Use corresponding hostid when hostnqn is generated - -After the kernel commit ae8bd606e09b ("nvme-fabrics: prevent overriding -of existing host"), kernel ensures hostid and hostnqn maintain 1:1 -mapping and "non 1:1 mapping will be rejected". This makes 'nvme -discover' and 'nvme connect' commands fail when they generate hostnqn, -since it does not use corresponding hostid. - -To avoid the failures, prepare and use corresponding hostid to the -generated hostnqn, taking the hostid from the hostnqn string. Also add -checks for prepared hostnqn and hostid. If the hostid taken from the -generated hostnqn is different from the hostid from file, print a -warning message. Also, if the prepared hostnqn are inconsistent with the -prepared hostid, print a warning. - -Link: https://lore.kernel.org/linux-nvme/l7vk7fnzltpmvkwujsbf2btrzip6wh7ug62iwa3totqcda25l6@siqx7tj6lt3l/ -Signed-off-by: Shin'ichiro Kawasaki -Signed-off-by: Daniel Wagner ---- - fabrics.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 45 insertions(+), 2 deletions(-) - -diff --git a/fabrics.c b/fabrics.c -index 14a91cc6b..40aef6932 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -689,6 +689,43 @@ static int nvme_read_volatile_config(nvme_root_t r) - return ret; - } - -+char *nvmf_hostid_from_hostnqn(const char *hostnqn) -+{ -+ const char *uuid; -+ -+ if (!hostnqn) -+ return NULL; -+ -+ uuid = strstr(hostnqn, "uuid:"); -+ if (!uuid) -+ return NULL; -+ -+ return strdup(uuid + strlen("uuid:")); -+} -+ -+void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn) -+{ -+ char *hostid_from_file, *hostid_from_hostnqn; -+ -+ if (!hostid) -+ return; -+ -+ 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"); -+ free(hostid_from_file); -+ } -+ -+ if (!hostnqn) -+ return; -+ -+ 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"); -+ free(hostid_from_hostnqn); -+ } -+} -+ - int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - { - char *subsysnqn = NVME_DISC_SUBSYS_NAME; -@@ -765,10 +802,13 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect) - hostid_arg = hostid; - if (!hostnqn) - hostnqn = hnqn = nvmf_hostnqn_from_file(); -- if (!hostnqn) -+ if (!hostnqn) { - hostnqn = hnqn = nvmf_hostnqn_generate(); -+ hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); -+ } - if (!hostid) - hostid = hid = nvmf_hostid_from_file(); -+ nvmf_check_hostid_and_hostnqn(hostid, hostnqn); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - ret = ENOMEM; -@@ -978,10 +1018,13 @@ int nvmf_connect(const char *desc, int argc, char **argv) - - if (!hostnqn) - hostnqn = hnqn = nvmf_hostnqn_from_file(); -- if (!hostnqn) -+ if (!hostnqn) { - hostnqn = hnqn = nvmf_hostnqn_generate(); -+ hostid = hid = nvmf_hostid_from_hostnqn(hostnqn); -+ } - if (!hostid) - hostid = hid = nvmf_hostid_from_file(); -+ nvmf_check_hostid_and_hostnqn(hostid, hostnqn); - h = nvme_lookup_host(r, hostnqn, hostid); - if (!h) { - errno = ENOMEM; diff --git a/nvme-cli.spec b/nvme-cli.spec index 0a029d2..d94873e 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,11 +2,11 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.5 -Release: 4%{?dist} +Version: 2.6 +Release: 1%{?dist} Summary: NVMe management command line interface -License: GPLv2 +License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz @@ -17,7 +17,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.5 +BuildRequires: libnvme-devel >= 1.6 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -25,8 +25,6 @@ BuildRequires: xmlto Requires: util-linux -Patch0: nvme-cli-2.6-fabrics-Use_corresponding_hostid_when_hostnqn_is_generated.patch - %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -78,6 +76,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Sep 29 2023 Tomas Bzatek - 2.6-1 +- Update to 2.6 + * Thu Aug 17 2023 Tomas Bzatek - 2.5-4 - Mark /etc/nvme/discovery.conf as (noreplace) diff --git a/sources b/sources index f820245..844ac50 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.5.tar.gz) = 50c557e86e95b27a0ad57779c33bbb847e12dd45c30e792f5ce1d52dedd4bc704ac25fa0af2fdebd281c9dfe0059f7ed7c1620fccfde9323f6f9a97afdf8c3cb +SHA512 (nvme-cli-2.6.tar.gz) = da4daef2d7c554455e0c195c03f92188e0e946409a3bd8a5b421d9a106746e82fb1309901d2893639b1a3447bda094c80a9f49f59bf43cf2b00402f82beea3fc From 896366b17e4af9f831d578e6342e6faf7998c956 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 28 Dec 2023 17:55:23 +0100 Subject: [PATCH 31/52] * Thu Dec 28 2023 Tomas Bzatek - 2.7.1-1 - Update to 2.7.1 --- .gitignore | 1 + nvme-cli.spec | 11 ++++++++--- sources | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c0a99be..8fdd0f5 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ /nvme-cli-2.4.tar.gz /nvme-cli-2.5.tar.gz /nvme-cli-2.6.tar.gz +/nvme-cli-2.7.1.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index d94873e..1a064d5 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,7 +2,7 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.6 +Version: 2.7.1 Release: 1%{?dist} Summary: NVMe management command line interface @@ -17,7 +17,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel -BuildRequires: libnvme-devel >= 1.6 +BuildRequires: libnvme-devel >= 1.7 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -69,13 +69,18 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_unitdir}/nvmf-autoconnect.service %{_unitdir}/nvmf-connect.target %{_unitdir}/nvmf-connect@.service +%{_unitdir}/nvmf-connect-nbft.service +%{_udevrulesdir}/65-persistent-net-nbft.rules %{_udevrulesdir}/70-nvmf-autoconnect.rules -%{_udevrulesdir}/71-nvmf-iopolicy-netapp.rules +%{_udevrulesdir}/71-nvmf-netapp.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %changelog +* Thu Dec 28 2023 Tomas Bzatek - 2.7.1-1 +- Update to 2.7.1 + * Fri Sep 29 2023 Tomas Bzatek - 2.6-1 - Update to 2.6 diff --git a/sources b/sources index 844ac50..a7c2d60 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.6.tar.gz) = da4daef2d7c554455e0c195c03f92188e0e946409a3bd8a5b421d9a106746e82fb1309901d2893639b1a3447bda094c80a9f49f59bf43cf2b00402f82beea3fc +SHA512 (nvme-cli-2.7.1.tar.gz) = 6a9f3574dfd4375e6f7a76ed95f698efb26da5b72a490579caeba9d46c4811ae31650844e0a0e1047dc627158d5ffbdc020112a5059d3195e7eadff902b70b19 From 3e759bfe3cb8ca5503e64b8ab83c54473663961e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 10:03:06 +0000 Subject: [PATCH 32/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 1a064d5..1042817 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.7.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -78,6 +78,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 2.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Dec 28 2023 Tomas Bzatek - 2.7.1-1 - Update to 2.7.1 From 2b8ee26cf3fce61a654aab2de8ee216553558f21 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 09:33:49 +0000 Subject: [PATCH 33/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 1042817..d5aadb6 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.7.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -78,6 +78,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 2.7.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 2.7.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 7c6488aa09cbbd8592cda47ca55645e01fe02df8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 9 Feb 2024 14:47:14 +0100 Subject: [PATCH 34/52] * Fri Feb 09 2024 Tomas Bzatek - 2.7.1-4 - Lower the verbosity of TP4126 hostnqn-hostid consistency checks --- ...-2.8.0-TP4126-lower_hostnqn_warnings.patch | 68 +++++++++++++++++++ nvme-cli.spec | 8 ++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch diff --git a/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch b/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch new file mode 100644 index 0000000..b1c0306 --- /dev/null +++ b/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch @@ -0,0 +1,68 @@ +From 252929069d6c9042e9c95f41788006cb3eb2f452 Mon Sep 17 00:00:00 2001 +From: Martin George +Date: Tue, 19 Dec 2023 21:59:07 +0530 +Subject: [PATCH] fabrics: move hostid/hostnqn warnings to verbose level + +Currently nvme connect prints an annoying "use hostid which +does not match uuid in hostnqn" warning even for normal +scenarios when both the hostid and hostnqn files are present. +So move these warnings to verbose level instead. + +Signed-off-by: Martin George +--- + fabrics.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/fabrics.c b/fabrics.c +index 2a0ad7089..dcae9aead 100644 +--- a/fabrics.c ++++ b/fabrics.c +@@ -632,7 +632,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 +641,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 +652,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 +745,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 +968,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; diff --git a/nvme-cli.spec b/nvme-cli.spec index d5aadb6..02510e1 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,13 +3,16 @@ Name: nvme-cli Version: 2.7.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +# https://github.com/linux-nvme/nvme-cli/pull/2165 +Patch0: nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch + BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -78,6 +81,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Feb 09 2024 Tomas Bzatek - 2.7.1-4 +- Lower the verbosity of TP4126 hostnqn-hostid consistency checks + * Thu Jan 25 2024 Fedora Release Engineering - 2.7.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 8db1f0f09ea1e0630c7699d15f1a09adca35fc9b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 14 Feb 2024 14:33:22 +0100 Subject: [PATCH 35/52] * Wed Feb 14 2024 Tomas Bzatek - 2.8-1 - Update to 2.8 --- .gitignore | 1 + ...-2.8.0-TP4126-lower_hostnqn_warnings.patch | 68 ------------------- nvme-cli.spec | 15 ++-- sources | 2 +- 4 files changed, 11 insertions(+), 75 deletions(-) delete mode 100644 nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch diff --git a/.gitignore b/.gitignore index 8fdd0f5..84ef6fb 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ /nvme-cli-2.5.tar.gz /nvme-cli-2.6.tar.gz /nvme-cli-2.7.1.tar.gz +/nvme-cli-2.8.tar.gz diff --git a/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch b/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch deleted file mode 100644 index b1c0306..0000000 --- a/nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 252929069d6c9042e9c95f41788006cb3eb2f452 Mon Sep 17 00:00:00 2001 -From: Martin George -Date: Tue, 19 Dec 2023 21:59:07 +0530 -Subject: [PATCH] fabrics: move hostid/hostnqn warnings to verbose level - -Currently nvme connect prints an annoying "use hostid which -does not match uuid in hostnqn" warning even for normal -scenarios when both the hostid and hostnqn files are present. -So move these warnings to verbose level instead. - -Signed-off-by: Martin George ---- - fabrics.c | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/fabrics.c b/fabrics.c -index 2a0ad7089..dcae9aead 100644 ---- a/fabrics.c -+++ b/fabrics.c -@@ -632,7 +632,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 +641,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 +652,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 +745,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 +968,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; diff --git a/nvme-cli.spec b/nvme-cli.spec index 02510e1..2472c15 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,25 +2,25 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.7.1 -Release: 4%{?dist} +Version: 2.8 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -# https://github.com/linux-nvme/nvme-cli/pull/2165 -Patch0: nvme-cli-2.8.0-TP4126-lower_hostnqn_warnings.patch - BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel +%if (0%{?rhel} == 0) || (0%{?rhel} > 9) +BuildRequires: kernel-headers +%endif -BuildRequires: libnvme-devel >= 1.7 +BuildRequires: libnvme-devel >= 1.8 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -81,6 +81,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Wed Feb 14 2024 Tomas Bzatek - 2.8-1 +- Update to 2.8 + * Fri Feb 09 2024 Tomas Bzatek - 2.7.1-4 - Lower the verbosity of TP4126 hostnqn-hostid consistency checks diff --git a/sources b/sources index a7c2d60..5f3c195 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.7.1.tar.gz) = 6a9f3574dfd4375e6f7a76ed95f698efb26da5b72a490579caeba9d46c4811ae31650844e0a0e1047dc627158d5ffbdc020112a5059d3195e7eadff902b70b19 +SHA512 (nvme-cli-2.8.tar.gz) = 1be0bed4e1bf8a25229f301c2b00b78d2de4eaf8ff2b815fa75e44dd35ddd7787604152bdf00696130df3281206a734c5f408c3f2127440e05c2e4b1cdbb79d4 From ae14179a66514f8e45e29749567858b7b4b1ec9d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 23 Apr 2024 15:33:41 +0200 Subject: [PATCH 36/52] * Tue Apr 23 2024 Tomas Bzatek - 2.8-2 - Harden the systemd units --- nvme-cli-2.9-systemd-hardening.patch | 110 +++++++++++++++++++++++++++ nvme-cli.spec | 8 +- 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 nvme-cli-2.9-systemd-hardening.patch diff --git a/nvme-cli-2.9-systemd-hardening.patch b/nvme-cli-2.9-systemd-hardening.patch new file mode 100644 index 0000000..803b407 --- /dev/null +++ b/nvme-cli-2.9-systemd-hardening.patch @@ -0,0 +1,110 @@ +From 3d08dcfc5c7ba7cc777ba8b669af78bb9130001b Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Tue, 4 Apr 2023 14:06:03 +0200 +Subject: [PATCH] nvmf-connect: systemd hardening effort + +Apply the recommended hardening settings as recommended by openSUSE +and Fedor project. A few of the hardening option have to turned of +because nvme-cli needs write access to sysfs and /dev/nvme devices. + +Links: https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +Links: https://fedoraproject.org/wiki/Changes/SystemdSecurityHardening +Signed-off-by: Daniel Wagner +--- + .../systemd/nvmefc-boot-connections.service.in | 12 ++++++++++++ + nvmf-autoconnect/systemd/nvmf-autoconnect.service.in | 12 ++++++++++++ + .../systemd/nvmf-connect-nbft.service.in | 12 ++++++++++++ + nvmf-autoconnect/systemd/nvmf-connect@.service.in | 12 ++++++++++++ + 4 files changed, 48 insertions(+) + +diff --git a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in +index 7036625c7..783feb067 100644 +--- a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in ++++ b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in +@@ -6,6 +6,18 @@ After=systemd-udevd.service + Before=local-fs-pre.target + + [Service] ++ProtectSystem=full ++ProtectHome=true ++ProtectHostname=true ++ProtectKernelModules=true ++ProtectKernelLogs=true ++ProtectControlGroups=true ++ProtectProc=invisible ++RestrictRealtime=true ++LockPersonality=yes ++MemoryDenyWriteExecute=yes ++RemoveIPC=yes ++RestrictAddressFamilies=none + Type=oneshot + ExecStart=/bin/sh -c "echo add > /sys/class/fc/fc_udev_device/nvme_discovery" + +diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in +index 92960cde6..1ac158846 100644 +--- a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in ++++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in +@@ -8,6 +8,18 @@ After=network-online.target + Before=remote-fs-pre.target + + [Service] ++ProtectSystem=full ++ProtectHome=true ++ProtectHostname=true ++ProtectKernelModules=true ++ProtectKernelLogs=true ++ProtectControlGroups=true ++ProtectProc=invisible ++RestrictRealtime=true ++LockPersonality=yes ++MemoryDenyWriteExecute=yes ++RemoveIPC=yes ++RestrictAddressFamilies=AF_INET AF_INET6 + Type=oneshot + ExecStart=@SBINDIR@/nvme connect-all --context=autoconnect + +diff --git a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in +index 820e6ced2..e3934fe70 100644 +--- a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in ++++ b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in +@@ -10,5 +10,17 @@ After=network-online.target + Before=remote-fs-pre.target + + [Service] ++ProtectSystem=full ++ProtectHome=true ++ProtectHostname=true ++ProtectKernelModules=true ++ProtectKernelLogs=true ++ProtectControlGroups=true ++ProtectProc=invisible ++RestrictRealtime=true ++LockPersonality=yes ++MemoryDenyWriteExecute=yes ++RemoveIPC=yes ++RestrictAddressFamilies=AF_INET AF_INET6 + Type=oneshot + ExecStart=@SBINDIR@/nvme connect-all --nbft +diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service.in b/nvmf-autoconnect/systemd/nvmf-connect@.service.in +index 5ba70863e..3cec3476f 100644 +--- a/nvmf-autoconnect/systemd/nvmf-connect@.service.in ++++ b/nvmf-autoconnect/systemd/nvmf-connect@.service.in +@@ -11,6 +11,18 @@ PartOf=nvmf-connect.target + Requires=nvmf-connect.target + + [Service] ++ProtectSystem=full ++ProtectHome=true ++ProtectHostname=true ++ProtectKernelModules=true ++ProtectKernelLogs=true ++ProtectControlGroups=true ++ProtectProc=invisible ++RestrictRealtime=true ++LockPersonality=yes ++MemoryDenyWriteExecute=yes ++RemoveIPC=yes ++RestrictAddressFamilies=AF_INET AF_INET6 + Type=simple + Environment="CONNECT_ARGS=%i" + ExecStart=/bin/sh -c "@SBINDIR@/nvme connect-all --context=autoconnect --quiet `/bin/echo -e '${CONNECT_ARGS}'`" diff --git a/nvme-cli.spec b/nvme-cli.spec index 2472c15..8e15e7d 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -28,6 +28,9 @@ BuildRequires: xmlto Requires: util-linux +# https://github.com/linux-nvme/nvme-cli/pull/2284 +Patch0: nvme-cli-2.9-systemd-hardening.patch + %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -81,6 +84,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Apr 23 2024 Tomas Bzatek - 2.8-2 +- Harden the systemd units + * Wed Feb 14 2024 Tomas Bzatek - 2.8-1 - Update to 2.8 From d3fe246793d1eacab5276f4a83613c2e507d3ea5 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 3 May 2024 17:52:31 +0200 Subject: [PATCH 37/52] * Fri May 03 2024 Tomas Bzatek - 2.9.1-1 - Update to 2.9.1 --- .gitignore | 1 + nvme-cli-2.9-systemd-hardening.patch | 110 --------------------------- nvme-cli.spec | 11 +-- sources | 2 +- 4 files changed, 8 insertions(+), 116 deletions(-) delete mode 100644 nvme-cli-2.9-systemd-hardening.patch diff --git a/.gitignore b/.gitignore index 84ef6fb..79f773d 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /nvme-cli-2.6.tar.gz /nvme-cli-2.7.1.tar.gz /nvme-cli-2.8.tar.gz +/nvme-cli-2.9.1.tar.gz diff --git a/nvme-cli-2.9-systemd-hardening.patch b/nvme-cli-2.9-systemd-hardening.patch deleted file mode 100644 index 803b407..0000000 --- a/nvme-cli-2.9-systemd-hardening.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 3d08dcfc5c7ba7cc777ba8b669af78bb9130001b Mon Sep 17 00:00:00 2001 -From: Daniel Wagner -Date: Tue, 4 Apr 2023 14:06:03 +0200 -Subject: [PATCH] nvmf-connect: systemd hardening effort - -Apply the recommended hardening settings as recommended by openSUSE -and Fedor project. A few of the hardening option have to turned of -because nvme-cli needs write access to sysfs and /dev/nvme devices. - -Links: https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort -Links: https://fedoraproject.org/wiki/Changes/SystemdSecurityHardening -Signed-off-by: Daniel Wagner ---- - .../systemd/nvmefc-boot-connections.service.in | 12 ++++++++++++ - nvmf-autoconnect/systemd/nvmf-autoconnect.service.in | 12 ++++++++++++ - .../systemd/nvmf-connect-nbft.service.in | 12 ++++++++++++ - nvmf-autoconnect/systemd/nvmf-connect@.service.in | 12 ++++++++++++ - 4 files changed, 48 insertions(+) - -diff --git a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in -index 7036625c7..783feb067 100644 ---- a/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in -+++ b/nvmf-autoconnect/systemd/nvmefc-boot-connections.service.in -@@ -6,6 +6,18 @@ After=systemd-udevd.service - Before=local-fs-pre.target - - [Service] -+ProtectSystem=full -+ProtectHome=true -+ProtectHostname=true -+ProtectKernelModules=true -+ProtectKernelLogs=true -+ProtectControlGroups=true -+ProtectProc=invisible -+RestrictRealtime=true -+LockPersonality=yes -+MemoryDenyWriteExecute=yes -+RemoveIPC=yes -+RestrictAddressFamilies=none - Type=oneshot - ExecStart=/bin/sh -c "echo add > /sys/class/fc/fc_udev_device/nvme_discovery" - -diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in -index 92960cde6..1ac158846 100644 ---- a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in -+++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in -@@ -8,6 +8,18 @@ After=network-online.target - Before=remote-fs-pre.target - - [Service] -+ProtectSystem=full -+ProtectHome=true -+ProtectHostname=true -+ProtectKernelModules=true -+ProtectKernelLogs=true -+ProtectControlGroups=true -+ProtectProc=invisible -+RestrictRealtime=true -+LockPersonality=yes -+MemoryDenyWriteExecute=yes -+RemoveIPC=yes -+RestrictAddressFamilies=AF_INET AF_INET6 - Type=oneshot - ExecStart=@SBINDIR@/nvme connect-all --context=autoconnect - -diff --git a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in -index 820e6ced2..e3934fe70 100644 ---- a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in -+++ b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in -@@ -10,5 +10,17 @@ After=network-online.target - Before=remote-fs-pre.target - - [Service] -+ProtectSystem=full -+ProtectHome=true -+ProtectHostname=true -+ProtectKernelModules=true -+ProtectKernelLogs=true -+ProtectControlGroups=true -+ProtectProc=invisible -+RestrictRealtime=true -+LockPersonality=yes -+MemoryDenyWriteExecute=yes -+RemoveIPC=yes -+RestrictAddressFamilies=AF_INET AF_INET6 - Type=oneshot - ExecStart=@SBINDIR@/nvme connect-all --nbft -diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service.in b/nvmf-autoconnect/systemd/nvmf-connect@.service.in -index 5ba70863e..3cec3476f 100644 ---- a/nvmf-autoconnect/systemd/nvmf-connect@.service.in -+++ b/nvmf-autoconnect/systemd/nvmf-connect@.service.in -@@ -11,6 +11,18 @@ PartOf=nvmf-connect.target - Requires=nvmf-connect.target - - [Service] -+ProtectSystem=full -+ProtectHome=true -+ProtectHostname=true -+ProtectKernelModules=true -+ProtectKernelLogs=true -+ProtectControlGroups=true -+ProtectProc=invisible -+RestrictRealtime=true -+LockPersonality=yes -+MemoryDenyWriteExecute=yes -+RemoveIPC=yes -+RestrictAddressFamilies=AF_INET AF_INET6 - Type=simple - Environment="CONNECT_ARGS=%i" - ExecStart=/bin/sh -c "@SBINDIR@/nvme connect-all --context=autoconnect --quiet `/bin/echo -e '${CONNECT_ARGS}'`" diff --git a/nvme-cli.spec b/nvme-cli.spec index 8e15e7d..e60ea89 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,8 +2,8 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.8 -Release: 2%{?dist} +Version: 2.9.1 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -20,7 +20,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.8 +BuildRequires: libnvme-devel >= 1.9 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -28,8 +28,6 @@ BuildRequires: xmlto Requires: util-linux -# https://github.com/linux-nvme/nvme-cli/pull/2284 -Patch0: nvme-cli-2.9-systemd-hardening.patch %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -84,6 +82,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri May 03 2024 Tomas Bzatek - 2.9.1-1 +- Update to 2.9.1 + * Tue Apr 23 2024 Tomas Bzatek - 2.8-2 - Harden the systemd units diff --git a/sources b/sources index 5f3c195..117185f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.8.tar.gz) = 1be0bed4e1bf8a25229f301c2b00b78d2de4eaf8ff2b815fa75e44dd35ddd7787604152bdf00696130df3281206a734c5f408c3f2127440e05c2e4b1cdbb79d4 +SHA512 (nvme-cli-2.9.1.tar.gz) = c9c86e7567c2d4c59aff1eb9d18f4775923db3c81a89c628b819121c32150d4bc2d65d0dacac764c64594369890b380d0fd06bc7c1f83f4a7f3e71a51a6fee24 From acaa02a06facc5d439fd10208ac85170646d92b0 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 3 Jun 2024 15:53:37 +0200 Subject: [PATCH 38/52] * Mon Jun 03 2024 Tomas Bzatek - 2.9.1-2 - Install custom nvmf-connect-nbft.sh NetworkManager hook --- nvme-cli.spec | 9 ++++++++- nvmf-connect-nbft.sh | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nvmf-connect-nbft.sh diff --git a/nvme-cli.spec b/nvme-cli.spec index e60ea89..fe1f350 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,12 +3,13 @@ Name: nvme-cli Version: 2.9.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +Source1: nvmf-connect-nbft.sh BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ @@ -44,6 +45,8 @@ nvme-cli provides NVM-Express user space tooling for Linux. %install %meson_install %{__install} -pm 644 README.md %{buildroot}%{_pkgdocdir} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d +%{__install} -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -79,9 +82,13 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_udevrulesdir}/71-nvmf-netapp.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +%{_sysconfdir}/NetworkManager/dispatcher.d/nvmf-connect-nbft.sh %changelog +* Mon Jun 03 2024 Tomas Bzatek - 2.9.1-2 +- Install custom nvmf-connect-nbft.sh NetworkManager hook + * Fri May 03 2024 Tomas Bzatek - 2.9.1-1 - Update to 2.9.1 diff --git a/nvmf-connect-nbft.sh b/nvmf-connect-nbft.sh new file mode 100644 index 0000000..1dc0324 --- /dev/null +++ b/nvmf-connect-nbft.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [[ "$1" == nbft* ]] && [[ "$2" == "up" ]]; then + systemctl start nvmf-connect-nbft.service +fi From c8cd07d864ad6453501e4ee0b029d11f231b0904 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 19:53:24 +0000 Subject: [PATCH 39/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index fe1f350..403d7f1 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -3,7 +3,7 @@ Name: nvme-cli Version: 2.9.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -86,6 +86,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 2.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Mon Jun 03 2024 Tomas Bzatek - 2.9.1-2 - Install custom nvmf-connect-nbft.sh NetworkManager hook From c636547ae241dc5a4dc4e91bd1f2d2d91ef1e9f7 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 5 Aug 2024 14:26:55 +0200 Subject: [PATCH 40/52] * Mon Aug 05 2024 Tomas Bzatek - 2.10-1 - Update to 2.10 --- .gitignore | 1 + ...-rename_ocp-unsupported-req-log_file.patch | 31 +++++++++++++++++++ nvme-cli.spec | 11 +++++-- sources | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch diff --git a/.gitignore b/.gitignore index 79f773d..32c5bc5 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ /nvme-cli-2.7.1.tar.gz /nvme-cli-2.8.tar.gz /nvme-cli-2.9.1.tar.gz +/nvme-cli-2.10.tar.gz diff --git a/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch b/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch new file mode 100644 index 0000000..5eed9cb --- /dev/null +++ b/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch @@ -0,0 +1,31 @@ +From 03b14a27fb1e38a320600727fdef1fd244c0f9bc Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Fri, 2 Aug 2024 11:46:49 +0200 +Subject: [PATCH] docs: rename ocp-unsupported-req-log file + +The filename has to match the command name, thus rename the filename. + +Signed-off-by: Daniel Wagner +--- + Documentation/meson.build | 2 +- + ...ted-reqs-log-pages.txt => nvme-ocp-unsupported-reqs-log.txt} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + rename Documentation/{nvme-ocp-unsupported-reqs-log-pages.txt => nvme-ocp-unsupported-reqs-log.txt} (100%) + +diff --git a/Documentation/meson.build b/Documentation/meson.build +index 30c0efc418..1478134175 100644 +--- a/Documentation/meson.build ++++ b/Documentation/meson.build +@@ -103,7 +103,7 @@ adoc_sources = [ + 'nvme-ocp-set-telemetry-profile', + 'nvme-ocp-smart-add-log', + 'nvme-ocp-telemetry-string-log-page', +- 'nvme-ocp-unsupported-reqs-log-pages', ++ 'nvme-ocp-unsupported-reqs-log', + 'nvme-ocp-internal-log', + 'nvme-persistent-event-log', + 'nvme-pred-lat-event-agg-log', +diff --git a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt b/Documentation/nvme-ocp-unsupported-reqs-log.txt +similarity index 100% +rename from Documentation/nvme-ocp-unsupported-reqs-log-pages.txt +rename to Documentation/nvme-ocp-unsupported-reqs-log.txt diff --git a/nvme-cli.spec b/nvme-cli.spec index 403d7f1..92eb6e7 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,8 +2,8 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.9.1 -Release: 3%{?dist} +Version: 2.10 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -11,6 +11,8 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz Source1: nvmf-connect-nbft.sh +Patch0: nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch + BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -21,7 +23,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.9 +BuildRequires: libnvme-devel >= 1.10 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -86,6 +88,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Mon Aug 05 2024 Tomas Bzatek - 2.10-1 +- Update to 2.10 + * Thu Jul 18 2024 Fedora Release Engineering - 2.9.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index 117185f..b880676 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.9.1.tar.gz) = c9c86e7567c2d4c59aff1eb9d18f4775923db3c81a89c628b819121c32150d4bc2d65d0dacac764c64594369890b380d0fd06bc7c1f83f4a7f3e71a51a6fee24 +SHA512 (nvme-cli-2.10.tar.gz) = e1ce2e3d5990dce6794cc8e2e7a601895ff8474a4ba1c7c1722fab1986ae82bce8d41c18b2b553ffc55b1f3393d716e861acf92ba1262b1576d6e4bfb18ad9d0 From 75fb90a003f5650444352d263fc8533a899390d2 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 5 Aug 2024 15:50:05 +0200 Subject: [PATCH 41/52] * Mon Aug 05 2024 Tomas Bzatek - 2.10.2-1 - Update to 2.10.2 --- .gitignore | 1 + ...-rename_ocp-unsupported-req-log_file.patch | 31 ------------------- nvme-cli.spec | 7 +++-- sources | 2 +- 4 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch diff --git a/.gitignore b/.gitignore index 32c5bc5..5246427 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /nvme-cli-2.8.tar.gz /nvme-cli-2.9.1.tar.gz /nvme-cli-2.10.tar.gz +/nvme-cli-2.10.2.tar.gz diff --git a/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch b/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch deleted file mode 100644 index 5eed9cb..0000000 --- a/nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 03b14a27fb1e38a320600727fdef1fd244c0f9bc Mon Sep 17 00:00:00 2001 -From: Daniel Wagner -Date: Fri, 2 Aug 2024 11:46:49 +0200 -Subject: [PATCH] docs: rename ocp-unsupported-req-log file - -The filename has to match the command name, thus rename the filename. - -Signed-off-by: Daniel Wagner ---- - Documentation/meson.build | 2 +- - ...ted-reqs-log-pages.txt => nvme-ocp-unsupported-reqs-log.txt} | 0 - 2 files changed, 1 insertion(+), 1 deletion(-) - rename Documentation/{nvme-ocp-unsupported-reqs-log-pages.txt => nvme-ocp-unsupported-reqs-log.txt} (100%) - -diff --git a/Documentation/meson.build b/Documentation/meson.build -index 30c0efc418..1478134175 100644 ---- a/Documentation/meson.build -+++ b/Documentation/meson.build -@@ -103,7 +103,7 @@ adoc_sources = [ - 'nvme-ocp-set-telemetry-profile', - 'nvme-ocp-smart-add-log', - 'nvme-ocp-telemetry-string-log-page', -- 'nvme-ocp-unsupported-reqs-log-pages', -+ 'nvme-ocp-unsupported-reqs-log', - 'nvme-ocp-internal-log', - 'nvme-persistent-event-log', - 'nvme-pred-lat-event-agg-log', -diff --git a/Documentation/nvme-ocp-unsupported-reqs-log-pages.txt b/Documentation/nvme-ocp-unsupported-reqs-log.txt -similarity index 100% -rename from Documentation/nvme-ocp-unsupported-reqs-log-pages.txt -rename to Documentation/nvme-ocp-unsupported-reqs-log.txt diff --git a/nvme-cli.spec b/nvme-cli.spec index 92eb6e7..ab8f1a6 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -2,7 +2,7 @@ %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} Name: nvme-cli -Version: 2.10 +Version: 2.10.2 Release: 1%{?dist} Summary: NVMe management command line interface @@ -11,8 +11,6 @@ URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz Source1: nvmf-connect-nbft.sh -Patch0: nvme-cli-2.11-rename_ocp-unsupported-req-log_file.patch - BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -88,6 +86,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Mon Aug 05 2024 Tomas Bzatek - 2.10.2-1 +- Update to 2.10.2 + * Mon Aug 05 2024 Tomas Bzatek - 2.10-1 - Update to 2.10 diff --git a/sources b/sources index b880676..e394b84 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.10.tar.gz) = e1ce2e3d5990dce6794cc8e2e7a601895ff8474a4ba1c7c1722fab1986ae82bce8d41c18b2b553ffc55b1f3393d716e861acf92ba1262b1576d6e4bfb18ad9d0 +SHA512 (nvme-cli-2.10.2.tar.gz) = 98ecb2488cdf21c83004204f4cb7e7d9327fef5a33e5a37d977c659d76be3cef861473676fa7fbd1d40f38742b365b98431e17d9b0318ddb4cc407953acdde87 From c6b0b0ba590f6c49002ce106b1b9dc8146f47f2a Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 26 Aug 2024 15:49:38 +0200 Subject: [PATCH 42/52] * Mon Aug 26 2024 Tomas Bzatek - 2.10.2-2 - Install NetworkManager override for nbft interfaces - Rename reconnect NetworkManager hook to 99-nvme-nbft-connect.sh --- ...connect-nbft.sh => 99-nvme-nbft-connect.sh | 0 99-nvme-nbft-no-ignore-carrier.conf | 15 ++++++++++++++ nvme-cli.spec | 20 ++++++++++++++----- 3 files changed, 30 insertions(+), 5 deletions(-) rename nvmf-connect-nbft.sh => 99-nvme-nbft-connect.sh (100%) create mode 100644 99-nvme-nbft-no-ignore-carrier.conf diff --git a/nvmf-connect-nbft.sh b/99-nvme-nbft-connect.sh similarity index 100% rename from nvmf-connect-nbft.sh rename to 99-nvme-nbft-connect.sh diff --git a/99-nvme-nbft-no-ignore-carrier.conf b/99-nvme-nbft-no-ignore-carrier.conf new file mode 100644 index 0000000..4f19515 --- /dev/null +++ b/99-nvme-nbft-no-ignore-carrier.conf @@ -0,0 +1,15 @@ +# Boot from NVMe over TCP (NBFT) +# +# For NVMe/TCP connections that provide namespaces containing rootfs +# it is crucial to react on carrier events and reconnect any missing +# NVMe/TCP connections as defined in the ACPI NBFT table. A custom +# /usr/lib/NetworkManager/dispatcher.d/99-nvme-nbft-connect.sh hook +# will respawn nvmf-connect-nbft.service on such occasion. + +[device-nbft-no-ignore-carrier] + +# only affects nbft0, nbft1, ... interfaces +match-device=interface-name:nbft* + +# react on link up/down events +ignore-carrier=no diff --git a/nvme-cli.spec b/nvme-cli.spec index ab8f1a6..efc09a7 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,15 +1,18 @@ # RHEL 8 compatibility %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} +%global nmlibdir %{_prefix}/lib/NetworkManager + Name: nvme-cli Version: 2.10.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz -Source1: nvmf-connect-nbft.sh +Source1: 99-nvme-nbft-connect.sh +Source2: 99-nvme-nbft-no-ignore-carrier.conf BuildRequires: meson >= 0.50.0 BuildRequires: gcc gcc-c++ @@ -45,8 +48,10 @@ nvme-cli provides NVM-Express user space tooling for Linux. %install %meson_install %{__install} -pm 644 README.md %{buildroot}%{_pkgdocdir} -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d -%{__install} -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d +mkdir -p $RPM_BUILD_ROOT%{nmlibdir}/dispatcher.d +mkdir -p $RPM_BUILD_ROOT%{nmlibdir}/conf.d +%{__install} -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{nmlibdir}/dispatcher.d/ +%{__install} -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{nmlibdir}/conf.d/ # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -82,10 +87,15 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_udevrulesdir}/71-nvmf-netapp.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf -%{_sysconfdir}/NetworkManager/dispatcher.d/nvmf-connect-nbft.sh +%{nmlibdir}/dispatcher.d/99-nvme-nbft-connect.sh +%{nmlibdir}/conf.d/99-nvme-nbft-no-ignore-carrier.conf %changelog +* Mon Aug 26 2024 Tomas Bzatek - 2.10.2-2 +- Install NetworkManager override for nbft interfaces +- Rename reconnect NetworkManager hook to 99-nvme-nbft-connect.sh + * Mon Aug 05 2024 Tomas Bzatek - 2.10.2-1 - Update to 2.10.2 From babcc96ccdedadfa9b6af8c6b7b13250cea2437e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 31 Oct 2024 17:17:30 +0100 Subject: [PATCH 43/52] * Thu Oct 31 2024 Tomas Bzatek - 2.11-1 - Update to 2.11 --- .gitignore | 1 + nvme-cli.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5246427..bb36b97 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /nvme-cli-2.9.1.tar.gz /nvme-cli-2.10.tar.gz /nvme-cli-2.10.2.tar.gz +/nvme-cli-2.11.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index efc09a7..bb32427 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,8 +4,8 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.10.2 -Release: 2%{?dist} +Version: 2.11 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -24,7 +24,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.10 +BuildRequires: libnvme-devel >= 1.11 BuildRequires: json-c-devel >= 0.13 BuildRequires: asciidoc @@ -84,6 +84,7 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_unitdir}/nvmf-connect-nbft.service %{_udevrulesdir}/65-persistent-net-nbft.rules %{_udevrulesdir}/70-nvmf-autoconnect.rules +%{_udevrulesdir}/70-nvmf-keys.rules %{_udevrulesdir}/71-nvmf-netapp.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf @@ -92,6 +93,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Thu Oct 31 2024 Tomas Bzatek - 2.11-1 +- Update to 2.11 + * Mon Aug 26 2024 Tomas Bzatek - 2.10.2-2 - Install NetworkManager override for nbft interfaces - Rename reconnect NetworkManager hook to 99-nvme-nbft-connect.sh diff --git a/sources b/sources index e394b84..919e3b6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.10.2.tar.gz) = 98ecb2488cdf21c83004204f4cb7e7d9327fef5a33e5a37d977c659d76be3cef861473676fa7fbd1d40f38742b365b98431e17d9b0318ddb4cc407953acdde87 +SHA512 (nvme-cli-2.11.tar.gz) = 33de20ad990a3b87fef46fa486832edde41907223aa6b8a47606e605b360745fd7e2054226bf93a59b2a09c6bc04d0b684e4b3bb27c3fc0e6110c64a558cadc0 From 6e6c26f8a6cedf911b2528a3c038afb01183a52d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 20:32:54 +0000 Subject: [PATCH 44/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index bb32427..2642394 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -5,7 +5,7 @@ Name: nvme-cli Version: 2.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -93,6 +93,9 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 2.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Oct 31 2024 Tomas Bzatek - 2.11-1 - Update to 2.11 From 3dfbefd5541d4231150e50899b65278a38274463 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 4 Feb 2025 16:55:22 +0100 Subject: [PATCH 45/52] * Tue Feb 04 2025 Tomas Bzatek - 2.11-3 - Add systemd units scriptlets - Reload udevd after installing udev rules https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd --- nvme-cli.spec | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 2642394..d167232 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -5,7 +5,7 @@ Name: nvme-cli Version: 2.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -68,6 +68,30 @@ mv %{buildroot}%{_pkgdocdir}/nvme %{buildroot}%{_pkgdocdir}/html rm -rf %{buildroot}%{_pkgdocdir}/nvme +%post +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd +%systemd_post nvmefc-boot-connections.service +%systemd_post nvmf-autoconnect.service +%systemd_post nvmf-connect@.service +%systemd_post nvmf-connect-nbft.service +if [ -S /run/udev/control ]; then + udevadm control --reload + udevadm trigger +fi + +%preun +%systemd_preun nvmefc-boot-connections.service +%systemd_preun nvmf-autoconnect.service +%systemd_preun nvmf-connect@.service +%systemd_preun nvmf-connect-nbft.service + +%postun +%systemd_postun nvmefc-boot-connections.service +%systemd_postun nvmf-autoconnect.service +%systemd_postun nvmf-connect@.service +%systemd_postun nvmf-connect-nbft.service + + %files %license LICENSE %doc %{_pkgdocdir} @@ -93,6 +117,10 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %changelog +* Tue Feb 04 2025 Tomas Bzatek - 2.11-3 +- Add systemd units scriptlets +- Reload udevd after installing udev rules + * Fri Jan 17 2025 Fedora Release Engineering - 2.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 58dfd6f0b1b57154326f64c97dd836d981c3cf14 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 17 Mar 2025 15:55:39 +0100 Subject: [PATCH 46/52] * Mon Mar 17 2025 Tomas Bzatek - 2.12-1 - Update to 2.12 --- .gitignore | 1 + nvme-cli.spec | 13 ++++++++----- sources | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bb36b97..63fde27 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /nvme-cli-2.10.tar.gz /nvme-cli-2.10.2.tar.gz /nvme-cli-2.11.tar.gz +/nvme-cli-2.12.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index d167232..7e8460b 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,8 +4,8 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.11 -Release: 3%{?dist} +Version: 2.12 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -14,7 +14,7 @@ Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}. Source1: 99-nvme-nbft-connect.sh Source2: 99-nvme-nbft-no-ignore-carrier.conf -BuildRequires: meson >= 0.50.0 +BuildRequires: meson >= 0.53 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros @@ -24,8 +24,8 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.11 -BuildRequires: json-c-devel >= 0.13 +BuildRequires: libnvme-devel >= 1.12 +BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc BuildRequires: xmlto @@ -117,6 +117,9 @@ fi %changelog +* Mon Mar 17 2025 Tomas Bzatek - 2.12-1 +- Update to 2.12 + * Tue Feb 04 2025 Tomas Bzatek - 2.11-3 - Add systemd units scriptlets - Reload udevd after installing udev rules diff --git a/sources b/sources index 919e3b6..76e19d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.11.tar.gz) = 33de20ad990a3b87fef46fa486832edde41907223aa6b8a47606e605b360745fd7e2054226bf93a59b2a09c6bc04d0b684e4b3bb27c3fc0e6110c64a558cadc0 +SHA512 (nvme-cli-2.12.tar.gz) = 569a60302e4ce71713906417f34a8922b4788d77220a01f2f11dd12fc787ac6590c00588353cbbba292640688995fcefee4ab28c274bedcc02a2e3439c258938 From c0028af7fa1d7a674277285d6e96cac75538e010 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 11 Apr 2025 16:41:02 +0200 Subject: [PATCH 47/52] * Fri Apr 11 2025 Tomas Bzatek - 2.13-1 - Update to 2.13 --- .gitignore | 1 + nvme-cli.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 63fde27..2c55855 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /nvme-cli-2.10.2.tar.gz /nvme-cli-2.11.tar.gz /nvme-cli-2.12.tar.gz +/nvme-cli-2.13.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 7e8460b..3d50c14 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,7 +4,7 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.12 +Version: 2.13 Release: 1%{?dist} Summary: NVMe management command line interface @@ -24,7 +24,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.12 +BuildRequires: libnvme-devel >= 1.13 BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc @@ -117,6 +117,9 @@ fi %changelog +* Fri Apr 11 2025 Tomas Bzatek - 2.13-1 +- Update to 2.13 + * Mon Mar 17 2025 Tomas Bzatek - 2.12-1 - Update to 2.12 diff --git a/sources b/sources index 76e19d3..fbddce2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.12.tar.gz) = 569a60302e4ce71713906417f34a8922b4788d77220a01f2f11dd12fc787ac6590c00588353cbbba292640688995fcefee4ab28c274bedcc02a2e3439c258938 +SHA512 (nvme-cli-2.13.tar.gz) = 71ade7b97354bf70e4909d85265db157715c1afe52fba6d1e2aa614900a8059830e85029f71680884966476363e8846d6cfbc1dcfe57330c749775acc39df6e7 From e8eb04bafce9e39c023c0223753c0ef6ff9a7e6c Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 9 Jul 2025 14:35:50 +0200 Subject: [PATCH 48/52] * Wed Jul 09 2025 Tomas Bzatek - 2.14-1 - Update to 2.14 - Disable Persistent Discovery Controllers by default --- .gitignore | 1 + nvme-cli.spec | 11 ++++++++--- sources | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2c55855..5cab049 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /nvme-cli-2.11.tar.gz /nvme-cli-2.12.tar.gz /nvme-cli-2.13.tar.gz +/nvme-cli-2.14.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index 3d50c14..7edf192 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,7 +4,7 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.13 +Version: 2.14 Release: 1%{?dist} Summary: NVMe management command line interface @@ -24,7 +24,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.13 +BuildRequires: libnvme-devel >= 1.14 BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc @@ -41,7 +41,7 @@ nvme-cli provides NVM-Express user space tooling for Linux. %build -%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Dpdc-enabled=true -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} +%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Dpdc-enabled=false -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} %meson_build @@ -110,6 +110,7 @@ fi %{_udevrulesdir}/70-nvmf-autoconnect.rules %{_udevrulesdir}/70-nvmf-keys.rules %{_udevrulesdir}/71-nvmf-netapp.rules +%{_udevrulesdir}/71-nvmf-vastdata.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %{nmlibdir}/dispatcher.d/99-nvme-nbft-connect.sh @@ -117,6 +118,10 @@ fi %changelog +* Wed Jul 09 2025 Tomas Bzatek - 2.14-1 +- Update to 2.14 +- Disable Persistent Discovery Controllers by default + * Fri Apr 11 2025 Tomas Bzatek - 2.13-1 - Update to 2.13 diff --git a/sources b/sources index fbddce2..18a45bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.13.tar.gz) = 71ade7b97354bf70e4909d85265db157715c1afe52fba6d1e2aa614900a8059830e85029f71680884966476363e8846d6cfbc1dcfe57330c749775acc39df6e7 +SHA512 (nvme-cli-2.14.tar.gz) = 7f600ee719f06283e136427a0f9eb0b22412f7f4549c774768caff54150207ba87e2a431ea1569e5ed86a554aecd23c00c4e8c351aa0168a81807c86a0cb2edc From d8a5bb174c50195371f4f5963c789457755333a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 23:02:44 +0000 Subject: [PATCH 49/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- nvme-cli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvme-cli.spec b/nvme-cli.spec index 7edf192..bf058fe 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -5,7 +5,7 @@ Name: nvme-cli Version: 2.14 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -118,6 +118,9 @@ fi %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 2.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jul 09 2025 Tomas Bzatek - 2.14-1 - Update to 2.14 - Disable Persistent Discovery Controllers by default From e01b55c71f095345eed4588ab605f2273d1768c2 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 25 Jul 2025 23:22:16 +0200 Subject: [PATCH 50/52] * Fri Jul 25 2025 Tomas Bzatek - 2.15-1 - Update to 2.15 --- .gitignore | 1 + nvme-cli.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5cab049..3f61a44 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ /nvme-cli-2.12.tar.gz /nvme-cli-2.13.tar.gz /nvme-cli-2.14.tar.gz +/nvme-cli-2.15.tar.gz diff --git a/nvme-cli.spec b/nvme-cli.spec index bf058fe..d898953 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,8 +4,8 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.14 -Release: 2%{?dist} +Version: 2.15 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -24,7 +24,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.14 +BuildRequires: libnvme-devel >= 1.15 BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc @@ -111,6 +111,7 @@ fi %{_udevrulesdir}/70-nvmf-keys.rules %{_udevrulesdir}/71-nvmf-netapp.rules %{_udevrulesdir}/71-nvmf-vastdata.rules +%{_udevrulesdir}/71-nvme-hpe.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %{nmlibdir}/dispatcher.d/99-nvme-nbft-connect.sh @@ -118,6 +119,9 @@ fi %changelog +* Fri Jul 25 2025 Tomas Bzatek - 2.15-1 +- Update to 2.15 + * Thu Jul 24 2025 Fedora Release Engineering - 2.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index 18a45bc..9336ddd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.14.tar.gz) = 7f600ee719f06283e136427a0f9eb0b22412f7f4549c774768caff54150207ba87e2a431ea1569e5ed86a554aecd23c00c4e8c351aa0168a81807c86a0cb2edc +SHA512 (nvme-cli-2.15.tar.gz) = 6f4c9fe52883df5424ba28d8b66b00e61f4b6f7226d7385f026c1d3b8aeb473bdf637102d9cf7e049349c4f7e61eccbb33f7400cc09056f74be03a80b7d51c0d From 3618605a763d9397b8095fe86aaa35c39fd52023 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 15 Aug 2025 18:02:46 +0200 Subject: [PATCH 51/52] * Fri Aug 15 2025 Tomas Bzatek - 2.15-2 - Fix nvme-list JSON output compatibility - Rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules --- nvme-cli-2.16-nvme_list_JSON_regression.patch | 173 ++++++++++++++++++ nvme-cli-2.16-rename_71-nvme-hpe.rules.patch | 32 ++++ nvme-cli.spec | 13 +- 3 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 nvme-cli-2.16-nvme_list_JSON_regression.patch create mode 100644 nvme-cli-2.16-rename_71-nvme-hpe.rules.patch diff --git a/nvme-cli-2.16-nvme_list_JSON_regression.patch b/nvme-cli-2.16-nvme_list_JSON_regression.patch new file mode 100644 index 0000000..658fca8 --- /dev/null +++ b/nvme-cli-2.16-nvme_list_JSON_regression.patch @@ -0,0 +1,173 @@ +From 80ad62ba75f1f1dd5b99c6f56769141b48344485 Mon Sep 17 00:00:00 2001 +From: Nilay Shroff +Date: Tue, 5 Aug 2025 15:50:50 +0530 +Subject: [PATCH] nvme-list: make verbose JSON output backward compatible + +The commit 64bed0a87a23 ("nvme-list: fix verbose JSON output for 'nvme +list' command") changed the JSON output format of the nvme list --verbose +command. While the new format is more structured, it introduced a +regression by breaking compatibility with tools and scripts relying on +the previous JSON schema. + +So to restore backward compatibility, we now leverage the existing +--output-format-version option. With this patch, +1. The default --output-format-version=1 retains the original (legacy) JSON +format for nvme list --verbose. +2. If the user explicitly sets --output-format-version=2 then the newer +JSON structure introduced by commit 64bed0a87a23 ("nvme-list: fix verbose +JSON output for 'nvme list' command") is used. + +This ensures that existing users and automation relying on the older format +do not break, while still supporting the newer schema for forward-looking +users. + +Fixes: 64bed0a87a23 ("nvme-list: fix verbose JSON output for 'nvme list' command") +Signed-off-by: Nilay Shroff +Link: https://patch.msgid.link/20250805102055.3375272-1-nilay@linux.ibm.com +Signed-off-by: Daniel Wagner +--- + nvme-print-json.c | 117 ++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 113 insertions(+), 4 deletions(-) + +diff --git a/nvme-print-json.c b/nvme-print-json.c +index 11b6661624..829ba718e8 100644 +--- a/nvme-print-json.c ++++ b/nvme-print-json.c +@@ -4519,7 +4519,7 @@ static void json_print_detail_list(nvme_subsystem_t s, struct json_object *jss) + obj_add_obj(jss, "Controllers", jctrls); + } + +-static void json_detail_list(nvme_root_t t) ++static void json_detail_list_v2(nvme_root_t t) + { + struct json_object *r = json_create_object(); + struct json_object *jdev = json_create_array(); +@@ -4560,6 +4560,112 @@ static void json_detail_list(nvme_root_t t) + json_print(r); + } + ++static void json_detail_list(nvme_root_t t) ++{ ++ struct json_object *r = json_create_object(); ++ struct json_object *jdev = json_create_array(); ++ ++ nvme_host_t h; ++ nvme_subsystem_t s; ++ nvme_ctrl_t c; ++ nvme_path_t p; ++ nvme_ns_t n; ++ ++ nvme_for_each_host(t, h) { ++ struct json_object *hss = json_create_object(); ++ struct json_object *jsslist = json_create_array(); ++ const char *hostid; ++ ++ obj_add_str(hss, "HostNQN", nvme_host_get_hostnqn(h)); ++ hostid = nvme_host_get_hostid(h); ++ if (hostid) ++ obj_add_str(hss, "HostID", hostid); ++ ++ nvme_for_each_subsystem(h, s) { ++ struct json_object *jss = json_create_object(); ++ struct json_object *jctrls = json_create_array(); ++ struct json_object *jnss = json_create_array(); ++ ++ obj_add_str(jss, "Subsystem", nvme_subsystem_get_name(s)); ++ obj_add_str(jss, "SubsystemNQN", nvme_subsystem_get_nqn(s)); ++ ++ nvme_subsystem_for_each_ctrl(s, c) { ++ struct json_object *jctrl = json_create_object(); ++ struct json_object *jnss = json_create_array(); ++ struct json_object *jpaths = json_create_array(); ++ ++ obj_add_str(jctrl, "Controller", nvme_ctrl_get_name(c)); ++ obj_add_str(jctrl, "Cntlid", nvme_ctrl_get_cntlid(c)); ++ obj_add_str(jctrl, "SerialNumber", nvme_ctrl_get_serial(c)); ++ obj_add_str(jctrl, "ModelNumber", nvme_ctrl_get_model(c)); ++ obj_add_str(jctrl, "Firmware", nvme_ctrl_get_firmware(c)); ++ obj_add_str(jctrl, "Transport", nvme_ctrl_get_transport(c)); ++ obj_add_str(jctrl, "Address", nvme_ctrl_get_address(c)); ++ obj_add_str(jctrl, "Slot", nvme_ctrl_get_phy_slot(c)); ++ ++ nvme_ctrl_for_each_ns(c, n) { ++ struct json_object *jns = json_create_object(); ++ int lba = nvme_ns_get_lba_size(n); ++ uint64_t nsze = nvme_ns_get_lba_count(n) * lba; ++ uint64_t nuse = nvme_ns_get_lba_util(n) * lba; ++ ++ obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); ++ obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); ++ obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); ++ obj_add_uint64(jns, "UsedBytes", nuse); ++ obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); ++ obj_add_uint64(jns, "PhysicalSize", nsze); ++ obj_add_int(jns, "SectorSize", lba); ++ ++ array_add_obj(jnss, jns); ++ } ++ obj_add_obj(jctrl, "Namespaces", jnss); ++ ++ nvme_ctrl_for_each_path(c, p) { ++ struct json_object *jpath = json_create_object(); ++ ++ obj_add_str(jpath, "Path", nvme_path_get_name(p)); ++ obj_add_str(jpath, "ANAState", nvme_path_get_ana_state(p)); ++ ++ array_add_obj(jpaths, jpath); ++ } ++ obj_add_obj(jctrl, "Paths", jpaths); ++ ++ array_add_obj(jctrls, jctrl); ++ } ++ obj_add_obj(jss, "Controllers", jctrls); ++ ++ nvme_subsystem_for_each_ns(s, n) { ++ struct json_object *jns = json_create_object(); ++ ++ int lba = nvme_ns_get_lba_size(n); ++ uint64_t nsze = nvme_ns_get_lba_count(n) * lba; ++ uint64_t nuse = nvme_ns_get_lba_util(n) * lba; ++ ++ obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); ++ obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); ++ obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); ++ obj_add_uint64(jns, "UsedBytes", nuse); ++ obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); ++ obj_add_uint64(jns, "PhysicalSize", nsze); ++ obj_add_int(jns, "SectorSize", lba); ++ ++ array_add_obj(jnss, jns); ++ } ++ obj_add_obj(jss, "Namespaces", jnss); ++ ++ array_add_obj(jsslist, jss); ++ } ++ ++ obj_add_obj(hss, "Subsystems", jsslist); ++ array_add_obj(jdev, hss); ++ } ++ ++ obj_add_array(r, "Devices", jdev); ++ ++ json_print(r); ++} ++ + static struct json_object *json_list_item_obj(nvme_ns_t n) + { + struct json_object *r = json_create_object(); +@@ -4622,9 +4728,12 @@ static void json_list_item(nvme_ns_t n) + + static void json_print_list_items(nvme_root_t t) + { +- if (verbose_mode()) +- json_detail_list(t); +- else ++ if (json_print_ops.flags & VERBOSE) { ++ if (nvme_cfg.output_format_ver == 2) ++ json_detail_list_v2(t); ++ else ++ json_detail_list(t); ++ } else + json_simple_list(t); + } + diff --git a/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch b/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch new file mode 100644 index 0000000..7707737 --- /dev/null +++ b/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch @@ -0,0 +1,32 @@ +From 1141d617dfb3f50783fe80edd49728b8035a955f Mon Sep 17 00:00:00 2001 +From: Daniel Wagner +Date: Fri, 25 Jul 2025 13:30:19 +0200 +Subject: [PATCH] udev: rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules + +The rules file naming is inconsistent with the other rules. Use the +nvmf- prefix. + +Signed-off-by: Daniel Wagner +--- + meson.build | 2 +- + .../udev-rules/{71-nvme-hpe.rules.in => 71-nvmf-hpe.rules.in} | 0 + 2 files changed, 1 insertion(+), 1 deletion(-) + rename nvmf-autoconnect/udev-rules/{71-nvme-hpe.rules.in => 71-nvmf-hpe.rules.in} (100%) + +diff --git a/meson.build b/meson.build +index 1d57748605..3afd8ba3b1 100644 +--- a/meson.build ++++ b/meson.build +@@ -267,7 +267,7 @@ udev_files = [ + '65-persistent-net-nbft.rules', + '70-nvmf-autoconnect.rules', + '70-nvmf-keys.rules', +- '71-nvme-hpe.rules', ++ '71-nvmf-hpe.rules', + '71-nvmf-netapp.rules', + '71-nvmf-vastdata.rules', + ] +diff --git a/nvmf-autoconnect/udev-rules/71-nvme-hpe.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in +similarity index 100% +rename from nvmf-autoconnect/udev-rules/71-nvme-hpe.rules.in +rename to nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in diff --git a/nvme-cli.spec b/nvme-cli.spec index d898953..0e6abd1 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -5,7 +5,7 @@ Name: nvme-cli Version: 2.15 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -14,6 +14,11 @@ Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}. Source1: 99-nvme-nbft-connect.sh Source2: 99-nvme-nbft-no-ignore-carrier.conf +# https://github.com/linux-nvme/nvme-cli/issues/2886 +Patch0: nvme-cli-2.16-nvme_list_JSON_regression.patch +# https://github.com/linux-nvme/nvme-cli/pull/2880 +Patch1: nvme-cli-2.16-rename_71-nvme-hpe.rules.patch + BuildRequires: meson >= 0.53 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -111,7 +116,7 @@ fi %{_udevrulesdir}/70-nvmf-keys.rules %{_udevrulesdir}/71-nvmf-netapp.rules %{_udevrulesdir}/71-nvmf-vastdata.rules -%{_udevrulesdir}/71-nvme-hpe.rules +%{_udevrulesdir}/71-nvmf-hpe.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf %{nmlibdir}/dispatcher.d/99-nvme-nbft-connect.sh @@ -119,6 +124,10 @@ fi %changelog +* Fri Aug 15 2025 Tomas Bzatek - 2.15-2 +- Fix nvme-list JSON output compatibility +- Rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules + * Fri Jul 25 2025 Tomas Bzatek - 2.15-1 - Update to 2.15 From 6e6a6d49fc8384f2fc97addf9e66042cf799c5ec Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 4 Dec 2025 14:43:53 +0100 Subject: [PATCH 52/52] * Thu Dec 04 2025 Tomas Bzatek - 2.16-1 - Update to 2.16 --- .gitignore | 1 + nvme-cli-2.16-nvme_list_JSON_regression.patch | 173 ------------------ nvme-cli-2.16-rename_71-nvme-hpe.rules.patch | 32 ---- nvme-cli.spec | 14 +- sources | 2 +- 5 files changed, 8 insertions(+), 214 deletions(-) delete mode 100644 nvme-cli-2.16-nvme_list_JSON_regression.patch delete mode 100644 nvme-cli-2.16-rename_71-nvme-hpe.rules.patch diff --git a/.gitignore b/.gitignore index 3f61a44..1580e5b 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ /nvme-cli-2.13.tar.gz /nvme-cli-2.14.tar.gz /nvme-cli-2.15.tar.gz +/nvme-cli-2.16.tar.gz diff --git a/nvme-cli-2.16-nvme_list_JSON_regression.patch b/nvme-cli-2.16-nvme_list_JSON_regression.patch deleted file mode 100644 index 658fca8..0000000 --- a/nvme-cli-2.16-nvme_list_JSON_regression.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 80ad62ba75f1f1dd5b99c6f56769141b48344485 Mon Sep 17 00:00:00 2001 -From: Nilay Shroff -Date: Tue, 5 Aug 2025 15:50:50 +0530 -Subject: [PATCH] nvme-list: make verbose JSON output backward compatible - -The commit 64bed0a87a23 ("nvme-list: fix verbose JSON output for 'nvme -list' command") changed the JSON output format of the nvme list --verbose -command. While the new format is more structured, it introduced a -regression by breaking compatibility with tools and scripts relying on -the previous JSON schema. - -So to restore backward compatibility, we now leverage the existing ---output-format-version option. With this patch, -1. The default --output-format-version=1 retains the original (legacy) JSON -format for nvme list --verbose. -2. If the user explicitly sets --output-format-version=2 then the newer -JSON structure introduced by commit 64bed0a87a23 ("nvme-list: fix verbose -JSON output for 'nvme list' command") is used. - -This ensures that existing users and automation relying on the older format -do not break, while still supporting the newer schema for forward-looking -users. - -Fixes: 64bed0a87a23 ("nvme-list: fix verbose JSON output for 'nvme list' command") -Signed-off-by: Nilay Shroff -Link: https://patch.msgid.link/20250805102055.3375272-1-nilay@linux.ibm.com -Signed-off-by: Daniel Wagner ---- - nvme-print-json.c | 117 ++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 113 insertions(+), 4 deletions(-) - -diff --git a/nvme-print-json.c b/nvme-print-json.c -index 11b6661624..829ba718e8 100644 ---- a/nvme-print-json.c -+++ b/nvme-print-json.c -@@ -4519,7 +4519,7 @@ static void json_print_detail_list(nvme_subsystem_t s, struct json_object *jss) - obj_add_obj(jss, "Controllers", jctrls); - } - --static void json_detail_list(nvme_root_t t) -+static void json_detail_list_v2(nvme_root_t t) - { - struct json_object *r = json_create_object(); - struct json_object *jdev = json_create_array(); -@@ -4560,6 +4560,112 @@ static void json_detail_list(nvme_root_t t) - json_print(r); - } - -+static void json_detail_list(nvme_root_t t) -+{ -+ struct json_object *r = json_create_object(); -+ struct json_object *jdev = json_create_array(); -+ -+ nvme_host_t h; -+ nvme_subsystem_t s; -+ nvme_ctrl_t c; -+ nvme_path_t p; -+ nvme_ns_t n; -+ -+ nvme_for_each_host(t, h) { -+ struct json_object *hss = json_create_object(); -+ struct json_object *jsslist = json_create_array(); -+ const char *hostid; -+ -+ obj_add_str(hss, "HostNQN", nvme_host_get_hostnqn(h)); -+ hostid = nvme_host_get_hostid(h); -+ if (hostid) -+ obj_add_str(hss, "HostID", hostid); -+ -+ nvme_for_each_subsystem(h, s) { -+ struct json_object *jss = json_create_object(); -+ struct json_object *jctrls = json_create_array(); -+ struct json_object *jnss = json_create_array(); -+ -+ obj_add_str(jss, "Subsystem", nvme_subsystem_get_name(s)); -+ obj_add_str(jss, "SubsystemNQN", nvme_subsystem_get_nqn(s)); -+ -+ nvme_subsystem_for_each_ctrl(s, c) { -+ struct json_object *jctrl = json_create_object(); -+ struct json_object *jnss = json_create_array(); -+ struct json_object *jpaths = json_create_array(); -+ -+ obj_add_str(jctrl, "Controller", nvme_ctrl_get_name(c)); -+ obj_add_str(jctrl, "Cntlid", nvme_ctrl_get_cntlid(c)); -+ obj_add_str(jctrl, "SerialNumber", nvme_ctrl_get_serial(c)); -+ obj_add_str(jctrl, "ModelNumber", nvme_ctrl_get_model(c)); -+ obj_add_str(jctrl, "Firmware", nvme_ctrl_get_firmware(c)); -+ obj_add_str(jctrl, "Transport", nvme_ctrl_get_transport(c)); -+ obj_add_str(jctrl, "Address", nvme_ctrl_get_address(c)); -+ obj_add_str(jctrl, "Slot", nvme_ctrl_get_phy_slot(c)); -+ -+ nvme_ctrl_for_each_ns(c, n) { -+ struct json_object *jns = json_create_object(); -+ int lba = nvme_ns_get_lba_size(n); -+ uint64_t nsze = nvme_ns_get_lba_count(n) * lba; -+ uint64_t nuse = nvme_ns_get_lba_util(n) * lba; -+ -+ obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); -+ obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); -+ obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); -+ obj_add_uint64(jns, "UsedBytes", nuse); -+ obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); -+ obj_add_uint64(jns, "PhysicalSize", nsze); -+ obj_add_int(jns, "SectorSize", lba); -+ -+ array_add_obj(jnss, jns); -+ } -+ obj_add_obj(jctrl, "Namespaces", jnss); -+ -+ nvme_ctrl_for_each_path(c, p) { -+ struct json_object *jpath = json_create_object(); -+ -+ obj_add_str(jpath, "Path", nvme_path_get_name(p)); -+ obj_add_str(jpath, "ANAState", nvme_path_get_ana_state(p)); -+ -+ array_add_obj(jpaths, jpath); -+ } -+ obj_add_obj(jctrl, "Paths", jpaths); -+ -+ array_add_obj(jctrls, jctrl); -+ } -+ obj_add_obj(jss, "Controllers", jctrls); -+ -+ nvme_subsystem_for_each_ns(s, n) { -+ struct json_object *jns = json_create_object(); -+ -+ int lba = nvme_ns_get_lba_size(n); -+ uint64_t nsze = nvme_ns_get_lba_count(n) * lba; -+ uint64_t nuse = nvme_ns_get_lba_util(n) * lba; -+ -+ obj_add_str(jns, "NameSpace", nvme_ns_get_name(n)); -+ obj_add_str(jns, "Generic", nvme_ns_get_generic_name(n)); -+ obj_add_int(jns, "NSID", nvme_ns_get_nsid(n)); -+ obj_add_uint64(jns, "UsedBytes", nuse); -+ obj_add_uint64(jns, "MaximumLBA", nvme_ns_get_lba_count(n)); -+ obj_add_uint64(jns, "PhysicalSize", nsze); -+ obj_add_int(jns, "SectorSize", lba); -+ -+ array_add_obj(jnss, jns); -+ } -+ obj_add_obj(jss, "Namespaces", jnss); -+ -+ array_add_obj(jsslist, jss); -+ } -+ -+ obj_add_obj(hss, "Subsystems", jsslist); -+ array_add_obj(jdev, hss); -+ } -+ -+ obj_add_array(r, "Devices", jdev); -+ -+ json_print(r); -+} -+ - static struct json_object *json_list_item_obj(nvme_ns_t n) - { - struct json_object *r = json_create_object(); -@@ -4622,9 +4728,12 @@ static void json_list_item(nvme_ns_t n) - - static void json_print_list_items(nvme_root_t t) - { -- if (verbose_mode()) -- json_detail_list(t); -- else -+ if (json_print_ops.flags & VERBOSE) { -+ if (nvme_cfg.output_format_ver == 2) -+ json_detail_list_v2(t); -+ else -+ json_detail_list(t); -+ } else - json_simple_list(t); - } - diff --git a/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch b/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch deleted file mode 100644 index 7707737..0000000 --- a/nvme-cli-2.16-rename_71-nvme-hpe.rules.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1141d617dfb3f50783fe80edd49728b8035a955f Mon Sep 17 00:00:00 2001 -From: Daniel Wagner -Date: Fri, 25 Jul 2025 13:30:19 +0200 -Subject: [PATCH] udev: rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules - -The rules file naming is inconsistent with the other rules. Use the -nvmf- prefix. - -Signed-off-by: Daniel Wagner ---- - meson.build | 2 +- - .../udev-rules/{71-nvme-hpe.rules.in => 71-nvmf-hpe.rules.in} | 0 - 2 files changed, 1 insertion(+), 1 deletion(-) - rename nvmf-autoconnect/udev-rules/{71-nvme-hpe.rules.in => 71-nvmf-hpe.rules.in} (100%) - -diff --git a/meson.build b/meson.build -index 1d57748605..3afd8ba3b1 100644 ---- a/meson.build -+++ b/meson.build -@@ -267,7 +267,7 @@ udev_files = [ - '65-persistent-net-nbft.rules', - '70-nvmf-autoconnect.rules', - '70-nvmf-keys.rules', -- '71-nvme-hpe.rules', -+ '71-nvmf-hpe.rules', - '71-nvmf-netapp.rules', - '71-nvmf-vastdata.rules', - ] -diff --git a/nvmf-autoconnect/udev-rules/71-nvme-hpe.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in -similarity index 100% -rename from nvmf-autoconnect/udev-rules/71-nvme-hpe.rules.in -rename to nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in diff --git a/nvme-cli.spec b/nvme-cli.spec index 0e6abd1..5fa7a3a 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -4,8 +4,8 @@ %global nmlibdir %{_prefix}/lib/NetworkManager Name: nvme-cli -Version: 2.15 -Release: 2%{?dist} +Version: 2.16 +Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only @@ -14,11 +14,6 @@ Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}. Source1: 99-nvme-nbft-connect.sh Source2: 99-nvme-nbft-no-ignore-carrier.conf -# https://github.com/linux-nvme/nvme-cli/issues/2886 -Patch0: nvme-cli-2.16-nvme_list_JSON_regression.patch -# https://github.com/linux-nvme/nvme-cli/pull/2880 -Patch1: nvme-cli-2.16-rename_71-nvme-hpe.rules.patch - BuildRequires: meson >= 0.53 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel @@ -29,7 +24,7 @@ BuildRequires: openssl-devel BuildRequires: kernel-headers %endif -BuildRequires: libnvme-devel >= 1.15 +BuildRequires: libnvme-devel >= 1.16.1 BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc @@ -124,6 +119,9 @@ fi %changelog +* Thu Dec 04 2025 Tomas Bzatek - 2.16-1 +- Update to 2.16 + * Fri Aug 15 2025 Tomas Bzatek - 2.15-2 - Fix nvme-list JSON output compatibility - Rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules diff --git a/sources b/sources index 9336ddd..e58ea56 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.15.tar.gz) = 6f4c9fe52883df5424ba28d8b66b00e61f4b6f7226d7385f026c1d3b8aeb473bdf637102d9cf7e049349c4f7e61eccbb33f7400cc09056f74be03a80b7d51c0d +SHA512 (nvme-cli-2.16.tar.gz) = 507018ff41832574bef5b88ea6a17336b9792c54f8e5c619d041bce23124e1d6d5e5e824407f46d4f1b4d6899125885eb14289f3399e61c7e7a59a603f1635e2