From 5527c15b1d7b89f359237f1e401fb204b6fa9257 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 14 Aug 2023 17:47:53 +0200 Subject: [PATCH 01/28] * 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 9814f5822c50b1de675ba865339f7e851ddbc041 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 14 Aug 2023 17:47:53 +0200 Subject: [PATCH 02/28] * 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 acf0b6463007c2916509e61e8ed23a84e674edf0 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 17 Aug 2023 17:31:51 +0200 Subject: [PATCH 03/28] * 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 75620ef422c534b51d3542e81a07e9e0d12ffe33 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 17 Aug 2023 17:31:51 +0200 Subject: [PATCH 04/28] * 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 0014bceadd0ac316a0aa02568b50c66bbd2c0c2b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 29 Sep 2023 15:49:48 +0200 Subject: [PATCH 05/28] * 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 1f94235a8ff2acd2a8a80376fdafd0d66e17404e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 29 Sep 2023 15:49:48 +0200 Subject: [PATCH 06/28] * 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 07/28] * 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 08/28] 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 09/28] 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 10/28] * 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 11/28] * 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 12/28] * 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 13/28] * 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 14/28] * 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 15/28] 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 16/28] * 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 17/28] * 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 18/28] * 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 19/28] * 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 20/28] 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 21/28] * 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 22/28] * 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 23/28] * 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 24/28] * 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 25/28] 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 26/28] * 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 27/28] * 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 28/28] * 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