import nvme-cli-1.12-2.el8

This commit is contained in:
CentOS Sources 2020-07-14 01:42:46 +00:00 committed by Andrew Lukoshko
parent fc687b5ead
commit d2f6e599f9
6 changed files with 13 additions and 213 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/v1.10.1.tar.gz
SOURCES/v1.12.tar.gz

View File

@ -1 +1 @@
b312f3385742cc8a171379dd10b3397b45462eca SOURCES/v1.10.1.tar.gz
ec24fdc3944cff338170f8a98e95e9ebe90463f2 SOURCES/v1.12.tar.gz

View File

@ -1,128 +0,0 @@
commit 4bad11866a349b7ae5d10869474f7c0fee740845
Author: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Date: Wed Jan 8 12:24:41 2020 -0800
Add additional smart log critical warn decoding
Provide a user option to request additional smart log page decoding,
and print out detailed critical warning when requested.
Signed-off-by: Wendy Xiong<wenxiong@linux.vnet.ibm.com>
[merge up, rename json keys]
Signed-off-by: Keith Busch <kbusch@kernel.org>
diff --git a/nvme-print.c b/nvme-print.c
index 2ba1de1..46d5228 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -585,10 +585,11 @@ static void json_endurance_log(struct nvme_endurance_group_log *endurance_group,
json_free_object(root);
}
-static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid)
+static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid,
+ enum nvme_print_flags flags)
{
+ int c, human = flags & VERBOSE;
struct json_object *root;
- int c;
char key[21];
unsigned int temperature = ((smart->temperature[1] << 8) |
@@ -607,8 +608,22 @@ static void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid)
root = json_create_object();
- json_object_add_value_int(root, "critical_warning",
- smart->critical_warning);
+ if (human) {
+ struct json_object *crt = json_create_object();
+
+ json_object_add_value_int(crt, "value", smart->critical_warning);
+ json_object_add_value_int(crt, "available_spare", smart->critical_warning & 0x01);
+ json_object_add_value_int(crt, "temp_threshold", (smart->critical_warning & 0x02) >> 1);
+ json_object_add_value_int(crt, "reliability_degraded", (smart->critical_warning & 0x04) >> 2);
+ json_object_add_value_int(crt, "ro", (smart->critical_warning & 0x08) >> 3);
+ json_object_add_value_int(crt, "vmbu_failed", (smart->critical_warning & 0x10) >> 4);
+ json_object_add_value_int(crt, "pmr_ro", (smart->critical_warning & 0x20) >> 5);
+
+ json_object_add_value_object(root, "critical_warning", crt);
+ } else
+ json_object_add_value_int(root, "critical_warning",
+ smart->critical_warning);
+
json_object_add_value_int(root, "temperature", temperature);
json_object_add_value_int(root, "avail_spare", smart->avail_spare);
json_object_add_value_int(root, "spare_thresh", smart->spare_thresh);
@@ -3400,16 +3415,26 @@ void nvme_show_smart_log(struct nvme_smart_log *smart, unsigned int nsid,
/* convert temperature from Kelvin to Celsius */
int temperature = ((smart->temperature[1] << 8) |
smart->temperature[0]) - 273;
- int i;
+ int i, human = flags & VERBOSE;
if (flags & BINARY)
return d_raw((unsigned char *)smart, sizeof(*smart));
else if (flags & JSON)
- return json_smart_log(smart, nsid);
+ return json_smart_log(smart, nsid, flags);
printf("Smart Log for NVME device:%s namespace-id:%x\n", devname, nsid);
printf("critical_warning : %#x\n",
smart->critical_warning);
+
+ if (human) {
+ printf(" Available Spare[0] : %d\n", smart->critical_warning & 0x01);
+ printf(" Temp. Threshold[1] : %d\n", (smart->critical_warning & 0x02) >> 1);
+ printf(" NVM subsystem Reliability[2] : %d\n", (smart->critical_warning & 0x04) >> 2);
+ printf(" Read-only[3] : %d\n", (smart->critical_warning & 0x08) >> 3);
+ printf(" Volatile mem. backup failed[4] : %d\n", (smart->critical_warning & 0x10) >> 4);
+ printf(" Persistent Mem. RO[5] : %d\n", (smart->critical_warning & 0x20) >> 5);
+ }
+
printf("temperature : %d C\n",
temperature);
printf("available_spare : %u%%\n",
diff --git a/nvme.c b/nvme.c
index 3b386bc..dd3ab58 100644
--- a/nvme.c
+++ b/nvme.c
@@ -218,6 +218,7 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug
"(default) or binary.";
const char *namespace = "(optional) desired namespace";
const char *raw = "output in binary format";
+ const char *human_readable = "show info in readable format";
enum nvme_print_flags flags;
int err, fd;
@@ -225,6 +226,7 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug
__u32 namespace_id;
int raw_binary;
char *output_format;
+ int human_readable;
};
struct config cfg = {
@@ -234,9 +236,10 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug
OPT_ARGS(opts) = {
- OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
- OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
- OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
+ OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
+ OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
+ OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
+ OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable),
OPT_END()
};
@@ -249,6 +252,8 @@ static int get_smart_log(int argc, char **argv, struct command *cmd, struct plug
goto close_fd;
if (cfg.raw_binary)
flags = BINARY;
+ if (cfg.human_readable)
+ flags |= VERBOSE;
err = nvme_smart_log(fd, cfg.namespace_id, &smart_log);
if (!err)

View File

@ -1,16 +0,0 @@
commit 27cc5431f4aabdc8fea8b371c18b3ec1f6b9235b
Author: Yi Zhang <yi.zhang@redhat.com>
Date: Thu Jan 16 15:56:58 2020 +0800
nvme-cli: memblaze: change to 100644 mode for memblaze-nvme.c
Bellow WARNING observed with rpmbuild -bb rpmbuild/SPECS/nvme-cli.spec
*** WARNING: plugins/memblaze/memblaze-nvme.c is executable but has
empty or no shebang, removing executable bit
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
diff --git a/plugins/memblaze/memblaze-nvme.c b/plugins/memblaze/memblaze-nvme.c
old mode 100755
new mode 100644

View File

@ -1,58 +0,0 @@
commit 01e6062e7be71b7dec29ecd8de09eb411ddd78f1
Author: Yi Zhang <yi.zhang@redhat.com>
Date: Fri May 1 15:42:10 2020 +0800
nvme-print: nvme list -o json fix
Bellow error log will be triggered on non pcie transport, so only print the
ProductName for pcie transport, also add print "\n" and json_free_object fix
Failed to open /sys/class/nvme/nvme1/device/subsystem_vendor with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/subsystem_device with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/vendor with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/device with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/class with errno No such file or directory
{
"Devices" : [
{
"NameSpace" : 1,
"DevicePath" : "/dev/nvme1n1",
"Firmware" : "4.18.0-1",
"Index" : 1,
"ModelNumber" : "Linux",
"ProductName" : "NULL",
"SerialNumber" : "eb4695bf0da275a3",
"UsedBytes" : 268435456000,
"MaximumLBA" : 524288000,
"PhysicalSize" : 268435456000,
"SectorSize" : 512
}
]
}
Reported-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
diff --git a/nvme-print.c b/nvme-print.c
index 42e27a3..7414280 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -4629,7 +4629,7 @@ static void json_simple_ns(struct nvme_namespace *n, struct json_array *devices)
json_object_add_value_string(device_attrs, "ModelNumber", formatter);
- if (index >= 0) {
+ if (index >= 0 && !strcmp(n->ctrl->transport, "pcie")) {
char *product = nvme_product_name(index);
json_object_add_value_string(device_attrs, "ProductName", product);
@@ -4682,6 +4682,8 @@ static void json_simple_list(struct nvme_topology *t)
}
json_object_add_value_array(root, "Devices", devices);
json_print_object(root, NULL);
+ printf("\n");
+ json_free_object(root);
}
static void json_print_list_items(struct nvme_topology *t,

View File

@ -2,7 +2,7 @@
#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7})
Name: nvme-cli
Version: 1.10.1
Version: 1.12
Release: 2%{?dist}
Summary: NVMe management command line interface
@ -11,10 +11,7 @@ URL: https://github.com/linux-nvme/nvme-cli
#Source0: https://github.com/linux-nvme/%%{name}/archive/%%{commit0}.tar.gz
Source0: https://github.com/linux-nvme/%{name}/archive/v%{version}.tar.gz
Patch0: nvme-cli-memblaze-change-mode-patch
Patch1: nvme-cli-add-addl-smart-log-crit-warn-decoding-patch
Patch2: nvme-cli-makefile-dont-install-host-params-patch
Patch3: nvme-print-nvme-list-json-fix-patch
Patch0: nvme-cli-makefile-dont-install-host-params-patch
BuildRequires: libuuid-devel
BuildRequires: gcc
@ -27,9 +24,7 @@ nvme-cli provides NVM-Express user space tooling for Linux.
#%%setup -qn %%{name}-%%{commit0}
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
@ -61,6 +56,7 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf
%{_datadir}/zsh/site-functions/_nvme
%dir %{_sysconfdir}/nvme
%{_unitdir}/nvmefc-boot-connections.service
%{_unitdir}/nvmf-autoconnect.service
%{_unitdir}/nvmf-connect.target
%{_unitdir}/nvmf-connect@.service
%{_udevrulesdir}/70-nvmf-autoconnect.rules
@ -68,7 +64,6 @@ rm -f %{buildroot}/usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf
# Do not install the dracut rule yet. See rhbz 1742764
# /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf
%post
if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then
if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
@ -83,7 +78,14 @@ if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then
systemctl daemon-reload
udevadm control --reload-rules && udevadm trigger
fi
%changelog
* Tue Jun 16 2020 Fedora Release Monitoring <release-monitoring@fedoraproject.org> - 1.12-1
- Update to 1.12 (#1827581)
* Sat Apr 25 2020 luto@kernel.org - 1.11.1-1
- Update to 1.11
* Thu Mar 19 2020 luto@kernel.org - 1.10.1-1
- Update to 1.10.1