Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ tests/*.pyc

.build
.build-ci
.build-tools
.cache
_codeql_detected_source_root

# Ignore PyPI build artifacts
dist/
21 changes: 6 additions & 15 deletions fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,9 @@

struct config cfg = { 0 };

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_STRING("nqn", 'n', "NAME", &cfg.nqn, nvmf_nqn),
OPT_STRING("device", 'd', "DEV", &cfg.device, device),
OPT_INCR("verbose", 'v', &cfg.verbose, "Increase logging verbosity"),
OPT_END()
};
OPT_STRING("device", 'd', "DEV", &cfg.device, device));

ret = argconfig_parse(argc, argv, desc, opts);
if (ret)
Expand Down Expand Up @@ -839,11 +836,8 @@

struct config cfg = { 0 };

OPT_ARGS(opts) = {
OPT_STRING("transport", 'r', "STR", (char *)&cfg.transport, nvmf_tport),
OPT_INCR("verbose", 'v', &cfg.verbose, "Increase logging verbosity"),
OPT_END()
};
NVME_ARGS(opts,
OPT_STRING("transport", 'r', "STR", (char *)&cfg.transport, nvmf_tport));

Check failure on line 840 in fabrics.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 89 exceeds 80 columns

ret = argconfig_parse(argc, argv, desc, opts);
if (ret)
Expand Down Expand Up @@ -1018,13 +1012,10 @@
unsigned int verbose;
} cfg = { 0 };

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_STRING("nqn", 'n', "NAME", &cfg.nqn, "Comma-separated list of DC nqn"),
OPT_STRING("device", 'd', "DEV", &cfg.device, "Comma-separated list of DC nvme device handle."),
OPT_STRING("task", 't', "TASK", &cfg.tas, "[register|deregister]"),
OPT_INCR("verbose", 'v', &cfg.verbose, "Increase logging verbosity"),
OPT_END()
};
OPT_STRING("task", 't', "TASK", &cfg.tas, "[register|deregister]"));

Check failure on line 1018 in fabrics.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 89 exceeds 80 columns

ret = argconfig_parse(argc, argv, desc, opts);
if (ret)
Expand Down
6 changes: 2 additions & 4 deletions nvme-rpmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,17 +855,15 @@ int rpmb_cmd_option(int argc, char **argv, struct command *acmd, struct plugin *
.target = 0,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_STRING("cmd", 'c', "command", &cfg.cmd, opt),
OPT_STRING("msgfile", 'f', "FILE", &cfg.msgfile, mfile),
OPT_STRING("keyfile", 'g', "FILE", &cfg.keyfile, kfile),
OPT_STRING("key", 'k', "key", &cfg.key, key),
OPT_STRING("msg", 'd', "data", &cfg.msg, msg),
OPT_UINT("address", 'o', &cfg.address, address),
OPT_UINT("blocks", 'b', &cfg.blocks, blocks),
OPT_UINT("target", 't', &cfg.target, target),
OPT_END()
};
OPT_UINT("target", 't', &cfg.target, target));

_cleanup_free_ unsigned char *key_buf = NULL;
_cleanup_free_ unsigned char *msg_buf = NULL;
Expand Down
7 changes: 2 additions & 5 deletions plugins/amzn/amzn-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,8 @@
.output_format = "normal",
};

OPT_ARGS(opts) = {
OPT_FMT("output-format", 'o', &cfg.output_format,
"Output Format: normal|json"),
OPT_FLAG("details", 'd', &detail, "Detail IO histogram of each block size ranges"),
OPT_END()};
NVME_ARGS(opts,
OPT_FLAG("details", 'd', &detail, "Detail IO histogram of each block size ranges"));

Check failure on line 489 in plugins/amzn/amzn-nvme.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 100 exceeds 80 columns

rc = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (rc)
Expand Down
6 changes: 2 additions & 4 deletions plugins/dapustor/dapustor-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,10 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
.namespace_id = NVME_NSID_ALL,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};
OPT_FLAG_JSON("json", 'j', &cfg.json, json));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down
4 changes: 1 addition & 3 deletions plugins/dera/dera-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ static int get_status(int argc, char **argv, struct command *acmd, struct plugin
struct nvme_dera_smart_info_log log;
int err;

OPT_ARGS(opts) = {
OPT_END()
};
NVME_ARGS(opts);

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down
54 changes: 16 additions & 38 deletions plugins/fdp/fdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("endgrp-id", 'e', &cfg.egid, egid),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable),
OPT_END()
};
OPT_FLAG("human-readable", 'H', &cfg.human_readable, human_readable));

Check failure on line 51 in plugins/fdp/fdp.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 86 exceeds 80 columns

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -120,12 +117,9 @@
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("endgrp-id", 'e', &cfg.egid, egid),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -186,12 +180,9 @@
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("endgrp-id", 'e', &cfg.egid, egid),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -249,13 +240,10 @@
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("endgrp-id", 'e', &cfg.egid, egid),
OPT_FLAG("host-events", 'E', &cfg.host_events, host_events),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -313,12 +301,9 @@
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_id),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -388,11 +373,9 @@
.pids = "",
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("namespace-id", 'n', &cfg.nsid, namespace_id),
OPT_LIST("pids", 'p', &cfg.pids, _pids),
OPT_END()
};
OPT_LIST("pids", 'p', &cfg.pids, _pids));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -459,14 +442,12 @@
.sv = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_UINT("namespace-id", 'n', &cfg.nsid, nsid),
OPT_SHRT("placement-handle", 'p', &cfg.ph, ph),
OPT_FLAG("enable", 'e', &cfg.enable, enable),
OPT_FLAG("save", 's', &cfg.sv, sv),
OPT_LIST("event-types", 't', &cfg.event_types, event_types),
OPT_END()
};
OPT_LIST("event-types", 't', &cfg.event_types, event_types));

Check failure on line 450 in plugins/fdp/fdp.c

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 83 exceeds 80 columns

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -537,13 +518,10 @@
.endgid = 0,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_SHRT("endgrp-id", 'e', &cfg.endgid, endurance_group),
OPT_BYTE("enable-conf-idx", 'c', &cfg.fdpcidx, enable_conf_idx),
OPT_FLAG("disable", 'd', &cfg.disable, disable),
OPT_INCR("verbose", 'v', &nvme_cfg.verbose, verbose),
OPT_END()
};
OPT_FLAG("disable", 'd', &cfg.disable, disable));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down
5 changes: 1 addition & 4 deletions plugins/huawei/huawei-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ static int huawei_list(int argc, char **argv, struct command *acmd,
.output_format = "normal",
};

OPT_ARGS(opts) = {
OPT_FMT("output-format", 'o', &cfg.output_format, "Output Format: normal|json"),
OPT_END()
};
NVME_ARGS(opts);

if (!ctx)
return -ENOMEM;
Expand Down
19 changes: 6 additions & 13 deletions plugins/ibm/ibm-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,8 @@ static int get_ibm_addi_smart_log(int argc, char **argv, struct command *cmd, st
.raw_binary = 0,
};

OPT_ARGS(opts) = {
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
NVME_ARGS(opts,
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down Expand Up @@ -368,10 +366,8 @@ static int get_ibm_vpd_log(int argc, char **argv, struct command *cmd, struct pl
.raw_binary = 0,
};

OPT_ARGS(opts) = {
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_END()
};
NVME_ARGS(opts,
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err < 0)
Expand Down Expand Up @@ -549,13 +545,10 @@ static int get_ibm_persistent_event_log(int argc, char **argv,
.raw_binary = false,
};

OPT_ARGS(opts) = {
NVME_ARGS(opts,
OPT_BYTE("action", 'a', &cfg.action, action),
OPT_UINT("log_len", 'l', &cfg.log_len, log_len),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw_use),
OPT_END()
};
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw_use));

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down
8 changes: 2 additions & 6 deletions plugins/innogrit/innogrit-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ static int innogrit_geteventlog(int argc, char **argv,
time_t timep;
int ret = -1;

OPT_ARGS(opts) = {
OPT_END()
};
NVME_ARGS(opts);

ret = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (ret)
Expand Down Expand Up @@ -228,9 +226,7 @@ static int innogrit_vsc_getcdump(int argc, char **argv, struct command *acmd,
time_t timep;
int ret = -1;

OPT_ARGS(opts) = {
OPT_END()
};
NVME_ARGS(opts);

ret = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion plugins/inspur/inspur-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int nvme_get_vendor_log(int argc, char **argv, struct command *acmd, stru
__u8 local_mem[BYTE_OF_4K];
int err;

OPT_ARGS(opts) = { OPT_END() };
NVME_ARGS(opts);

err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
if (err)
Expand Down
Loading
Loading