linux-nvme / nvme-cli

NVMe management command line interface.
https://nvmexpress.org
GNU General Public License v2.0
1.45k stars 650 forks source link

nvme: use argconfig_parse_seen to check the parameter #2430

Closed ghost closed 1 month ago

ghost commented 1 month ago

The value of NVME_FEAT_FID_TIMESTAMP cannot be set to 0 through 'set-feature -f 0xe -v 0' Using argconfig_parse_seen() can fix this issue

ghost commented 1 month ago

When the command "set-feature /dev/nvmeX -f 0xe -v 0" is used, the command should be executed immediately, and the value of FID_TIMESTAMP should be set to 0. The current situation, is that the command waits to read data from stdin, and then, sets the read data to FID_TIMESTAMP

igaw commented 1 month ago

The line is a bit long. Could you move condition to the next line and align it with (.

WARNING: line length of 103 exceeds 100 columns
#22: FILE: nvme.c:6418:
+ if (cfg.feature_id == NVME_FEAT_FID_TIMESTAMP && argconfig_parse_seen(opts, "value")) {
ghost commented 1 month ago

the parameter check code has been moved to the next line

ghost commented 1 month ago

modified the commit description

igaw commented 1 month ago

Thanks!