From: Jeff Lien Date: Fri, 18 Jun 2021 15:03:33 +0000 (-0500) Subject: [NVMe CLI] Add capability for unique plugin version X-Git-Tag: v1.15~30 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f729e93e2c08ed87ea0007238c729dbf911cd433;p=users%2Fsagi%2Fnvme-cli.git [NVMe CLI] Add capability for unique plugin version --- diff --git a/cmd_handler.h b/cmd_handler.h index d40740d7..73b5962e 100644 --- a/cmd_handler.h +++ b/cmd_handler.h @@ -5,7 +5,7 @@ */ #undef NAME -#define NAME(n, d) +#define NAME(n, d, v) #undef ENTRY #define ENTRY(n, h, f, ...) \ @@ -26,7 +26,7 @@ static int f(int argc, char **argv, struct command *command, struct plugin *plug */ #undef NAME -#define NAME(n, d) +#define NAME(n, d, v) #undef ENTRY_W_ALIAS #define ENTRY_W_ALIAS(n, h, f, a) \ @@ -63,7 +63,7 @@ static struct command f ## _cmd = { \ */ #undef NAME -#define NAME(n, d) +#define NAME(n, d, v) #undef ENTRY #define ENTRY(n, h, f, ...) &f ## _cmd, @@ -87,7 +87,7 @@ static struct command *commands[] = { \ */ #undef NAME -#define NAME(n, d) .name = n, .desc = d, +#define NAME(n, d, v) .name = n, .desc = d, .version = v, #undef COMMAND_LIST #define COMMAND_LIST(args...) diff --git a/plugin.c b/plugin.c index c7d6b2e1..78f03ab4 100644 --- a/plugin.c +++ b/plugin.c @@ -11,7 +11,7 @@ static int version(struct plugin *plugin) struct program *prog = plugin->parent; if (plugin->name) - printf("%s %s version %s\n", prog->name, plugin->name, prog->version); + printf("%s %s version %s\n", prog->name, plugin->name, plugin->version); else printf("%s version %s\n", prog->name, prog->version); return 0; diff --git a/plugin.h b/plugin.h index 91079fbe..7a8ed090 100644 --- a/plugin.h +++ b/plugin.h @@ -16,6 +16,7 @@ struct program { struct plugin { const char *name; const char *desc; + const char *version; struct command **commands; struct program *parent; struct plugin *next; diff --git a/plugins/amzn/amzn-nvme.h b/plugins/amzn/amzn-nvme.h index 9b8d797c..f969c0ec 100644 --- a/plugins/amzn/amzn-nvme.h +++ b/plugins/amzn/amzn-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("amzn", "Amazon vendor specific extensions"), +PLUGIN(NAME("amzn", "Amazon vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl) ) diff --git a/plugins/dera/dera-nvme.h b/plugins/dera/dera-nvme.h index dc54fabc..d3a8b0b5 100644 --- a/plugins/dera/dera-nvme.h +++ b/plugins/dera/dera-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("dera", "Dera vendor specific extensions"), +PLUGIN(NAME("dera", "Dera vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve Dera SMART Log, show it", get_status, "stat") ) diff --git a/plugins/huawei/huawei-nvme.h b/plugins/huawei/huawei-nvme.h index 7aac90cb..175ddd5b 100644 --- a/plugins/huawei/huawei-nvme.h +++ b/plugins/huawei/huawei-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("huawei", "Huawei vendor specific extensions"), +PLUGIN(NAME("huawei", "Huawei vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("list", "List all Huawei NVMe devices and namespaces on machine", huawei_list) ENTRY("id-ctrl", "Huawei identify controller", huawei_id_ctrl) diff --git a/plugins/intel/intel-nvme.h b/plugins/intel/intel-nvme.h index b1190042..af1231a9 100644 --- a/plugins/intel/intel-nvme.h +++ b/plugins/intel/intel-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("intel", "Intel vendor specific extensions"), +PLUGIN(NAME("intel", "Intel vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl) ENTRY("internal-log", "Retrieve Intel internal firmware log, save it", get_internal_log) diff --git a/plugins/lnvm/lnvm-nvme.h b/plugins/lnvm/lnvm-nvme.h index 45b3cf02..18dffe19 100644 --- a/plugins/lnvm/lnvm-nvme.h +++ b/plugins/lnvm/lnvm-nvme.h @@ -7,7 +7,7 @@ #include "cmd.h" -PLUGIN(NAME("lnvm", "LightNVM specific extensions"), +PLUGIN(NAME("lnvm", "LightNVM specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("list", "List available LightNVM devices", lnvm_list) ENTRY("info", "List general information and available target engines", lnvm_info) diff --git a/plugins/memblaze/memblaze-nvme.h b/plugins/memblaze/memblaze-nvme.h index 043d0a8d..6f10bd7a 100644 --- a/plugins/memblaze/memblaze-nvme.h +++ b/plugins/memblaze/memblaze-nvme.h @@ -12,7 +12,7 @@ #include #include -PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions"), +PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve Memblaze SMART Log, show it", mb_get_additional_smart_log) ENTRY("get-pm-status", "Get Memblaze Power Manager Status", mb_get_powermanager_status) diff --git a/plugins/micron/micron-nvme.h b/plugins/micron/micron-nvme.h index 118f8cdf..65eca6ab 100644 --- a/plugins/micron/micron-nvme.h +++ b/plugins/micron/micron-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("micron", "Micron vendor specific extensions"), +PLUGIN(NAME("micron", "Micron vendor specific extensions", NVME_VERSION), COMMAND_LIST(ENTRY("select-download", "Selective Firmware Download", micron_selective_download) ENTRY("vs-temperature-stats", "Retrieve Micron temperature statistics ", micron_temp_stats) ENTRY("vs-pcie-stats", "Retrieve Micron PCIe error stats", micron_pcie_stats) diff --git a/plugins/netapp/netapp-nvme.h b/plugins/netapp/netapp-nvme.h index d4eebd6e..2599db02 100644 --- a/plugins/netapp/netapp-nvme.h +++ b/plugins/netapp/netapp-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("netapp", "NetApp vendor specific extensions"), +PLUGIN(NAME("netapp", "NetApp vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smdevices", "NetApp SMdevices", netapp_smdevices) ENTRY("ontapdevices", "NetApp ONTAPdevices", netapp_ontapdevices) diff --git a/plugins/nvidia/nvidia-nvme.h b/plugins/nvidia/nvidia-nvme.h index bf562b91..74a20b8b 100644 --- a/plugins/nvidia/nvidia-nvme.h +++ b/plugins/nvidia/nvidia-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("nvidia", "NVIDIA vendor specific extensions"), +PLUGIN(NAME("nvidia", "NVIDIA vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl) ) diff --git a/plugins/scaleflux/sfx-nvme.h b/plugins/scaleflux/sfx-nvme.h index 8f145019..fde5ba3d 100644 --- a/plugins/scaleflux/sfx-nvme.h +++ b/plugins/scaleflux/sfx-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("sfx", "ScaleFlux vendor specific extensions"), +PLUGIN(NAME("sfx", "ScaleFlux vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve ScaleFlux SMART Log, show it", get_additional_smart_log) ENTRY("lat-stats", "Retrieve ScaleFlux IO Latency Statistics log, show it", get_lat_stats_log) diff --git a/plugins/seagate/seagate-nvme.h b/plugins/seagate/seagate-nvme.h index f5706978..a4989f1e 100644 --- a/plugins/seagate/seagate-nvme.h +++ b/plugins/seagate/seagate-nvme.h @@ -27,7 +27,7 @@ #include "cmd.h" -PLUGIN(NAME("seagate", "Seagate vendor specific extensions"), +PLUGIN(NAME("seagate", "Seagate vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("vs-temperature-stats", "Retrieve Seagate temperature statistics ", temp_stats) ENTRY("vs-log-page-sup", "Retrieve Seagate Supported Log-pages Information ", log_pages_supp) diff --git a/plugins/shannon/shannon-nvme.h b/plugins/shannon/shannon-nvme.h index d40732e6..db258288 100644 --- a/plugins/shannon/shannon-nvme.h +++ b/plugins/shannon/shannon-nvme.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("shannon", "Shannon vendor specific extensions"), +PLUGIN(NAME("shannon", "Shannon vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve Shannon SMART Log, show it", get_additional_smart_log) ENTRY("get-feature-add", "Get Shannon feature and show the resulting value", get_additional_feature) diff --git a/plugins/toshiba/toshiba-nvme.h b/plugins/toshiba/toshiba-nvme.h index c405e781..ebd7575f 100644 --- a/plugins/toshiba/toshiba-nvme.h +++ b/plugins/toshiba/toshiba-nvme.h @@ -7,7 +7,7 @@ #include "cmd.h" #include "plugin.h" -PLUGIN(NAME("toshiba", "Toshiba NVME plugin"), +PLUGIN(NAME("toshiba", "Toshiba NVME plugin", NVME_VERSION), COMMAND_LIST( ENTRY("vs-smart-add-log", "Extended SMART information", vendor_log) ENTRY("vs-internal-log", "Get Internal Log", internal_log) diff --git a/plugins/transcend/transcend-nvme.h b/plugins/transcend/transcend-nvme.h index 14d62ec7..317793aa 100644 --- a/plugins/transcend/transcend-nvme.h +++ b/plugins/transcend/transcend-nvme.h @@ -7,7 +7,7 @@ #include "cmd.h" -PLUGIN(NAME("transcend", "Transcend vendor specific extensions"), +PLUGIN(NAME("transcend", "Transcend vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("healthvalue", "NVME health percentage", getHealthValue) ENTRY("badblock", "Get NVME bad block number", getBadblock) diff --git a/plugins/virtium/virtium-nvme.h b/plugins/virtium/virtium-nvme.h index b95c910c..124ab182 100644 --- a/plugins/virtium/virtium-nvme.h +++ b/plugins/virtium/virtium-nvme.h @@ -7,7 +7,7 @@ #include "cmd.h" #include "plugin.h" -PLUGIN(NAME("virtium", "Virtium vendor specific extensions"), +PLUGIN(NAME("virtium", "Virtium vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("save-smart-to-vtview-log", "Periodically save smart attributes into a log file.\n\ The data in this log file can be analyzed using excel or using Virtium’s vtView.\n\ diff --git a/plugins/wdc/wdc-nvme.h b/plugins/wdc/wdc-nvme.h index de6affab..29ff6a08 100644 --- a/plugins/wdc/wdc-nvme.h +++ b/plugins/wdc/wdc-nvme.h @@ -4,9 +4,10 @@ #if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ) #define WDC_NVME +#define WDC_PLUGIN_VERSION "1.14.1" #include "cmd.h" -PLUGIN(NAME("wdc", "Western Digital vendor specific extensions"), +PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION), COMMAND_LIST( ENTRY("cap-diag", "WDC Capture-Diagnostics", wdc_cap_diag) ENTRY("drive-log", "WDC Drive Log", wdc_drive_log) diff --git a/plugins/ymtc/ymtc-nvme.h b/plugins/ymtc/ymtc-nvme.h index 739fd374..c1ebc11e 100644 --- a/plugins/ymtc/ymtc-nvme.h +++ b/plugins/ymtc/ymtc-nvme.h @@ -12,7 +12,7 @@ #include #include -PLUGIN(NAME("ymtc", "Ymtc vendor specific extensions"), +PLUGIN(NAME("ymtc", "Ymtc vendor specific extensions", NVME_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve Ymtc SMART Log, show it", get_additional_smart_log) ) diff --git a/plugins/zns/zns.h b/plugins/zns/zns.h index a92de69c..61063f70 100644 --- a/plugins/zns/zns.h +++ b/plugins/zns/zns.h @@ -6,7 +6,7 @@ #include "cmd.h" -PLUGIN(NAME("zns", "Zoned Namespace Command Set"), +PLUGIN(NAME("zns", "Zoned Namespace Command Set", NVME_VERSION), COMMAND_LIST( ENTRY("id-ctrl", "Retrieve ZNS controller identification", id_ctrl) ENTRY("id-ns", "Retrieve ZNS namespace identification", id_ns)