summaryrefslogtreecommitdiffstats
path: root/plugins/ymtc/ymtc-nvme.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 18:28:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-16 15:12:07 +0000
commit589986012c4b3ab68e299a2eadca18f90080113b (patch)
treef29a53b04a1950cdddae69344bccb3f0146fa728 /plugins/ymtc/ymtc-nvme.c
parentReleasing debian version 1.16-4. (diff)
downloadnvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.tar.xz
nvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.zip
Merging upstream version 2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/ymtc/ymtc-nvme.c')
-rw-r--r--plugins/ymtc/ymtc-nvme.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/ymtc/ymtc-nvme.c b/plugins/ymtc/ymtc-nvme.c
index 91e52be..dd5f004 100644
--- a/plugins/ymtc/ymtc-nvme.c
+++ b/plugins/ymtc/ymtc-nvme.c
@@ -4,15 +4,11 @@
#include <stdlib.h>
#include <unistd.h>
-#include "linux/nvme_ioctl.h"
-
#include "nvme.h"
-#include "nvme-print.h"
-#include "nvme-ioctl.h"
+#include "libnvme.h"
#include "plugin.h"
-
-#include "argconfig.h"
-#include "suffix.h"
+#include "linux/types.h"
+#include "nvme-print.h"
#define CREATE_CMD
#include "ymtc-nvme.h"
@@ -116,7 +112,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
const char *raw = "dump output in binary format";
struct config {
__u32 namespace_id;
- int raw_binary;
+ bool raw_binary;
};
struct config cfg = {
@@ -133,8 +129,8 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
if (fd < 0)
return fd;
- err = nvme_get_log(fd, cfg.namespace_id, 0xca, false,
- NVME_NO_LOG_LSP, sizeof(smart_log), &smart_log);
+ err = nvme_get_nsid_log(fd, false, 0xca, cfg.namespace_id,
+ sizeof(smart_log), &smart_log);
if (!err) {
if (!cfg.raw_binary)
err = show_ymtc_smart_log(fd, cfg.namespace_id, devicename, &smart_log);
@@ -142,7 +138,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
d_raw((unsigned char *)&smart_log, sizeof(smart_log));
}
if (err > 0)
- fprintf(stderr, "NVMe Status:%s(%x)\n", nvme_status_to_string(err), err);
+ nvme_show_status(err);
return err;
}