Bug Summary

File:.build-ci/../src/nvme-cmds-io.c
Warning:line 1204, column 11
Potential leak of memory pointed to by 'mbuffer'

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -O3 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name nvme-cmds-io.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/__w/nvme-cli/nvme-cli/.build-ci -fcoverage-compilation-dir=/__w/nvme-cli/nvme-cli/.build-ci -resource-dir /usr/bin/../lib/clang/22 -include /__w/nvme-cli/nvme-cli/.build-ci/nvme-config.h -I nvme.p -I . -I .. -I src -I ../src -I ccan -I ../ccan -I libnvme/src -I ../libnvme/src -I /usr/include/json-c -D _FILE_OFFSET_BITS=64 -D _GNU_SOURCE -U NDEBUG -internal-isystem /usr/bin/../lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/16/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=gnu11 -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -analyzer-opt-analyze-headers -analyzer-output=html -faddrsig -fdwarf2-cfi-asm -o /__w/nvme-cli/nvme-cli/.build-ci/scan-results/2026-09-23-073103-589-1 -x c ../src/nvme-cmds-io.c
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * NVM-Express command line utility.
4 *
5 * Copyright (c) 2014-2015, Intel Corporation.
6 *
7 * Written by Keith Busch <kbusch@kernel.org>
8 */
9
10/**
11 * This program uses NVMe IOCTLs to run native nvme commands to a device.
12 */
13#include <dirent.h>
14#include <errno(*__errno_location ()).h>
15#include <fcntl.h>
16#include <getopt.h>
17#include <inttypes.h>
18#include <libgen.h>
19#include <locale.h>
20#include <math.h>
21#include <signal.h>
22#include <stdint.h>
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26#include <unistd.h>
27
28#ifdef NVME_HAVE_MMAP
29#include <sys/mman.h>
30#endif
31#include <sys/stat.h>
32#include <sys/types.h>
33
34#include <libnvme-mi.h>
35#include <libnvme.h>
36
37#include <ccan/array_size/array_size.h>
38#include <ccan/endian/endian.h>
39#include <ccan/minmax/minmax.h>
40#include <shared/compiler-attributes-util.h>
41#include <shared/fs-util.h>
42#include <shared/mmio-util.h>
43#include <shared/parse-util.h>
44#include <shared/sig-util.h>
45#include <shared/suffix-util.h>
46#include <shared/time-util.h>
47
48#include "argconfig.h"
49#include "cleanup.h"
50#include "global-ctx.h"
51#include "nvme-errno.h"
52#include "nvme-print.h"
53#include "plugin.h"
54
55static const char *app_tag = "app tag for end-to-end PI";
56static const char *app_tag_mask = "app tag mask for end-to-end PI";
57static const char *block_count = "number of blocks (zeroes based) on device to access";
58static const char *dspec_w_dtype = "directive specification associated with directive type";
59static const char *dtype = "directive type";
60static const char *force_unit_access = "force device to commit data before command completes";
61static const char *latency = "output latency statistics";
62static const char *limited_retry = "limit media access attempts";
63static const char *namespace_desired = "desired namespace";
64static const char *prinfo = "PI and check field";
65static const char *ref_tag = "reference tag for end-to-end PI";
66static const char *start_block = "64-bit LBA of first block to access";
67static const char *storage_tag = "storage tag for end-to-end PI";
68static const char *storage_tag_check = "This bit specifies if the Storage Tag field shall be checked as\n"
69 "part of end-to-end data protection processing";
70static const char *ish = "Ignore Shutdown (for NVMe-MI command)";
71
72static int open_fallback_chardev(struct libnvme_global_ctx *ctx,
73 __u32 nsid,
74 struct libnvme_transport_handle **phdl)
75{
76 struct libnvme_transport_handle *hdl = *phdl;
77 int err;
78
79 if (libnvme_transport_handle_is_ctrl(hdl)) {
80 __cleanup_free__attribute__((cleanup(shr_freep))) char *cdev = NULL((void*)0);
81
82 if (!nsid) {
83 nvme_show_error("controller device not supported without --namespace-id")nvme_show_message(1, "controller device not supported without --namespace-id"
)
;
84 return -EINVAL22;
85 }
86
87 if (asprintf(&cdev, "/dev/%sn%d",
88 libnvme_transport_handle_get_name(hdl), nsid) < 0)
89 return -ENOMEM12;
90
91 libnvme_close(hdl);
92
93 err = libnvme_open(ctx, cdev, O_RDONLY00, &hdl);
94 if (err) {
95 *phdl = NULL((void*)0);
96
97 nvme_show_error("could not open %s", cdev)nvme_show_message(1, "could not open %s", cdev);
98 return err;
99 }
100
101 *phdl = hdl;
102 }
103
104 return 0;
105}
106
107static int write_uncor(int argc, char **argv, struct command *acmd, struct plugin *plugin)
108{
109 const char *desc =
110 "The Write Uncorrectable command is used to set a range of logical blocks to invalid.";
111
112 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
113 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
114 struct libnvme_passthru_cmd cmd;
115 int err;
116
117 struct config {
118 __u32 namespace_id;
119 __u64 start_block;
120 __u16 block_count;
121 __u8 dtype;
122 __u16 dspec;
123 };
124
125 struct config cfg = {
126 .namespace_id = 0,
127 .start_block = 0,
128 .block_count = 0,
129 .dtype = 0,
130 .dspec = 0,
131 };
132
133 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
134 OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
135 OPT_SUFFIX("start-block", 's', &cfg.start_block, start_block),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
136 OPT_SHRT("block-count", 'c', &cfg.block_count, block_count),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
137 OPT_BYTE("dir-type", 'T', &cfg.dtype, dtype),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
138 OPT_SHRT("dir-spec", 'S', &cfg.dspec, dspec_w_dtype))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
139
140 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
141 if (err)
142 return err;
143
144 if (!cfg.namespace_id) {
145 err = libnvme_get_nsid(hdl, &cfg.namespace_id);
146 if (err < 0) {
147 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
148 return err;
149 }
150 }
151
152 if (cfg.dtype > 0xf) {
153 nvme_show_error("Invalid directive type, %x", cfg.dtype)nvme_show_message(1, "Invalid directive type, %x", cfg.dtype);
154 return -EINVAL22;
155 }
156
157 nvme_init_write_uncorrectable(&cmd, cfg.namespace_id, cfg.start_block,
158 cfg.block_count, cfg.dtype << 4, cfg.dspec);
159 err = libnvme_exec_io_passthru(hdl, &cmd);
160 if (err) {
161 nvme_show_err(err, "write uncorrectable");
162 return err;
163 }
164
165 nvme_show_verbose_result("NVME Write Uncorrectable Success")nvme_show_verbose_message("NVME Write Uncorrectable Success");
166
167 return err;
168}
169
170static int invalid_tags(__u64 storage_tag, __u64 ref_tag, __u8 sts, __u8 pif)
171{
172 if (sts < 64 && storage_tag >= (1ULL << sts)) {
173 nvme_show_error("Storage tag larger than the STS-defined %u-bit width", sts)nvme_show_message(1, "Storage tag larger than the STS-defined %u-bit width"
, sts)
;
174 return -ECLI_INVALID_TAGS;
175 }
176
177 switch (pif) {
178 case NVME_NVM_PIF_16B_GUARD:
179 if (sts > 32) {
180 nvme_show_error("Storage tag size (STS=%u) larger than the 32-bit maximum allowed by 16b Guard PIF",nvme_show_message(1, "Storage tag size (STS=%u) larger than the 32-bit maximum allowed by 16b Guard PIF"
, sts)
181 sts)nvme_show_message(1, "Storage tag size (STS=%u) larger than the 32-bit maximum allowed by 16b Guard PIF"
, sts)
;
182 return -ECLI_INVALID_TAGS;
183 }
184 if (ref_tag >= (1ULL << (32 - sts))) {
185 nvme_show_error("Reference tag larger than the %u-bit width allowed by 16b Guard PIF (STS=%u)",nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 16b Guard PIF (STS=%u)"
, 32 - sts, sts)
186 32 - sts, sts)nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 16b Guard PIF (STS=%u)"
, 32 - sts, sts)
;
187 return -ECLI_INVALID_TAGS;
188 }
189 break;
190 case NVME_NVM_PIF_32B_GUARD:
191 if (sts < 16 || sts > 64) {
192 nvme_show_error("Storage tag size (STS=%u) outside the 16-64 range allowed by 32b Guard PIF",nvme_show_message(1, "Storage tag size (STS=%u) outside the 16-64 range allowed by 32b Guard PIF"
, sts)
193 sts)nvme_show_message(1, "Storage tag size (STS=%u) outside the 16-64 range allowed by 32b Guard PIF"
, sts)
;
194 return -ECLI_INVALID_TAGS;
195 }
196 if (sts > 16 && ref_tag >= (1ULL << (80 - sts))) {
197 nvme_show_error("Reference tag larger than the %u-bit width allowed by 32b Guard PIF (STS=%u)",nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 32b Guard PIF (STS=%u)"
, 80 - sts, sts)
198 80 - sts, sts)nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 32b Guard PIF (STS=%u)"
, 80 - sts, sts)
;
199 return -ECLI_INVALID_TAGS;
200 }
201 break;
202 case NVME_NVM_PIF_64B_GUARD:
203 if (sts > 48) {
204 nvme_show_error("Storage tag size (STS=%u) larger than the 48-bit maximum allowed by 64b Guard PIF",nvme_show_message(1, "Storage tag size (STS=%u) larger than the 48-bit maximum allowed by 64b Guard PIF"
, sts)
205 sts)nvme_show_message(1, "Storage tag size (STS=%u) larger than the 48-bit maximum allowed by 64b Guard PIF"
, sts)
;
206 return -ECLI_INVALID_TAGS;
207 }
208 if (sts > 0 && ref_tag >= (1ULL << (48 - sts))) {
209 nvme_show_error("Reference tag larger than the %u-bit width allowed by 64b Guard PIF (STS=%u)",nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 64b Guard PIF (STS=%u)"
, 48 - sts, sts)
210 48 - sts, sts)nvme_show_message(1, "Reference tag larger than the %u-bit width allowed by 64b Guard PIF (STS=%u)"
, 48 - sts, sts)
;
211 return -ECLI_INVALID_TAGS;
212 }
213 break;
214 default:
215 nvme_show_error("Invalid PIF value: %u", pif)nvme_show_message(1, "Invalid PIF value: %u", pif);
216 return -ECLI_INVALID_TAGS;
217 }
218
219 return 0;
220}
221
222static int check_lbstm_byte_granularity(__u64 lbstm, __u8 sts)
223{
224 __u8 nr_full_bytes = sts / 8;
225 __u8 nr_rem_bits = sts % 8;
226 __u8 rem_mask, byte;
227 __u8 i;
228
229 if (sts > 64)
230 return -EINVAL22;
231
232 if (sts < 64)
233 lbstm &= (1ULL << sts) - 1;
234
235 for (i = 0; i < nr_full_bytes; i++) {
236 byte = (lbstm >> (i * 8)) & 0xff;
237 if (byte != 0x00 && byte != 0xff)
238 return -EINVAL22;
239 }
240
241 if (nr_rem_bits) {
242 rem_mask = (1u << nr_rem_bits) - 1;
243 byte = (lbstm >> (nr_full_bytes * 8)) & rem_mask;
244 if (byte != 0x00 && byte != rem_mask)
245 return -EINVAL22;
246 }
247
248 return 0;
249}
250
251static int check_lbstm_masking_not_supported(__u64 lbstm, __u8 sts)
252{
253 __u64 stm_mask;
254
255 if (sts > 64)
256 return -EINVAL22;
257
258 stm_mask = (sts < 64) ? ((1ULL << sts) - 1) : ~0ULL;
259 if ((lbstm & stm_mask) != stm_mask)
260 return -EINVAL22;
261
262 return 0;
263}
264
265static int get_pif_sts_via_qpif(struct nvme_nvm_id_ns *nvm_ns, __u32 elbaf,
266 __u8 sts, __u8 *pif)
267{
268 __u64 lbstm;
269 int err = 0;
270
271 *pif = NVME_NVM_ELBAF_QPIF(elbaf)(((elbaf) >> NVME_NVM_ELBAF_QPIF_SHIFT) & NVME_NVM_ELBAF_QPIF_MASK
)
;
272
273 lbstm = le64_to_cpu(nvm_ns->lbstm);
274 switch (NVME_NVM_PIFA_STMLA(nvm_ns->pifa)(((nvm_ns->pifa) >> NVME_NVM_PIFA_STMLA_SHIFT) &
NVME_NVM_PIFA_STMLA_MASK)
) {
275 case NVME_NVM_PIFA_BIT_GRANULARITY_MASKING:
276 break;
277 case NVME_NVM_PIFA_BYTE_GRANULARITY_MASKING:
278 err = check_lbstm_byte_granularity(lbstm, sts);
279 break;
280 case NVME_NVM_PIFA_MASKING_NOT_SUPPORTED:
281 err = check_lbstm_masking_not_supported(lbstm, sts);
282 break;
283 default:
284 err = -EINVAL22;
285 break;
286 }
287
288 if (!err)
289 return 0;
290
291 nvme_show_error("Logical Block Storage Tag Mask is inconsistent with the Storage Tag Masking Level Attribute")nvme_show_message(1, "Logical Block Storage Tag Mask is inconsistent with the Storage Tag Masking Level Attribute"
)
;
292
293 return -ECLI_INVALID_PI_FORMAT;
294}
295
296static int get_pif_sts(struct nvme_id_ns *ns, struct nvme_nvm_id_ns *nvm_ns,
297 __u8 *pif, __u8 *sts)
298{
299 __u8 lba_index;
300 __u32 elbaf;
301
302 nvme_id_ns_flbas_to_lbaf_inuse(ns->flbas, &lba_index);
303 elbaf = le32_to_cpu(nvm_ns->elbaf[lba_index]);
304 *sts = NVME_NVM_ELBAF_STS(elbaf)(((elbaf) >> NVME_NVM_ELBAF_STS_SHIFT) & NVME_NVM_ELBAF_STS_MASK
)
;
305 *pif = NVME_NVM_ELBAF_PIF(elbaf)(((elbaf) >> NVME_NVM_ELBAF_PIF_SHIFT) & NVME_NVM_ELBAF_PIF_MASK
)
;
306
307 if (*pif == NVME_NVM_PIF_QTYPE && NVME_NVM_PIC_QPIFS(nvm_ns->pic)(((nvm_ns->pic) >> NVME_NVM_PIC_QPIFS_SHIFT) & NVME_NVM_PIC_QPIFS_MASK
)
)
308 return get_pif_sts_via_qpif(nvm_ns, elbaf, *sts, pif);
309
310 return 0;
311}
312
313static int get_pi_info(struct libnvme_transport_handle *hdl,
314 __u32 nsid, __u8 prinfo, __u64 ilbrt, __u64 lbst,
315 unsigned int *logical_block_size, __u16 *metadata_size)
316{
317 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) struct nvme_nvm_id_ns *nvm_ns = NULL((void*)0);
318 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) struct nvme_id_ns *ns = NULL((void*)0);
319 struct libnvme_passthru_cmd cmd;
320 __u8 sts = 0, pif = 0;
321 unsigned int lbs = 0;
322 __u8 lba_index;
323 int pi_size;
324 __u16 ms;
325 int err;
326
327 ns = libnvme_alloc(sizeof(*ns));
328 if (!ns)
329 return -ENOMEM12;
330
331 nvme_init_identify_ns(&cmd, nsid, ns);
332 err = libnvme_exec_admin_passthru(hdl, &cmd);
333 if (err) {
334 nvme_show_err(err, "identify namespace");
335 return -ECLI_IDENTIFY_NS_FAILED;
336 }
337
338 nvme_id_ns_flbas_to_lbaf_inuse(ns->flbas, &lba_index);
339 lbs = 1 << ns->lbaf[lba_index].ds;
340 ms = le16_to_cpu(ns->lbaf[lba_index].ms);
341 /*
342 * Conservative fallback: if Identify NVM CS NS below fails for any
343 * reason other than Invalid Field, we return early with PI simply
344 * unavailable, and this is the size submit_io() will use. For an
345 * extended-LBA namespace the metadata is always part of the
346 * transfer, so publish the full size now; the PRACT exception below
347 * can only shrink it once PI info actually comes back.
348 */
349 *logical_block_size = lbs + (NVME_FLBAS_META_EXT(ns->flbas)(((ns->flbas) >> NVME_FLBAS_META_EXT_SHIFT) & NVME_FLBAS_META_EXT_MASK
)
? ms : 0);
350 *metadata_size = ms;
351
352 nvm_ns = libnvme_alloc(sizeof(*nvm_ns));
353 if (!nvm_ns)
354 return -ENOMEM12;
355
356 nvme_init_identify_csi_ns(&cmd, nsid, NVME_CSI_NVM, 0, nvm_ns);
357 err = libnvme_exec_admin_passthru(hdl, &cmd);
358 if (!err) {
359 err = get_pif_sts(ns, nvm_ns, &pif, &sts);
360 if (err)
361 return err;
362 } else if (!nvme_status_equals(err, NVME_STATUS_TYPE_NVME,
363 NVME_SC_INVALID_FIELD)) {
364 return err;
365 }
366
367 pi_size = (pif == NVME_NVM_PIF_16B_GUARD) ? 8 : 16;
368 if (NVME_FLBAS_META_EXT(ns->flbas)(((ns->flbas) >> NVME_FLBAS_META_EXT_SHIFT) & NVME_FLBAS_META_EXT_MASK
)
) {
369 /*
370 * No meta data is transferred for PRACT=1 and MD=PI size:
371 * 5.2.2.1 Protection Information and Write Commands
372 * 5.2.2.2 Protection Information and Read Commands
373 */
374 if (!((prinfo & 0x8) != 0 && ms == pi_size))
375 lbs += ms;
376 }
377
378 err = invalid_tags(lbst, ilbrt, sts, pif);
379 if (err)
380 return err;
381
382 *logical_block_size = lbs;
383 *metadata_size = ms;
384
385 return 0;
386}
387
388static int init_pi_tags(struct libnvme_transport_handle *hdl,
389 struct libnvme_passthru_cmd *cmd, __u32 nsid, __u64 ilbrt, __u64 lbst,
390 __u16 lbat, __u16 lbatm)
391{
392 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) struct nvme_nvm_id_ns *nvm_ns = NULL((void*)0);
393 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) struct nvme_id_ns *ns = NULL((void*)0);
394 struct libnvme_passthru_cmd id_cmd;
395 __u8 sts = 0, pif = 0;
396 int err = 0;
397
398 ns = libnvme_alloc(sizeof(*ns));
399 if (!ns)
400 return -ENOMEM12;
401
402 nvme_init_identify_ns(&id_cmd, nsid, ns);
403 err = libnvme_exec_admin_passthru(hdl, &id_cmd);
404 if (err) {
405 nvme_show_err(err, "identify namespace");
406 return err;
407 }
408
409 nvm_ns = libnvme_alloc(sizeof(*nvm_ns));
410 if (!nvm_ns)
411 return -ENOMEM12;
412
413 nvme_init_identify_csi_ns(&id_cmd, nsid, NVME_CSI_NVM, 0, nvm_ns);
414 err = libnvme_exec_admin_passthru(hdl, &id_cmd);
415 if (!err) {
416 err = get_pif_sts(ns, nvm_ns, &pif, &sts);
417 if (err)
418 return err;
419 } else if (nvme_status_get_type(err) != NVME_STATUS_TYPE_NVME ||
420 nvme_status_code(nvme_status_get_value(err)) != NVME_SC_INVALID_FIELD) {
421 return err;
422 }
423
424 err = invalid_tags(lbst, ilbrt, sts, pif);
425 if (err)
426 return err;
427
428 nvme_init_var_size_tags(cmd, pif, sts, ilbrt, lbst);
429 nvme_init_app_tag(cmd, lbat, lbatm);
430
431 return 0;
432}
433
434static int write_zeroes(int argc, char **argv,
435 struct command *acmd, struct plugin *plugin)
436{
437 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
438 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
439 struct libnvme_passthru_cmd cmd;
440 __u16 control = 0;
441 int err;
442
443 const char *desc =
444 "The Write Zeroes command is used to set a range of logical blocks to zero.";
445 const char *deac =
446 "Set DEAC bit, requesting controller to deallocate specified logical blocks";
447 const char *nsz = "Clear all logical blocks to zero in the entire namespace";
448
449 struct config {
450 __u32 nsid;
451 __u64 start_block;
452 __u16 block_count;
453 __u8 dtype;
454 bool_Bool deac;
455 bool_Bool limited_retry;
456 bool_Bool force_unit_access;
457 __u8 prinfo;
458 __u64 ilbrt;
459 __u16 lbatm;
460 __u16 lbat;
461 __u64 lbst;
462 bool_Bool stc;
463 __u16 dspec;
464 bool_Bool nsz;
465 };
466
467 struct config cfg = {
468 .nsid = 0,
469 .start_block = 0,
470 .block_count = 0,
471 .dtype = 0,
472 .deac = false0,
473 .limited_retry = false0,
474 .force_unit_access = false0,
475 .prinfo = 0,
476 .ilbrt = 0,
477 .lbatm = 0,
478 .lbat = 0,
479 .lbst = 0,
480 .stc = false0,
481 .dspec = 0,
482 .nsz = false0,
483 };
484
485 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
486 OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
487 OPT_SUFFIX("start-block", 's', &cfg.start_block, start_block),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
488 OPT_SHRT("block-count", 'c', &cfg.block_count, block_count),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
489 OPT_BYTE("dir-type", 'T', &cfg.dtype, dtype),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
490 OPT_FLAG("deac", 'd', &cfg.deac, deac),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
491 OPT_FLAG("limited-retry", 'l', &cfg.limited_retry, limited_retry),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
492 OPT_FLAG("force-unit-access", 'f', &cfg.force_unit_access, force_unit_access),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
493 OPT_BYTE("prinfo", 'p', &cfg.prinfo, prinfo),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
494 OPT_SUFFIX("ref-tag", 'r', &cfg.ilbrt, ref_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
495 OPT_SHRT("app-tag-mask", 'm', &cfg.lbatm, app_tag_mask),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
496 OPT_SHRT("app-tag", 'a', &cfg.lbat, app_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
497 OPT_SUFFIX("storage-tag", 'S', &cfg.lbst, storage_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
498 OPT_FLAG("storage-tag-check", 'C', &cfg.stc, storage_tag_check),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
499 OPT_SHRT("dir-spec", 'D', &cfg.dspec, dspec_w_dtype),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
500 OPT_FLAG("namespace-zeroes", 'Z', &cfg.nsz, nsz))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1, dtype
, 0, }, {"deac", 'd', ((void*)0), CFG_FLAG, &cfg.deac, 0,
deac, 0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &
cfg.limited_retry, 0, limited_retry, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &
cfg.lbatm, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT
, &cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'S', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-spec", 'D', "NUM", CFG_SHORT, &cfg.dspec, 1
, dspec_w_dtype, 0, }, {"namespace-zeroes", 'Z', ((void*)0), CFG_FLAG
, &cfg.nsz, 0, nsz, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
501
502 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
503 if (err)
504 return err;
505
506 if (cfg.prinfo > 0xf)
507 return -EINVAL22;
508
509 if (cfg.dtype > 0x7) {
510 nvme_show_error("Invalid directive type, %x", cfg.dtype)nvme_show_message(1, "Invalid directive type, %x", cfg.dtype);
511 return -EINVAL22;
512 }
513
514 control |= (cfg.prinfo << 10);
515 if (cfg.limited_retry)
516 control |= NVME_IO_LR;
517 if (cfg.force_unit_access)
518 control |= NVME_IO_FUA;
519 if (cfg.deac)
520 control |= NVME_IO_DEAC;
521 if (cfg.stc)
522 control |= NVME_IO_STC;
523 if (cfg.nsz)
524 control |= NVME_IO_NSZ;
525 control |= (cfg.dtype << 4);
526 if (!cfg.nsid) {
527 err = libnvme_get_nsid(hdl, &cfg.nsid);
528 if (err < 0) {
529 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
530 return err;
531 }
532 }
533
534 nvme_init_write_zeros(&cmd, cfg.nsid, cfg.start_block, cfg.block_count,
535 control, cfg.dspec, 0, 0);
536
537 err = init_pi_tags(hdl, &cmd, cfg.nsid, cfg.ilbrt, cfg.lbst, cfg.lbat,
538 cfg.lbatm);
539 if (err)
540 return err;
541
542 err = libnvme_exec_io_passthru(hdl, &cmd);
543 if (err) {
544 nvme_show_err(err, "write-zeroes");
545 return err;
546 }
547
548 nvme_show_verbose_result("NVME Write Zeroes Success")nvme_show_verbose_message("NVME Write Zeroes Success");
549
550 if (!cfg.nsz || !nvme_args.verbose)
551 return err;
552
553 if (cmd.result & 0x1)
554 nvme_show_result(nvme_show_message(0, "All logical blocks in the entire namespace cleared to zero"
)
555 "All logical blocks in the entire namespace cleared to zero")nvme_show_message(0, "All logical blocks in the entire namespace cleared to zero"
)
;
556 else
557 nvme_show_result("%d logical blocks cleared to zero", cfg.block_count)nvme_show_message(0, "%d logical blocks cleared to zero", cfg
.block_count)
;
558
559 return err;
560}
561
562static int dsm(int argc, char **argv, struct command *acmd, struct plugin *plugin)
563{
564 const char *desc = "The Dataset Management command is used by the host to\n"
565 "indicate attributes for ranges of logical blocks. This includes attributes\n"
566 "for discarding unused blocks, data read and write frequency, access size, and other\n"
567 "information that may be used to optimize performance and reliability.";
568 const char *blocks = "Comma separated list of the number of blocks in each range";
569 const char *starting_blocks = "Comma separated list of the starting block in each range";
570 const char *context_attrs = "Comma separated list of the context attributes in each range";
571 const char *ad = "Attribute Deallocate";
572 const char *idw = "Attribute Integral Dataset for Write";
573 const char *idr = "Attribute Integral Dataset for Read";
574 const char *cdw11 = "All the command DWORD 11 attributes. Use instead of specifying individual attributes";
575
576 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
577 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
578 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) struct nvme_dsm_range *dsm = NULL((void*)0);
579 struct libnvme_passthru_cmd cmd;
580 __u32 ctx_attrs[NVME_DSM_MAX_RANGES] = {0,};
581 __u32 nlbs[NVME_DSM_MAX_RANGES] = {0,};
582 __u64 slbas[NVME_DSM_MAX_RANGES] = {0,};
583 nvme_print_flags_t flags;
584 uint16_t nc, nb, ns;
585 int err;
586
587 struct config {
588 __u32 namespace_id;
589 char *ctx_attrs;
590 char *blocks;
591 char *slbas;
592 bool_Bool ad;
593 bool_Bool idw;
594 bool_Bool idr;
595 __u32 cdw11;
596 };
597
598 struct config cfg = {
599 .namespace_id = 0,
600 .ctx_attrs = "",
601 .blocks = "",
602 .slbas = "",
603 .ad = false0,
604 .idw = false0,
605 .idr = false0,
606 .cdw11 = 0,
607 };
608
609 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
610 OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
611 OPT_LIST("ctx-attrs", 'a', &cfg.ctx_attrs, context_attrs),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
612 OPT_LIST("blocks", 'b', &cfg.blocks, blocks),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
613 OPT_LIST("slbs", 's', &cfg.slbas, starting_blocks),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
614 OPT_FLAG("ad", 'd', &cfg.ad, ad),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
615 OPT_FLAG("idw", 'w', &cfg.idw, idw),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
616 OPT_FLAG("idr", 'r', &cfg.idr, idr),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
617 OPT_UINT("cdw11", 'c', &cfg.cdw11, cdw11))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"ctx-attrs", 'a', "LIST", CFG_STRING
, &cfg.ctx_attrs, 1, context_attrs, 0, }, {"blocks", 'b',
"LIST", CFG_STRING, &cfg.blocks, 1, blocks, 0, }, {"slbs"
, 's', "LIST", CFG_STRING, &cfg.slbas, 1, starting_blocks
, 0, }, {"ad", 'd', ((void*)0), CFG_FLAG, &cfg.ad, 0, ad,
0, }, {"idw", 'w', ((void*)0), CFG_FLAG, &cfg.idw, 0, idw
, 0, }, {"idr", 'r', ((void*)0), CFG_FLAG, &cfg.idr, 0, idr
, 0, }, {"cdw11", 'c', "NUM", CFG_POSITIVE, &cfg.cdw11, 1
, cdw11, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void
*)0), 0, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM"
, CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
618
619 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
620 if (err)
621 return err;
622
623 err = open_fallback_chardev(ctx, cfg.namespace_id, &hdl);
624 if (err)
625 return err;
626
627 err = validate_output_format(nvme_args.output_format, &flags);
628 if (err < 0) {
629 nvme_show_error("Invalid output format")nvme_show_message(1, "Invalid output format");
630 return err;
631 }
632
633 nc = shr_parse_csv_u32(cfg.ctx_attrs, ctx_attrs, ARRAY_SIZE(ctx_attrs))shr_parse_csv_uint(cfg.ctx_attrs, (unsigned int *)(ctx_attrs)
+ (sizeof(char [1 - 2*!(sizeof(*(ctx_attrs)) == sizeof(unsigned
int))]) - 1), (sizeof(ctx_attrs) / sizeof((ctx_attrs)[0]) + 0
))
;
634 nb = shr_parse_csv_u32(cfg.blocks, nlbs, ARRAY_SIZE(nlbs))shr_parse_csv_uint(cfg.blocks, (unsigned int *)(nlbs) + (sizeof
(char [1 - 2*!(sizeof(*(nlbs)) == sizeof(unsigned int))]) - 1
), (sizeof(nlbs) / sizeof((nlbs)[0]) + 0))
;
635 ns = shr_parse_csv_u64(cfg.slbas, slbas, ARRAY_SIZE(slbas))shr_parse_csv_ulonglong(cfg.slbas, (unsigned long long *)(slbas
) + (sizeof(char [1 - 2*!(sizeof(*(slbas)) == sizeof(unsigned
long long))]) - 1), (sizeof(slbas) / sizeof((slbas)[0]) + 0)
)
;
636 if ((nb != ns) ||
637 (argconfig_parse_seen(opts, "ctx-attrs") && nb != nc)) {
638 nvme_show_error("No valid range definition provided")nvme_show_message(1, "No valid range definition provided");
639 return -EINVAL22;
640 }
641 if (!nb || nb > NVME_DSM_MAX_RANGES) {
642 nvme_show_error("No range definition provided")nvme_show_message(1, "No range definition provided");
643 return -EINVAL22;
644 }
645
646 if (!cfg.namespace_id) {
647 err = libnvme_get_nsid(hdl, &cfg.namespace_id);
648 if (err < 0) {
649 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
650 return err;
651 }
652 }
653 if (cfg.cdw11) {
654 cfg.ad = NVME_GET(cfg.cdw11, DSM_CDW11_AD)(((cfg.cdw11) >> NVME_DSM_CDW11_AD_SHIFT) & NVME_DSM_CDW11_AD_MASK
)
;
655 cfg.idw = NVME_GET(cfg.cdw11, DSM_CDW11_IDW)(((cfg.cdw11) >> NVME_DSM_CDW11_IDW_SHIFT) & NVME_DSM_CDW11_IDW_MASK
)
;
656 cfg.idr = NVME_GET(cfg.cdw11, DSM_CDW11_IDR)(((cfg.cdw11) >> NVME_DSM_CDW11_IDR_SHIFT) & NVME_DSM_CDW11_IDR_MASK
)
;
657 }
658
659 dsm = libnvme_alloc(sizeof(*dsm) * nb);
660 if (!dsm)
661 return -ENOMEM12;
662
663 nvme_init_dsm_range(dsm, ctx_attrs, nlbs, slbas, nb);
664 nvme_init_dsm(&cmd, cfg.namespace_id, nb, cfg.idr, cfg.idw, cfg.ad, dsm,
665 sizeof(*dsm) * nb);
666 err = libnvme_exec_io_passthru(hdl, &cmd);
667 if (err) {
668 nvme_show_err(err, "data-set management");
669 return err;
670 }
671
672 nvme_show_verbose_result("NVMe DSM: success")nvme_show_verbose_message("NVMe DSM: success");
673
674 return err;
675}
676
677static int copy_cmd(int argc, char **argv, struct command *acmd, struct plugin *plugin)
678{
679 const char *desc = "The Copy command is used by the host to copy data\n"
680 "from one or more source logical block ranges to a\n"
681 "single consecutive destination logical block range.";
682 const char *d_sdlba = "64-bit addr of first destination logical block";
683 const char *d_slbas = "64-bit addr of first block per range (comma-separated list)";
684 const char *d_nlbs = "number of blocks per range (comma-separated list, zeroes-based values)";
685 const char *d_snsids = "source namespace identifier per range (comma-separated list)";
686 const char *d_sopts = "source options per range (comma-separated list)";
687 const char *d_lr = "limited retry";
688 const char *d_fua = "force unit access";
689 const char *d_prinfor = "protection information and check field (read part)";
690 const char *d_prinfow = "protection information and check field (write part)";
691 const char *d_ilbrt = "initial lba reference tag (write part)";
692 const char *d_eilbrts = "expected lba reference tags (read part, comma-separated list)";
693 const char *d_lbat = "lba application tag (write part)";
694 const char *d_elbats = "expected lba application tags (read part, comma-separated list)";
695 const char *d_lbatm = "lba application tag mask (write part)";
696 const char *d_elbatms = "expected lba application tag masks (read part, comma-separated list)";
697 const char *d_dtype = "directive type (write part)";
698 const char *d_dspec = "directive specific (write part)";
699 const char *d_format = "source range entry format";
700
701 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
702 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
703 __u16 nr, nb, ns, nrts, natms, nats, nids;
704 struct libnvme_passthru_cmd cmd;
705 __u16 nlbs[256] = { 0 };
706 __u64 slbas[256] = { 0 };
707 __u32 snsids[256] = { 0 };
708 __u16 sopts[256] = { 0 };
709 int err;
710
711 union {
712 __u32 short_pi[256];
713 __u64 long_pi[256];
714 } eilbrts;
715
716 __u16 elbatms[256] = { 0 };
717 __u16 elbats[256] = { 0 };
718
719 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) union {
720 struct nvme_copy_range_f0 f0[256];
721 struct nvme_copy_range_f1 f1[256];
722 struct nvme_copy_range_f2 f2[256];
723 struct nvme_copy_range_f3 f3[256];
724 } *copy = NULL((void*)0);
725
726 struct config {
727 __u32 nsid;
728 __u64 sdlba;
729 char *slbas;
730 char *nlbs;
731 char *snsids;
732 char *sopts;
733 bool_Bool lr;
734 bool_Bool fua;
735 __u8 prinfow;
736 __u8 prinfor;
737 __u64 ilbrt;
738 char *eilbrts;
739 __u16 lbat;
740 char *elbats;
741 __u16 lbatm;
742 char *elbatms;
743 __u8 dtype;
744 __u16 dspec;
745 __u8 format;
746 __u64 lbst;
747 bool_Bool stc;
748 };
749
750 struct config cfg = {
751 .nsid = 0,
752 .sdlba = 0,
753 .slbas = "",
754 .nlbs = "",
755 .snsids = "",
756 .sopts = "",
757 .lr = false0,
758 .fua = false0,
759 .prinfow = 0,
760 .prinfor = 0,
761 .ilbrt = 0,
762 .eilbrts = "",
763 .lbat = 0,
764 .elbats = "",
765 .lbatm = 0,
766 .elbatms = "",
767 .dtype = 0,
768 .dspec = 0,
769 .format = 0,
770 .lbst = 0,
771 .stc = false0,
772 };
773
774 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
775 OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_id_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
776 OPT_SUFFIX("sdlba", 'd', &cfg.sdlba, d_sdlba),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
777 OPT_LIST("slbs", 's', &cfg.slbas, d_slbas),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
778 OPT_LIST("blocks", 'b', &cfg.nlbs, d_nlbs),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
779 OPT_LIST("snsids", 'N', &cfg.snsids, d_snsids),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
780 OPT_LIST("sopts", 'O', &cfg.sopts, d_sopts),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
781 OPT_FLAG("limited-retry", 'l', &cfg.lr, d_lr),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
782 OPT_FLAG("force-unit-access", 'f', &cfg.fua, d_fua),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
783 OPT_BYTE("prinfow", 'p', &cfg.prinfow, d_prinfow),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
784 OPT_BYTE("prinfor", 'P', &cfg.prinfor, d_prinfor),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
785 OPT_SUFFIX("ref-tag", 'r', &cfg.ilbrt, d_ilbrt),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
786 OPT_LIST("expected-ref-tags", 'R', &cfg.eilbrts, d_eilbrts),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
787 OPT_SHRT("app-tag", 'a', &cfg.lbat, d_lbat),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
788 OPT_LIST("expected-app-tags", 'A', &cfg.elbats, d_elbats),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
789 OPT_SHRT("app-tag-mask", 'm', &cfg.lbatm, d_lbatm),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
790 OPT_LIST("expected-app-tag-masks", 'M', &cfg.elbatms, d_elbatms),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
791 OPT_BYTE("dir-type", 'T', &cfg.dtype, d_dtype),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
792 OPT_SHRT("dir-spec", 'S', &cfg.dspec, d_dspec),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
793 OPT_BYTE("format", 'F', &cfg.format, d_format),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
794 OPT_SUFFIX("storage-tag", 't', &cfg.lbst, storage_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
795 OPT_FLAG("storage-tag-check", 'c', &cfg.stc, storage_tag_check))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"sdlba", 'd', "IONUM", CFG_LONG_SUFFIX
, &cfg.sdlba, 1, d_sdlba, 0, }, {"slbs", 's', "LIST", CFG_STRING
, &cfg.slbas, 1, d_slbas, 0, }, {"blocks", 'b', "LIST", CFG_STRING
, &cfg.nlbs, 1, d_nlbs, 0, }, {"snsids", 'N', "LIST", CFG_STRING
, &cfg.snsids, 1, d_snsids, 0, }, {"sopts", 'O', "LIST", CFG_STRING
, &cfg.sopts, 1, d_sopts, 0, }, {"limited-retry", 'l', ((
void*)0), CFG_FLAG, &cfg.lr, 0, d_lr, 0, }, {"force-unit-access"
, 'f', ((void*)0), CFG_FLAG, &cfg.fua, 0, d_fua, 0, }, {"prinfow"
, 'p', "NUM", CFG_BYTE, &cfg.prinfow, 1, d_prinfow, 0, },
{"prinfor", 'P', "NUM", CFG_BYTE, &cfg.prinfor, 1, d_prinfor
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, d_ilbrt, 0, }, {"expected-ref-tags", 'R', "LIST", CFG_STRING
, &cfg.eilbrts, 1, d_eilbrts, 0, }, {"app-tag", 'a', "NUM"
, CFG_SHORT, &cfg.lbat, 1, d_lbat, 0, }, {"expected-app-tags"
, 'A', "LIST", CFG_STRING, &cfg.elbats, 1, d_elbats, 0, }
, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm, 1, d_lbatm
, 0, }, {"expected-app-tag-masks", 'M', "LIST", CFG_STRING, &
cfg.elbatms, 1, d_elbatms, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE
, &cfg.dtype, 1, d_dtype, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT
, &cfg.dspec, 1, d_dspec, 0, }, {"format", 'F', "NUM", CFG_BYTE
, &cfg.format, 1, d_format, 0, }, {"storage-tag", 't', "IONUM"
, CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }, {"storage-tag-check"
, 'c', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0
, "Global options", 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT
, &nvme_args.verbose, 0, "Increase output verbosity", 0, }
, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0,
"suppress informational output", 0, }, {"output-format", 'o'
, "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
796
797 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
798 if (err)
799 return err;
800
801 nb = shr_parse_csv_u16(cfg.nlbs, nlbs, ARRAY_SIZE(nlbs))shr_parse_csv_ushort(cfg.nlbs, (unsigned short *)(nlbs) + (sizeof
(char [1 - 2*!(sizeof(*(nlbs)) == sizeof(unsigned short))]) -
1), (sizeof(nlbs) / sizeof((nlbs)[0]) + 0))
;
802 ns = shr_parse_csv_u64(cfg.slbas, slbas, ARRAY_SIZE(slbas))shr_parse_csv_ulonglong(cfg.slbas, (unsigned long long *)(slbas
) + (sizeof(char [1 - 2*!(sizeof(*(slbas)) == sizeof(unsigned
long long))]) - 1), (sizeof(slbas) / sizeof((slbas)[0]) + 0)
)
;
803 nids = shr_parse_csv_u32(cfg.snsids, snsids, ARRAY_SIZE(snsids))shr_parse_csv_uint(cfg.snsids, (unsigned int *)(snsids) + (sizeof
(char [1 - 2*!(sizeof(*(snsids)) == sizeof(unsigned int))]) -
1), (sizeof(snsids) / sizeof((snsids)[0]) + 0))
;
804 shr_parse_csv_u16(cfg.sopts, sopts, ARRAY_SIZE(sopts))shr_parse_csv_ushort(cfg.sopts, (unsigned short *)(sopts) + (
sizeof(char [1 - 2*!(sizeof(*(sopts)) == sizeof(unsigned short
))]) - 1), (sizeof(sopts) / sizeof((sopts)[0]) + 0))
;
805
806 switch (cfg.format) {
807 case 0:
808 case 2:
809 nrts = shr_parse_csv_u32(cfg.eilbrts,shr_parse_csv_uint(cfg.eilbrts, (unsigned int *)(eilbrts.short_pi
) + (sizeof(char [1 - 2*!(sizeof(*(eilbrts.short_pi)) == sizeof
(unsigned int))]) - 1), (sizeof(eilbrts.short_pi) / sizeof((eilbrts
.short_pi)[0]) + 0))
810 eilbrts.short_pi, ARRAY_SIZE(eilbrts.short_pi))shr_parse_csv_uint(cfg.eilbrts, (unsigned int *)(eilbrts.short_pi
) + (sizeof(char [1 - 2*!(sizeof(*(eilbrts.short_pi)) == sizeof
(unsigned int))]) - 1), (sizeof(eilbrts.short_pi) / sizeof((eilbrts
.short_pi)[0]) + 0))
;
811 break;
812 case 1:
813 case 3:
814 nrts = shr_parse_csv_u64(cfg.eilbrts,shr_parse_csv_ulonglong(cfg.eilbrts, (unsigned long long *)(eilbrts
.long_pi) + (sizeof(char [1 - 2*!(sizeof(*(eilbrts.long_pi)) ==
sizeof(unsigned long long))]) - 1), (sizeof(eilbrts.long_pi)
/ sizeof((eilbrts.long_pi)[0]) + 0))
815 eilbrts.long_pi, ARRAY_SIZE(eilbrts.long_pi))shr_parse_csv_ulonglong(cfg.eilbrts, (unsigned long long *)(eilbrts
.long_pi) + (sizeof(char [1 - 2*!(sizeof(*(eilbrts.long_pi)) ==
sizeof(unsigned long long))]) - 1), (sizeof(eilbrts.long_pi)
/ sizeof((eilbrts.long_pi)[0]) + 0))
;
816 break;
817 default:
818 nvme_show_error("invalid format")nvme_show_message(1, "invalid format");
819 return -EINVAL22;
820 }
821
822 natms = shr_parse_csv_u16(cfg.elbatms, elbatms,shr_parse_csv_ushort(cfg.elbatms, (unsigned short *)(elbatms)
+ (sizeof(char [1 - 2*!(sizeof(*(elbatms)) == sizeof(unsigned
short))]) - 1), (sizeof(elbatms) / sizeof((elbatms)[0]) + 0)
)
823 ARRAY_SIZE(elbatms))shr_parse_csv_ushort(cfg.elbatms, (unsigned short *)(elbatms)
+ (sizeof(char [1 - 2*!(sizeof(*(elbatms)) == sizeof(unsigned
short))]) - 1), (sizeof(elbatms) / sizeof((elbatms)[0]) + 0)
)
;
824 nats = shr_parse_csv_u16(cfg.elbats, elbats,shr_parse_csv_ushort(cfg.elbats, (unsigned short *)(elbats) +
(sizeof(char [1 - 2*!(sizeof(*(elbats)) == sizeof(unsigned short
))]) - 1), (sizeof(elbats) / sizeof((elbats)[0]) + 0))
825 ARRAY_SIZE(elbats))shr_parse_csv_ushort(cfg.elbats, (unsigned short *)(elbats) +
(sizeof(char [1 - 2*!(sizeof(*(elbats)) == sizeof(unsigned short
))]) - 1), (sizeof(elbats) / sizeof((elbats)[0]) + 0))
;
826
827 nr = max(nb, max(ns, max(nrts, max(natms, nats))))({ typeof(nb) _a = (nb); typeof(({ typeof(ns) _a = (ns); typeof
(({ typeof(nrts) _a = (nrts); typeof(({ typeof(natms) _a = (natms
); typeof(nats) _b = (nats); do { } while (0); _a > _b ? _a
: _b; })) _b = (({ typeof(natms) _a = (natms); typeof(nats) _b
= (nats); do { } while (0); _a > _b ? _a : _b; })); do { }
while (0); _a > _b ? _a : _b; })) _b = (({ typeof(nrts) _a
= (nrts); typeof(({ typeof(natms) _a = (natms); typeof(nats)
_b = (nats); do { } while (0); _a > _b ? _a : _b; })) _b =
(({ typeof(natms) _a = (natms); typeof(nats) _b = (nats); do
{ } while (0); _a > _b ? _a : _b; })); do { } while (0); _a
> _b ? _a : _b; })); do { } while (0); _a > _b ? _a : _b
; })) _b = (({ typeof(ns) _a = (ns); typeof(({ typeof(nrts) _a
= (nrts); typeof(({ typeof(natms) _a = (natms); typeof(nats)
_b = (nats); do { } while (0); _a > _b ? _a : _b; })) _b =
(({ typeof(natms) _a = (natms); typeof(nats) _b = (nats); do
{ } while (0); _a > _b ? _a : _b; })); do { } while (0); _a
> _b ? _a : _b; })) _b = (({ typeof(nrts) _a = (nrts); typeof
(({ typeof(natms) _a = (natms); typeof(nats) _b = (nats); do {
} while (0); _a > _b ? _a : _b; })) _b = (({ typeof(natms
) _a = (natms); typeof(nats) _b = (nats); do { } while (0); _a
> _b ? _a : _b; })); do { } while (0); _a > _b ? _a : _b
; })); do { } while (0); _a > _b ? _a : _b; })); do { } while
(0); _a > _b ? _a : _b; })
;
828 if (cfg.format == 2 || cfg.format == 3) {
829 if (nr != nids) {
830 nvme_show_error("formats 2 and 3 require source namespace ids for each source range")nvme_show_message(1, "formats 2 and 3 require source namespace ids for each source range"
)
;
831 return -EINVAL22;
832 }
833 } else if (nids) {
834 nvme_show_error("formats 0 and 1 do not support cross-namespace copy")nvme_show_message(1, "formats 0 and 1 do not support cross-namespace copy"
)
;
835 return -EINVAL22;
836 }
837 if (!nr || nr > 256) {
838 nvme_show_error("invalid range")nvme_show_message(1, "invalid range");
839 return -EINVAL22;
840 }
841
842 if (!cfg.nsid) {
843 err = libnvme_get_nsid(hdl, &cfg.nsid);
844 if (err < 0) {
845 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
846 return err;
847 }
848 }
849
850 copy = libnvme_alloc(sizeof(*copy));
851 if (!copy)
852 return -ENOMEM12;
853
854 switch (cfg.format) {
855 case 1:
856 nvme_init_copy_range_f1(copy->f1, nlbs, slbas, eilbrts.long_pi,
857 elbatms, elbats, nr);
858 break;
859 case 2:
860 nvme_init_copy_range_f2(copy->f2, snsids, nlbs, slbas, sopts,
861 eilbrts.short_pi, elbatms, elbats, nr);
862 break;
863 case 3:
864 nvme_init_copy_range_f3(copy->f3, snsids, nlbs, slbas, sopts,
865 eilbrts.long_pi, elbatms, elbats, nr);
866 break;
867 default:
868 nvme_init_copy_range_f0(copy->f0, nlbs, slbas, eilbrts.short_pi,
869 elbatms, elbats, nr);
870 break;
871 }
872
873 nvme_init_copy(&cmd, cfg.nsid, cfg.sdlba, nr, cfg.format,
874 cfg.prinfor, cfg.prinfow, 0, cfg.dtype, cfg.stc, cfg.stc,
875 cfg.fua, cfg.lr, 0, cfg.dspec, copy->f0);
876 err = init_pi_tags(hdl, &cmd, cfg.nsid, cfg.ilbrt, cfg.lbst, cfg.lbat,
877 cfg.lbatm);
878 if (err)
879 return err;
880 err = libnvme_exec_io_passthru(hdl, &cmd);
881 if (err) {
882 nvme_show_err(err, "NVMe Copy");
883 return err;
884 }
885
886 nvme_show_verbose_result("NVMe Copy: success")nvme_show_verbose_message("NVMe Copy: success");
887
888 return err;
889}
890
891static int flush_cmd(int argc, char **argv, struct command *acmd, struct plugin *plugin)
892{
893 const char *desc = "Commit data and metadata associated with\n"
894 "given namespaces to nonvolatile media. Applies to all commands\n"
895 "finished before the flush was submitted. Additional data may also be\n"
896 "flushed by the controller, from any namespace, depending on controller and\n"
897 "associated namespace status.";
898
899 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
900 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
901 struct libnvme_passthru_cmd cmd = {};
902 int err;
903
904 struct config {
905 __u32 namespace_id;
906 };
907
908 struct config cfg = {
909 .namespace_id = 0,
910 };
911
912 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
913 OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id_desired))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_id_desired, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
914
915 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
916 if (err)
917 return err;
918
919 err = open_fallback_chardev(ctx, cfg.namespace_id, &hdl);
920 if (err)
921 return err;
922
923 if (!cfg.namespace_id) {
924 err = libnvme_get_nsid(hdl, &cfg.namespace_id);
925 if (err < 0) {
926 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
927 return err;
928 }
929 }
930
931 cmd.opcode = nvme_cmd_flush;
932 cmd.nsid = cfg.namespace_id;
933
934 err = libnvme_exec_io_passthru(hdl, &cmd);
935 if (err) {
936 nvme_show_err(err, "flush");
937 return err;
938 }
939
940 nvme_show_verbose_result("NVMe Flush: success")nvme_show_verbose_message("NVMe Flush: success");
941
942 return err;
943}
944
945static int submit_io(int opcode, char *command, const char *desc, int argc, char **argv)
946{
947 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
948 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
949 unsigned long long buffer_size = 0, mbuffer_size = 0;
950 __cleanup_free__attribute__((cleanup(shr_freep))) struct nvme_nvm_id_ns *nvm_ns = NULL((void*)0);
951 __cleanup_huge__attribute__((cleanup(libnvme_free_huge))) struct libnvme_mem_huge mh = { 0, };
952 __cleanup_free__attribute__((cleanup(shr_freep))) struct nvme_id_ns *ns = NULL((void*)0);
953 unsigned int logical_block_size = 0;
954 struct timeval start_time, end_time;
955 __cleanup_free__attribute__((cleanup(shr_freep))) void *mbuffer = NULL((void*)0);
956 __cleanup_fd__attribute__((cleanup(shr_cleanup_fd))) int dfd = -1, mfd = -1;
957 __u16 control = 0, nblocks = 0;
958 struct libnvme_passthru_cmd cmd;
959 __u8 sts = 0, pif = 0;
960 bool_Bool pi_available;
961 __u32 dsmgmt = 0;
962 int mode = 0644;
963 void *buffer;
964 __u16 ms = 0;
965 int err = 0;
966 int flags;
967
968 const char *start_block_addr = "64-bit addr of first block to access";
969 const char *block_size = "if specified, logical block size in bytes;\n"
970 "discovered by identify namespace otherwise";
971 const char *data_size = "size of data in bytes";
972 const char *metadata_size = "size of metadata in bytes";
973 const char *data = "data file";
974 const char *metadata = "metadata file";
975 const char *limited_retry_num = "limit num. media access attempts";
976 const char *show = "show command before sending";
977 const char *dtype_for_write = "directive type (for write-only)";
978 const char *dspec = "directive specific (for write-only)";
979 const char *dsm = "dataset management attributes (lower 8 bits)";
980 const char *force = "The \"I know what I'm doing\" flag, do not enforce exclusive access for write";
981
982 struct config {
983 __u32 nsid;
984 __u64 start_block;
985 __u16 block_count;
986 __u16 block_size;
987 __u64 data_size;
988 __u64 metadata_size;
989 __u64 ilbrt;
990 char *data;
991 char *metadata;
992 __u8 prinfo;
993 __u16 lbatm;
994 __u16 lbat;
995 __u64 lbst;
996 bool_Bool limited_retry;
997 bool_Bool force_unit_access;
998 bool_Bool stc;
999 __u8 dtype;
1000 __u16 dspec;
1001 __u8 dsmgmt;
1002 bool_Bool show;
1003 bool_Bool latency;
1004 bool_Bool force;
1005 };
1006
1007 struct config cfg = {
1008 .nsid = 0,
1009 .start_block = 0,
1010 .block_count = 0,
1011 .block_size = 0,
1012 .data_size = 0,
1013 .metadata_size = 0,
1014 .ilbrt = 0,
1015 .data = "",
1016 .metadata = "",
1017 .prinfo = 0,
1018 .lbatm = 0,
1019 .lbat = 0,
1020 .lbst = 0,
1021 .limited_retry = false0,
1022 .force_unit_access = false0,
1023 .stc = false0,
1024 .dtype = 0,
1025 .dspec = 0,
1026 .dsmgmt = 0,
1027 .show = false0,
1028 .latency = false0,
1029 .force = false0,
1030 };
1031
1032 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1033 OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_id_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1034 OPT_SUFFIX("start-block", 's', &cfg.start_block, start_block_addr),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1035 OPT_SHRT("block-count", 'c', &cfg.block_count, block_count),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1036 OPT_SHRT("block-size", 'b', &cfg.block_size, block_size),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1037 OPT_SUFFIX("data-size", 'z', &cfg.data_size, data_size),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1038 OPT_SUFFIX("metadata-size", 'y', &cfg.metadata_size, metadata_size),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1039 OPT_SUFFIX("ref-tag", 'r', &cfg.ilbrt, ref_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1040 OPT_FILE("data", 'd', &cfg.data, data),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1041 OPT_FILE("metadata", 'M', &cfg.metadata, metadata),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1042 OPT_BYTE("prinfo", 'p', &cfg.prinfo, prinfo),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1043 OPT_SHRT("app-tag-mask", 'm', &cfg.lbatm, app_tag_mask),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1044 OPT_SHRT("app-tag", 'a', &cfg.lbat, app_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1045 OPT_SUFFIX("storage-tag", 'g', &cfg.lbst, storage_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1046 OPT_FLAG("limited-retry", 'l', &cfg.limited_retry, limited_retry_num),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1047 OPT_FLAG("force-unit-access", 'f', &cfg.force_unit_access, force_unit_access),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1048 OPT_FLAG("storage-tag-check", 'C', &cfg.stc, storage_tag_check),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1049 OPT_BYTE("dir-type", 'T', &cfg.dtype, dtype_for_write),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1050 OPT_SHRT("dir-spec", 'S', &cfg.dspec, dspec),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1051 OPT_BYTE("dsm", 'D', &cfg.dsmgmt, dsm),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1052 OPT_FLAG("show-command", 'V', &cfg.show, show),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1053 OPT_FLAG("latency", 't', &cfg.latency, latency),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1054 OPT_FLAG("force", 0, &cfg.force, force))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_id_desired, 0, }, {"start-block", 's', "IONUM"
, CFG_LONG_SUFFIX, &cfg.start_block, 1, start_block_addr,
0, }, {"block-count", 'c', "NUM", CFG_SHORT, &cfg.block_count
, 1, block_count, 0, }, {"block-size", 'b', "NUM", CFG_SHORT,
&cfg.block_size, 1, block_size, 0, }, {"data-size", 'z',
"IONUM", CFG_LONG_SUFFIX, &cfg.data_size, 1, data_size, 0
, }, {"metadata-size", 'y', "IONUM", CFG_LONG_SUFFIX, &cfg
.metadata_size, 1, metadata_size, 0, }, {"ref-tag", 'r', "IONUM"
, CFG_LONG_SUFFIX, &cfg.ilbrt, 1, ref_tag, 0, }, {"data",
'd', "FILE", CFG_STRING, &cfg.data, 1, data, 0, }, {"metadata"
, 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0,
}, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT, &cfg.lbatm
, 1, app_tag_mask, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &
cfg.lbat, 1, app_tag, 0, }, {"storage-tag", 'g', "IONUM", CFG_LONG_SUFFIX
, &cfg.lbst, 1, storage_tag, 0, }, {"limited-retry", 'l',
((void*)0), CFG_FLAG, &cfg.limited_retry, 0, limited_retry_num
, 0, }, {"force-unit-access", 'f', ((void*)0), CFG_FLAG, &
cfg.force_unit_access, 0, force_unit_access, 0, }, {"storage-tag-check"
, 'C', ((void*)0), CFG_FLAG, &cfg.stc, 0, storage_tag_check
, 0, }, {"dir-type", 'T', "NUM", CFG_BYTE, &cfg.dtype, 1,
dtype_for_write, 0, }, {"dir-spec", 'S', "NUM", CFG_SHORT, &
cfg.dspec, 1, dspec, 0, }, {"dsm", 'D', "NUM", CFG_BYTE, &
cfg.dsmgmt, 1, dsm, 0, }, {"show-command", 'V', ((void*)0), CFG_FLAG
, &cfg.show, 0, show, 0, }, {"latency", 't', ((void*)0), CFG_FLAG
, &cfg.latency, 0, latency, 0, }, {"force", 0, ((void*)0)
, CFG_FLAG, &cfg.force, 0, force, 0, }, {"", 0, ((void*)0
), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options", 0, (
(void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &nvme_args
.verbose, 0, "Increase output verbosity", 0, }, {"quiet", 0, (
(void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
1055
1056 if (opcode
1.1
'opcode' is not equal to nvme_cmd_write
!= nvme_cmd_write) {
2
Taking true branch
1057 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
1058 if (err)
3
Assuming 'err' is 0
4
Taking false branch
1059 return err;
1060 } else {
1061 err = parse_args(argc, argv, desc, opts);
1062 if (err)
1063 return err;
1064 err = open_exclusive(&ctx, &hdl, argc, argv, cfg.force, opts);
1065 if (err) {
1066 if (err == -EBUSY16) {
1067 nvme_show_error("Failed to open %s.", basename(argv[optind]))nvme_show_message(1, "Failed to open %s.", __xpg_basename(argv
[optind]))
;
1068 nvme_show_error("Namespace is currently busy.")nvme_show_message(1, "Namespace is currently busy.");
1069 if (!cfg.force)
1070 nvme_show_error(nvme_show_message(1, "Use the force [--force] option to ignore that."
)
1071 "Use the force [--force] option to ignore that.")nvme_show_message(1, "Use the force [--force] option to ignore that."
)
;
1072 } else {
1073 argconfig_print_help(desc, opts);
1074 }
1075 return err;
1076 }
1077 }
1078
1079 if (!cfg.nsid) {
5
Assuming field 'nsid' is not equal to 0
6
Taking false branch
1080 err = libnvme_get_nsid(hdl, &cfg.nsid);
1081 if (err < 0) {
1082 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
1083 return err;
1084 }
1085 }
1086
1087 if (cfg.prinfo > 0xf)
7
Assuming field 'prinfo' is <= 15
8
Taking false branch
1088 return -EINVAL22;
1089
1090 dsmgmt = cfg.dsmgmt;
1091 control |= (cfg.prinfo << 10);
1092 if (cfg.limited_retry)
9
Assuming field 'limited_retry' is false
10
Taking false branch
1093 control |= NVME_IO_LR;
1094 if (cfg.force_unit_access)
11
Assuming field 'force_unit_access' is false
12
Taking false branch
1095 control |= NVME_IO_FUA;
1096 if (cfg.stc)
13
Assuming field 'stc' is false
14
Taking false branch
1097 control |= NVME_IO_STC;
1098 if (cfg.dtype) {
15
Assuming field 'dtype' is 0
16
Taking false branch
1099 if (cfg.dtype > 0xf) {
1100 nvme_show_error("Invalid directive type, %x", cfg.dtype)nvme_show_message(1, "Invalid directive type, %x", cfg.dtype);
1101 return -EINVAL22;
1102 }
1103 control |= cfg.dtype << 4;
1104 dsmgmt |= ((__u32)cfg.dspec) << 16;
1105 }
1106
1107 if (opcode & 1) {
17
Taking true branch
1108 dfd = mfd = STDIN_FILENO0;
1109 flags = O_RDONLY00;
1110 } else {
1111 dfd = mfd = STDOUT_FILENO1;
1112 flags = O_WRONLY01 | O_CREAT0100 | O_TRUNC01000;
1113 }
1114
1115 if (strlen(cfg.data)) {
18
Assuming the condition is false
19
Taking false branch
1116 dfd = shr_open_rawdata(cfg.data, flags, mode)open((cfg.data), (flags), mode);
1117 if (dfd < 0) {
1118 nvme_show_perror(cfg.data);
1119 return -EINVAL22;
1120 }
1121 }
1122
1123 if (strlen(cfg.metadata)) {
20
Assuming the condition is false
21
Taking false branch
1124 mfd = shr_open_rawdata(cfg.metadata, flags, mode)open((cfg.metadata), (flags), mode);
1125 if (mfd < 0) {
1126 nvme_show_perror(cfg.metadata);
1127 return -EINVAL22;
1128 }
1129 }
1130
1131 if (!cfg.data_size) {
22
Assuming field 'data_size' is not equal to 0
23
Taking false branch
1132 nvme_show_error("data size not provided")nvme_show_message(1, "data size not provided");
1133 return -EINVAL22;
1134 }
1135
1136 if (cfg.block_size) {
24
Assuming field 'block_size' is not equal to 0
25
Taking true branch
1137 logical_block_size = cfg.block_size;
1138 ms = cfg.metadata_size;
1139 pi_available = true1;
1140 } else {
1141 err = get_pi_info(hdl, cfg.nsid, cfg.prinfo,
1142 cfg.ilbrt, cfg.lbst, &logical_block_size, &ms);
1143 switch (err) {
1144 case 0:
1145 pi_available = true1;
1146 break;
1147 case -ENOMEM12:
1148 /* Could not even allocate the Identify buffer. */
1149 case -ECLI_IDENTIFY_NS_FAILED:
1150 /* Base Identify Namespace failed: no logical block size. */
1151 case -ECLI_INVALID_TAGS:
1152 /* Reference/storage tag is invalid for this PI format. */
1153 case -ECLI_INVALID_PI_FORMAT:
1154 /* Namespace's reported PI format is self-inconsistent. */
1155 return err;
1156 default:
1157 /* Identify NVM CS NS failed/unsupported: PI unavailable. */
1158 nvme_show_err(err, "identify NVM CS NS: continuing without protection information");
1159 pi_available = false0;
1160 break;
1161 }
1162 }
1163
1164 buffer_size = ((long long)cfg.block_count + 1) * logical_block_size;
1165 if (cfg.data_size < buffer_size)
26
Assuming 'buffer_size' is <= field 'data_size'
27
Taking false branch
1166 nvme_show_error("Rounding data size to fit block count (%lld bytes)", buffer_size)nvme_show_message(1, "Rounding data size to fit block count (%lld bytes)"
, buffer_size)
;
1167 else
1168 buffer_size = cfg.data_size;
1169
1170 if (argconfig_parse_seen(opts, "block-count")) {
28
Assuming the condition is true
29
Taking true branch
1171 /* Use the value provided */
1172 nblocks = cfg.block_count;
1173 } else {
1174 /* Get the required block count. Note this is a zeroes based value. */
1175 nblocks = ((buffer_size + (logical_block_size - 1)) / logical_block_size) - 1;
1176
1177 /* Update the data size based on the required block count */
1178 buffer_size = ((unsigned long long)nblocks + 1) * logical_block_size;
1179 }
1180
1181 buffer = libnvme_alloc_huge(buffer_size, &mh);
1182 if (!buffer) {
30
Assuming 'buffer' is non-null
31
Taking false branch
1183 nvme_show_error("failed to allocate huge memory")nvme_show_message(1, "failed to allocate huge memory");
1184 return -ENOMEM12;
1185 }
1186
1187 if (cfg.metadata_size) {
32
Assuming field 'metadata_size' is not equal to 0
33
Taking true branch
1188 mbuffer_size = ((unsigned long long)cfg.block_count + 1) * ms;
1189 if (ms
33.1
'ms' is not equal to 0
&& cfg.metadata_size < mbuffer_size)
34
Assuming 'mbuffer_size' is > field 'metadata_size'
35
Taking true branch
1190 nvme_show_error("Rounding metadata size to fit block count (%lld bytes)",nvme_show_message(1, "Rounding metadata size to fit block count (%lld bytes)"
, mbuffer_size)
1191 mbuffer_size)nvme_show_message(1, "Rounding metadata size to fit block count (%lld bytes)"
, mbuffer_size)
;
1192 else
1193 mbuffer_size = cfg.metadata_size;
1194
1195 mbuffer = malloc(mbuffer_size);
36
Memory is allocated
1196 if (!mbuffer)
37
Assuming 'mbuffer' is non-null
38
Taking false branch
1197 return -ENOMEM12;
1198 memset(mbuffer, 0, mbuffer_size);
1199 }
1200
1201 if (opcode & 1) {
39
Taking true branch
1202 err = read(dfd, (void *)buffer, cfg.data_size);
1203 if (err < 0) {
40
Assuming 'err' is < 0
41
Taking true branch
1204 err = -errno(*__errno_location ());
42
Potential leak of memory pointed to by 'mbuffer'
1205 nvme_show_error("failed to read data buffer from input file %s", libnvme_strerror(errno))nvme_show_message(1, "failed to read data buffer from input file %s"
, libnvme_strerror((*__errno_location ())))
;
1206 return err;
1207 }
1208 }
1209
1210 if ((opcode & 1) && cfg.metadata_size) {
1211 err = read(mfd, (void *)mbuffer, mbuffer_size);
1212 if (err < 0) {
1213 err = -errno(*__errno_location ());
1214 nvme_show_error("failed to read meta-data buffer from input file %s", libnvme_strerror(errno))nvme_show_message(1, "failed to read meta-data buffer from input file %s"
, libnvme_strerror((*__errno_location ())))
;
1215 return err;
1216 }
1217 }
1218
1219 if (cfg.show || nvme_args.dry_run) {
1220 nvme_show_result("opcode : %02x", opcode)nvme_show_message(0, "opcode : %02x", opcode);
1221 nvme_show_result("nsid : %02x", cfg.nsid)nvme_show_message(0, "nsid : %02x", cfg.nsid);
1222 nvme_show_result("flags : %02x", 0)nvme_show_message(0, "flags : %02x", 0);
1223 nvme_show_result("control : %04x", control)nvme_show_message(0, "control : %04x", control);
1224 nvme_show_result("nblocks : %04x", nblocks)nvme_show_message(0, "nblocks : %04x", nblocks);
1225 nvme_show_result("metadata : %"PRIx64, (uint64_t)(uintptr_t)mbuffer)nvme_show_message(0, "metadata : %""l" "x", (uint64_t)(uintptr_t
)mbuffer)
;
1226 nvme_show_result("addr : %"PRIx64, (uint64_t)(uintptr_t)buffer)nvme_show_message(0, "addr : %""l" "x", (uint64_t)(uintptr_t
)buffer)
;
1227 nvme_show_result("slba : %"PRIx64, (uint64_t)cfg.start_block)nvme_show_message(0, "slba : %""l" "x", (uint64_t)cfg
.start_block)
;
1228 nvme_show_result("dsmgmt : %08x", dsmgmt)nvme_show_message(0, "dsmgmt : %08x", dsmgmt);
1229 nvme_show_result("reftag : %"PRIx64, (uint64_t)cfg.ilbrt)nvme_show_message(0, "reftag : %""l" "x", (uint64_t)cfg
.ilbrt)
;
1230 nvme_show_result("apptag : %04x", cfg.lbat)nvme_show_message(0, "apptag : %04x", cfg.lbat);
1231 nvme_show_result("appmask : %04x", cfg.lbatm)nvme_show_message(0, "appmask : %04x", cfg.lbatm);
1232 nvme_show_result("storagetagcheck : %04x", cfg.stc)nvme_show_message(0, "storagetagcheck : %04x", cfg.stc);
1233 nvme_show_result("storagetag : %"PRIx64, (uint64_t)cfg.lbst)nvme_show_message(0, "storagetag : %""l" "x", (uint64_t)
cfg.lbst)
;
1234 nvme_show_result("pif : %02x", pif)nvme_show_message(0, "pif : %02x", pif);
1235 nvme_show_result("sts : %02x", sts)nvme_show_message(0, "sts : %02x", sts);
1236 }
1237 if (nvme_args.dry_run)
1238 return 0;
1239
1240 nvme_init_io(&cmd, opcode, cfg.nsid, cfg.start_block, buffer,
1241 buffer_size, mbuffer, mbuffer_size);
1242 cmd.cdw12 = NVME_FIELD_ENCODE(nblocks,(((__u32)(nblocks) & (NVME_IOCS_COMMON_CDW12_NLB_MASK)) <<
(NVME_IOCS_COMMON_CDW12_NLB_SHIFT))
1243 NVME_IOCS_COMMON_CDW12_NLB_SHIFT,(((__u32)(nblocks) & (NVME_IOCS_COMMON_CDW12_NLB_MASK)) <<
(NVME_IOCS_COMMON_CDW12_NLB_SHIFT))
1244 NVME_IOCS_COMMON_CDW12_NLB_MASK)(((__u32)(nblocks) & (NVME_IOCS_COMMON_CDW12_NLB_MASK)) <<
(NVME_IOCS_COMMON_CDW12_NLB_SHIFT))
|
1245 NVME_FIELD_ENCODE(control,(((__u32)(control) & (NVME_IOCS_COMMON_CDW12_CONTROL_MASK
)) << (NVME_IOCS_COMMON_CDW12_CONTROL_SHIFT))
1246 NVME_IOCS_COMMON_CDW12_CONTROL_SHIFT,(((__u32)(control) & (NVME_IOCS_COMMON_CDW12_CONTROL_MASK
)) << (NVME_IOCS_COMMON_CDW12_CONTROL_SHIFT))
1247 NVME_IOCS_COMMON_CDW12_CONTROL_MASK)(((__u32)(control) & (NVME_IOCS_COMMON_CDW12_CONTROL_MASK
)) << (NVME_IOCS_COMMON_CDW12_CONTROL_SHIFT))
;
1248 cmd.cdw13 = NVME_FIELD_ENCODE(cfg.dspec,(((__u32)(cfg.dspec) & (NVME_IOCS_COMMON_CDW13_DSPEC_MASK
)) << (NVME_IOCS_COMMON_CDW13_DSPEC_SHIFT))
1249 NVME_IOCS_COMMON_CDW13_DSPEC_SHIFT,(((__u32)(cfg.dspec) & (NVME_IOCS_COMMON_CDW13_DSPEC_MASK
)) << (NVME_IOCS_COMMON_CDW13_DSPEC_SHIFT))
1250 NVME_IOCS_COMMON_CDW13_DSPEC_MASK)(((__u32)(cfg.dspec) & (NVME_IOCS_COMMON_CDW13_DSPEC_MASK
)) << (NVME_IOCS_COMMON_CDW13_DSPEC_SHIFT))
|
1251 NVME_FIELD_ENCODE(cfg.dsmgmt,(((__u32)(cfg.dsmgmt) & (NVME_IOCS_COMMON_CDW13_DSM_MASK)
) << (NVME_IOCS_COMMON_CDW13_DSM_SHIFT))
1252 NVME_IOCS_COMMON_CDW13_DSM_SHIFT,(((__u32)(cfg.dsmgmt) & (NVME_IOCS_COMMON_CDW13_DSM_MASK)
) << (NVME_IOCS_COMMON_CDW13_DSM_SHIFT))
1253 NVME_IOCS_COMMON_CDW13_DSM_MASK)(((__u32)(cfg.dsmgmt) & (NVME_IOCS_COMMON_CDW13_DSM_MASK)
) << (NVME_IOCS_COMMON_CDW13_DSM_SHIFT))
;
1254 if (pi_available) {
1255 err = init_pi_tags(hdl, &cmd, cfg.nsid, cfg.ilbrt, cfg.lbst,
1256 cfg.lbat, cfg.lbatm);
1257 if (err)
1258 return err;
1259 }
1260 gettimeofday(&start_time, NULL((void*)0));
1261 err = libnvme_exec_io_passthru(hdl, &cmd);
1262 gettimeofday(&end_time, NULL((void*)0));
1263 if (cfg.latency)
1264 nvme_show_result(" latency: %s: %llu us", command, shr_elapsed_utime(start_time, end_time))nvme_show_message(0, " latency: %s: %llu us", command, shr_elapsed_utime
(start_time, end_time))
;
1265 if (err) {
1266 nvme_show_err(err, "submit-io");
1267 return err;
1268 }
1269
1270 if (!(opcode & 1) && write(dfd, (void *)buffer, buffer_size) < 0) {
1271 nvme_show_error(nvme_show_message(1, "write: %s: failed to write buffer to output file"
, libnvme_strerror((*__errno_location ())))
1272 "write: %s: failed to write buffer to output file",nvme_show_message(1, "write: %s: failed to write buffer to output file"
, libnvme_strerror((*__errno_location ())))
1273 libnvme_strerror(errno))nvme_show_message(1, "write: %s: failed to write buffer to output file"
, libnvme_strerror((*__errno_location ())))
;
1274 err = -EINVAL22;
1275 } else if (!(opcode & 1) && cfg.metadata_size &&
1276 write(mfd, (void *)mbuffer, mbuffer_size) < 0) {
1277 nvme_show_error(nvme_show_message(1, "write: %s: failed to write meta-data buffer to output file"
, libnvme_strerror((*__errno_location ())))
1278 "write: %s: failed to write meta-data buffer to output file",nvme_show_message(1, "write: %s: failed to write meta-data buffer to output file"
, libnvme_strerror((*__errno_location ())))
1279 libnvme_strerror(errno))nvme_show_message(1, "write: %s: failed to write meta-data buffer to output file"
, libnvme_strerror((*__errno_location ())))
;
1280 err = -EINVAL22;
1281 } else {
1282 nvme_show_verbose_result("%s: Success", command)nvme_show_verbose_message("%s: Success", command);
1283 }
1284
1285 return err;
1286}
1287
1288static int compare(int argc, char **argv, struct command *acmd, struct plugin *plugin)
1289{
1290 const char *desc = "Compare specified logical blocks on\n"
1291 "device with specified data buffer; return failure if buffer\n"
1292 "and block(s) are dissimilar";
1293
1294 return submit_io(nvme_cmd_compare, "compare", desc, argc, argv);
1
Calling 'submit_io'
1295}
1296
1297static int read_cmd(int argc, char **argv, struct command *acmd, struct plugin *plugin)
1298{
1299 const char *desc = "Copy specified logical blocks on the given\n"
1300 "device to specified data buffer (default buffer is stdout).";
1301
1302 return submit_io(nvme_cmd_read, "read", desc, argc, argv);
1303}
1304
1305static int write_cmd(int argc, char **argv, struct command *acmd, struct plugin *plugin)
1306{
1307 const char *desc = "Copy from provided data buffer (default\n"
1308 "buffer is stdin) to specified logical blocks on the given device.";
1309
1310 return submit_io(nvme_cmd_write, "write", desc, argc, argv);
1311}
1312
1313static int verify_cmd(int argc, char **argv, struct command *acmd, struct plugin *plugin)
1314{
1315 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
1316 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
1317 struct libnvme_passthru_cmd cmd;
1318 __u16 control = 0;
1319 int err;
1320
1321 const char *desc = "Verify specified logical blocks on the given device.";
1322 const char *force_unit_access_verify =
1323 "force device to commit cached data before performing the verify operation";
1324 const char *storage_tag_check =
1325 "This bit specifies the Storage Tag field shall be checked as part of Verify operation";
1326
1327 struct config {
1328 __u32 nsid;
1329 __u64 start_block;
1330 __u16 block_count;
1331 bool_Bool limited_retry;
1332 bool_Bool force_unit_access;
1333 __u8 prinfo;
1334 __u64 ilbrt;
1335 __u16 lbat;
1336 __u16 lbatm;
1337 __u64 lbst;
1338 bool_Bool stc;
1339 };
1340
1341 struct config cfg = {
1342 .nsid = 0,
1343 .start_block = 0,
1344 .block_count = 0,
1345 .limited_retry = false0,
1346 .force_unit_access = false0,
1347 .prinfo = 0,
1348 .ilbrt = 0,
1349 .lbat = 0,
1350 .lbatm = 0,
1351 .lbst = 0,
1352 .stc = false0,
1353 };
1354
1355 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1356 OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1357 OPT_SUFFIX("start-block", 's', &cfg.start_block, start_block),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1358 OPT_SHRT("block-count", 'c', &cfg.block_count, block_count),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1359 OPT_FLAG("limited-retry", 'l', &cfg.limited_retry, limited_retry),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1360 OPT_FLAG("force-unit-access", 'f', &cfg.force_unit_access, force_unit_access_verify),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1361 OPT_BYTE("prinfo", 'p', &cfg.prinfo, prinfo),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1362 OPT_SUFFIX("ref-tag", 'r', &cfg.ilbrt, ref_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1363 OPT_SHRT("app-tag", 'a', &cfg.lbat, app_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1364 OPT_SHRT("app-tag-mask", 'm', &cfg.lbatm, app_tag_mask),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1365 OPT_SUFFIX("storage-tag", 'S', &cfg.lbst, storage_tag),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1366 OPT_FLAG("storage-tag-check", 'C', &cfg.stc, storage_tag_check))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.nsid
, 1, namespace_desired, 0, }, {"start-block", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.start_block, 1, start_block, 0, }, {"block-count",
'c', "NUM", CFG_SHORT, &cfg.block_count, 1, block_count,
0, }, {"limited-retry", 'l', ((void*)0), CFG_FLAG, &cfg.
limited_retry, 0, limited_retry, 0, }, {"force-unit-access", 'f'
, ((void*)0), CFG_FLAG, &cfg.force_unit_access, 0, force_unit_access_verify
, 0, }, {"prinfo", 'p', "NUM", CFG_BYTE, &cfg.prinfo, 1, prinfo
, 0, }, {"ref-tag", 'r', "IONUM", CFG_LONG_SUFFIX, &cfg.ilbrt
, 1, ref_tag, 0, }, {"app-tag", 'a', "NUM", CFG_SHORT, &cfg
.lbat, 1, app_tag, 0, }, {"app-tag-mask", 'm', "NUM", CFG_SHORT
, &cfg.lbatm, 1, app_tag_mask, 0, }, {"storage-tag", 'S',
"IONUM", CFG_LONG_SUFFIX, &cfg.lbst, 1, storage_tag, 0, }
, {"storage-tag-check", 'C', ((void*)0), CFG_FLAG, &cfg.stc
, 0, storage_tag_check, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
1367
1368 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
1369 if (err)
1370 return err;
1371
1372 err = open_fallback_chardev(ctx, cfg.nsid, &hdl);
1373 if (err)
1374 return err;
1375
1376 if (cfg.prinfo > 0xf)
1377 return -EINVAL22;
1378
1379 control |= (cfg.prinfo << 10);
1380 if (cfg.limited_retry)
1381 control |= NVME_IO_LR;
1382 if (cfg.force_unit_access)
1383 control |= NVME_IO_FUA;
1384 if (cfg.stc)
1385 control |= NVME_IO_STC;
1386
1387 if (!cfg.nsid) {
1388 err = libnvme_get_nsid(hdl, &cfg.nsid);
1389 if (err < 0) {
1390 nvme_show_error("get-namespace-id: %s", libnvme_strerror(-err))nvme_show_message(1, "get-namespace-id: %s", libnvme_strerror
(-err))
;
1391 return err;
1392 }
1393 }
1394
1395 nvme_init_verify(&cmd, cfg.nsid, cfg.start_block,
1396 cfg.block_count, control, 0, NULL((void*)0), 0, NULL((void*)0), 0);
1397 err = init_pi_tags(hdl, &cmd, cfg.nsid, cfg.ilbrt, cfg.lbst,
1398 cfg.lbat, cfg.lbatm);
1399 if (err)
1400 return err;
1401 err = libnvme_exec_io_passthru(hdl, &cmd);
1402 if (err) {
1403 nvme_show_err(err, "verify");
1404 return err;
1405 }
1406
1407 nvme_show_verbose_result("NVME Verify Success")nvme_show_verbose_message("NVME Verify Success");
1408
1409 return err;
1410}
1411
1412static int get_lba_status(int argc, char **argv, struct command *acmd,
1413 struct plugin *plugin)
1414{
1415 const char *desc = "Information about potentially unrecoverable LBAs.";
1416 const char *slba =
1417 "Starting LBA(SLBA) in 64-bit address of the first logical block addressed by this command";
1418 const char *mndw =
1419 "Maximum Number of Dwords(MNDW) specifies maximum number of dwords to return";
1420 const char *atype = "Action Type(ATYPE) specifies the mechanism\n"
1421 "the controller uses in determining the LBA Status Descriptors to return.";
1422 const char *rl =
1423 "Range Length(RL) specifies the length of the range of contiguous LBAs beginning at SLBA";
1424
1425 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
1426 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
1427 struct libnvme_passthru_cmd cmd;
1428 __cleanup_libnvme_free__attribute__((cleanup(libnvme_freep))) void *buf = NULL((void*)0);
1429 nvme_print_flags_t flags;
1430 unsigned long buf_len;
1431 int err;
1432
1433 struct config {
1434 bool_Bool ish;
1435 __u32 namespace_id;
1436 __u64 slba;
1437 __u32 mndw;
1438 __u8 atype;
1439 __u16 rl;
1440 };
1441
1442 struct config cfg = {
1443 .ish = false0,
1444 .namespace_id = 0,
1445 .slba = 0,
1446 .mndw = 0,
1447 .atype = 0,
1448 .rl = 0,
1449 };
1450
1451 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1452 OPT_FLAG("ish", 'I', &cfg.ish, ish),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1453 OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1454 OPT_SUFFIX("start-lba", 's', &cfg.slba, slba),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1455 OPT_UINT("max-dw", 'm', &cfg.mndw, mndw),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1456 OPT_BYTE("action", 'a', &cfg.atype, atype),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1457 OPT_SHRT("range-len", 'l', &cfg.rl, rl))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, &cfg.namespace_id
, 1, namespace_desired, 0, }, {"start-lba", 's', "IONUM", CFG_LONG_SUFFIX
, &cfg.slba, 1, slba, 0, }, {"max-dw", 'm', "NUM", CFG_POSITIVE
, &cfg.mndw, 1, mndw, 0, }, {"action", 'a', "NUM", CFG_BYTE
, &cfg.atype, 1, atype, 0, }, {"range-len", 'l', "NUM", CFG_SHORT
, &cfg.rl, 1, rl, 0, }, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR
, ((void*)0), 0, "Global options", 0, ((void*)0)}, {"verbose"
, 'v', "NUM", CFG_INCREMENT, &nvme_args.verbose, 0, "Increase output verbosity"
, 0, }, {"quiet", 0, ((void*)0), CFG_FLAG, &nvme_args.quiet
, 0, "suppress informational output", 0, }, {"output-format",
'o', "FMT", CFG_STRING, &nvme_args.output_format, 1, "Output format: normal|json|binary"
, 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout
, 1, "timeout value, in milliseconds", 0, }, {"dry-run", 0, (
(void*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
1458
1459 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
1460 if (err)
1461 return err;
1462
1463 err = validate_output_format(nvme_args.output_format, &flags);
1464 if (err < 0) {
1465 nvme_show_error("Invalid output format")nvme_show_message(1, "Invalid output format");
1466 return err;
1467 }
1468
1469 if (!cfg.atype) {
1470 nvme_show_error("action type (--action) has to be given")nvme_show_message(1, "action type (--action) has to be given"
)
;
1471 return -EINVAL22;
1472 }
1473
1474 buf_len = (cfg.mndw + 1) * 4;
1475 buf = libnvme_alloc(buf_len);
1476 if (!buf)
1477 return -ENOMEM12;
1478
1479 nvme_init_get_lba_status(&cmd, cfg.namespace_id, cfg.slba, cfg.mndw,
1480 cfg.atype, cfg.rl, buf);
1481 if (cfg.ish) {
1482 if (libnvme_transport_handle_is_mi(hdl))
1483 nvme_init_mi_cmd_flags(&cmd, ish);
1484 else
1485 nvme_show_error("ISH is supported only for NVMe-MI")nvme_show_message(1, "ISH is supported only for NVMe-MI");
1486 }
1487 err = libnvme_exec_admin_passthru(hdl, &cmd);
1488 if (err) {
1489 nvme_show_err(err, "get lba status");
1490 return err;
1491 }
1492
1493 nvme_show_lba_status(buf, buf_len, flags);
1494
1495 return err;
1496}
1497
1498static int capacity_mgmt(int argc, char **argv, struct command *acmd, struct plugin *plugin)
1499{
1500 const char *desc = "Host software uses the Capacity Management command to\n"
1501 "configure Endurance Groups and NVM Sets in an NVM subsystem by either\n"
1502 "selecting one of a set of supported configurations or by specifying the\n"
1503 "capacity of the Endurance Group or NVM Set to be created";
1504 const char *operation = "Operation to be performed by the controller";
1505 const char *element_id = "Value specific to the value of the Operation field.";
1506 const char *cap_lower =
1507 "Least significant 32 bits of the capacity in bytes of the Endurance Group or NVM Set to be created";
1508 const char *cap_upper =
1509 "Most significant 32 bits of the capacity in bytes of the Endurance Group or NVM Set to be created";
1510
1511 __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0);
1512 __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0);
1513 struct libnvme_passthru_cmd cmd;
1514 int err = -1;
1515 nvme_print_flags_t flags;
1516
1517 struct config {
1518 bool_Bool ish;
1519 __u8 operation;
1520 __u16 element_id;
1521 __u32 dw11;
1522 __u32 dw12;
1523 };
1524
1525 struct config cfg = {
1526 .ish = false0,
1527 .operation = 0xff,
1528 .element_id = 0xffff,
1529 .dw11 = 0,
1530 .dw12 = 0,
1531 };
1532
1533 NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1534 OPT_FLAG("ish", 'I', &cfg.ish, ish),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1535 OPT_BYTE("operation", 'O', &cfg.operation, operation),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1536 OPT_SHRT("element-id", 'i', &cfg.element_id, element_id),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1537 OPT_UINT("cap-lower", 'l', &cfg.dw11, cap_lower),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
1538 OPT_UINT("cap-upper", 'u', &cfg.dw12, cap_upper))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY)
; struct argconfig_commandline_options opts[] = { {"", 0, ((void
*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void
*)0)}, {"ish", 'I', ((void*)0), CFG_FLAG, &cfg.ish, 0, ish
, 0, }, {"operation", 'O', "NUM", CFG_BYTE, &cfg.operation
, 1, operation, 0, }, {"element-id", 'i', "NUM", CFG_SHORT, &
cfg.element_id, 1, element_id, 0, }, {"cap-lower", 'l', "NUM"
, CFG_POSITIVE, &cfg.dw11, 1, cap_lower, 0, }, {"cap-upper"
, 'u', "NUM", CFG_POSITIVE, &cfg.dw12, 1, cap_upper, 0, }
, {"", 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options"
, 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, &
nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet"
, 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output"
, 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args
.output_format, 1, "Output format: normal|json|binary", 0, },
{"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1
, "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void
*)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing"
, 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args
.no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing"
, 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0
, "disable 64-bit IOCTL support probing", 0, }, {"output-format-version"
, 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1
, "output format version: 1|2", 0, }, {"human-readable", 'H',
((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0),
0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING
, &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);"
, 0, }, { ((void*)0) } }
;
1539
1540 err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
1541 if (err)
1542 return err;
1543
1544 err = validate_output_format(nvme_args.output_format, &flags);
1545 if (err < 0) {
1546 nvme_show_error("Invalid output format")nvme_show_message(1, "Invalid output format");
1547 return err;
1548 }
1549
1550 if (cfg.operation > 0xf) {
1551 nvme_show_error("invalid operation field: %u", cfg.operation)nvme_show_message(1, "invalid operation field: %u", cfg.operation
)
;
1552 return -1;
1553 }
1554
1555 nvme_init_capacity_mgmt(&cmd, cfg.operation, cfg.element_id,
1556 (__u64)cfg.dw12 << 32 | cfg.dw11);
1557 if (cfg.ish) {
1558 if (libnvme_transport_handle_is_mi(hdl))
1559 nvme_init_mi_cmd_flags(&cmd, ish);
1560 else
1561 nvme_show_error("ISH is supported only for NVMe-MI")nvme_show_message(1, "ISH is supported only for NVMe-MI");
1562 }
1563 err = libnvme_exec_admin_passthru(hdl, &cmd);
1564 if (err) {
1565 nvme_show_err(err, "capacity management");
1566 return err;
1567 }
1568
1569 nvme_show_verbose_result("Capacity Management Command is Success")nvme_show_verbose_message("Capacity Management Command is Success"
)
;
1570
1571 if (cfg.operation == 1)
1572 nvme_show_result("Created Element Identifier for Endurance Group is: %"nvme_show_message(0, "Created Element Identifier for Endurance Group is: %"
"l" "u", (uint64_t)cmd.result)
1573 PRIu64, (uint64_t)cmd.result)nvme_show_message(0, "Created Element Identifier for Endurance Group is: %"
"l" "u", (uint64_t)cmd.result)
;
1574 else if (cfg.operation == 3)
1575 nvme_show_result("Created Element Identifier for NVM Set is: %"nvme_show_message(0, "Created Element Identifier for NVM Set is: %"
"l" "u", (uint64_t)cmd.result)
1576 PRIu64, (uint64_t)cmd.result)nvme_show_message(0, "Created Element Identifier for NVM Set is: %"
"l" "u", (uint64_t)cmd.result)
;
1577
1578 return err;
1579}
1580
1581static struct command dsm_cmd = {
1582 .name = "dsm",
1583 .help = "Submit a Data Set Management command, return results",
1584 .fn = dsm,
1585};
1586
1587static struct command copy_cmd_cmd = {
1588 .name = "copy",
1589 .help = "Submit a Simple Copy command, return results",
1590 .fn = copy_cmd,
1591};
1592
1593static struct command flush_cmd_cmd = {
1594 .name = "flush",
1595 .help = "Submit a Flush command, return results",
1596 .fn = flush_cmd,
1597};
1598
1599static struct command compare_cmd = {
1600 .name = "compare",
1601 .help = "Submit a Compare command, return results",
1602 .fn = compare,
1603};
1604
1605static struct command read_cmd_cmd = {
1606 .name = "read",
1607 .help = "Submit a read command, return results",
1608 .fn = read_cmd,
1609};
1610
1611static struct command write_cmd_cmd = {
1612 .name = "write",
1613 .help = "Submit a write command, return results",
1614 .fn = write_cmd,
1615};
1616
1617static struct command write_zeroes_cmd = {
1618 .name = "write-zeroes",
1619 .help = "Submit a write zeroes command, return results",
1620 .fn = write_zeroes,
1621};
1622
1623static struct command write_uncor_cmd = {
1624 .name = "write-uncor",
1625 .help = "Submit a write uncorrectable command, return results",
1626 .fn = write_uncor,
1627};
1628
1629static struct command verify_cmd_cmd = {
1630 .name = "verify",
1631 .help = "Submit a verify command, return results",
1632 .fn = verify_cmd,
1633};
1634
1635static struct command get_lba_status_cmd = {
1636 .name = "get-lba-status",
1637 .help = "Submit a Get LBA Status command, return results",
1638 .fn = get_lba_status,
1639};
1640
1641static struct command capacity_mgmt_cmd = {
1642 .name = "capacity-mgmt",
1643 .help = "Submit Capacity Management Command, return results",
1644 .fn = capacity_mgmt,
1645};
1646
1647static struct command *commands[] = {
1648 &dsm_cmd,
1649 &copy_cmd_cmd,
1650 &flush_cmd_cmd,
1651 &compare_cmd,
1652 &read_cmd_cmd,
1653 &write_cmd_cmd,
1654 &write_zeroes_cmd,
1655 &write_uncor_cmd,
1656 &verify_cmd_cmd,
1657 &get_lba_status_cmd,
1658 &capacity_mgmt_cmd,
1659 NULL((void*)0),
1660};
1661
1662static void __shr_constructor__attribute__((constructor)) register_group(void)
1663{
1664 plugin_add_group(&builtin, "I/O Commands", commands);
1665}