nvme-cli: update to version 2.4

Resolves: #2159929

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
This commit is contained in:
Maurizio Lombardi 2023-04-03 18:05:10 +02:00
parent 2dafb822d9
commit d641ac5d48
4 changed files with 10 additions and 54 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@
/nvme-cli-2.0.tar.gz
/nvme-cli-2.1.2.tar.gz
/nvme-cli-2.2.1.tar.gz
/nvme-cli-2.4.tar.gz

View File

@ -1,49 +0,0 @@
From cc07ea605d1e89eea98ace6b16e8fd3305a6ee6d Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 13 Sep 2022 16:54:44 +0200
Subject: [PATCH] nvme-print: Handle NULL hostid in JSON output
For pcie devices there might be no hostid available, in case the
/etc/nvme/hostid file doesn't exist.
---
nvme-print.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/nvme-print.c b/nvme-print.c
index 24ebfe54..cf61e14f 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -2483,12 +2483,14 @@ static void json_print_nvme_subsystem_list(nvme_root_t r, bool show_ana)
nvme_for_each_host(r, h) {
nvme_subsystem_t s;
+ const char *hostid;
host_attrs = json_create_object();
json_object_add_value_string(host_attrs, "HostNQN",
nvme_host_get_hostnqn(h));
- json_object_add_value_string(host_attrs, "HostID",
- nvme_host_get_hostid(h));
+ hostid = nvme_host_get_hostid(h);
+ if (hostid)
+ json_object_add_value_string(host_attrs, "HostID", hostid);
subsystems = json_create_array();
nvme_for_each_subsystem(h, s) {
subsystem_attrs = json_create_object();
@@ -7359,9 +7361,12 @@ static void json_detail_list(nvme_root_t r)
nvme_for_each_host(r, h) {
struct json_object *hss = json_create_object();
struct json_object *jsslist = json_create_array();
+ const char *hostid;
json_object_add_value_string(hss, "HostNQN", nvme_host_get_hostnqn(h));
- json_object_add_value_string(hss, "HostID", nvme_host_get_hostid(h));
+ hostid = nvme_host_get_hostid(h);
+ if (hostid)
+ json_object_add_value_string(hss, "HostID", hostid);
nvme_for_each_subsystem(h , s) {
struct json_object *jss = json_create_object();
--
2.31.1

View File

@ -2,21 +2,21 @@
#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7})
Name: nvme-cli
Version: 2.2.1
Release: 2%{?dist}
Version: 2.4
Release: 1%{?dist}
Summary: NVMe management command line interface
License: GPLv2+
URL: https://github.com/linux-nvme/nvme-cli
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: meson >= 0.48.0
BuildRequires: meson >= 0.50.0
BuildRequires: gcc gcc-c++
BuildRequires: libuuid-devel
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
BuildRequires: libnvme-devel >= 1.2
BuildRequires: libnvme-devel >= 1.4
BuildRequires: json-c-devel >= 0.14
BuildRequires: asciidoc
BuildRequires: xmlto
@ -87,6 +87,10 @@ if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then
fi
%changelog
* Mon Apr 03 2023 Maurizio Lombardi <mlombard@redhat.com> - 2.4-1
- Update to version v2.4
* Thu Nov 10 2022 Maurizio Lombardi <mlombard@redhat.com> - 2.1.2-2
- Do not re-enable nvmefc-boot-connections when the package gets updated

View File

@ -1 +1 @@
SHA512 (nvme-cli-2.2.1.tar.gz) = 8efa94d49a4d443cdb0310386733e88117f17719b05044f11e63e2a09143fce55918171b457a467371263ebb2e36552558aad249ae4dbd27941af79fe9722e26
SHA512 (nvme-cli-2.4.tar.gz) = 155667a0b91e15267e3f991a30cf1d4ae26cb4c53b20c002e3d3341496dd463397e1afbfefcd7a8df88370d28417940ce44a060bda87c04482bbe3be4e901b73