1
0
Fork 0

Adding upstream version 2.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 12:15:30 +01:00
parent 50aec1e4c5
commit 1b3a431c1d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
521 changed files with 21541 additions and 21644 deletions

View file

@ -9,8 +9,9 @@ _nvme () {
_cmds=(
'id-ctrl:display information about the controller'
'id-ns:display information about the namespace'
'id-ns-lba-format:display information about the namespace capability fields for specific LBA format'
'list-ns:identify all namespace(s) attached'
'cmdset-ind-id-ns':display I/O Command Set Independent information about the namespace'
'cmdset-ind-id-ns:display I/O Command Set Independent information about the namespace'
'id-iocs:display information about I/O command sets'
'id-domain:display information about domain list'
'create-ns:create a new namespace before attachment'
@ -19,6 +20,8 @@ _nvme () {
'detach-ns:detach namespace from controller'
'list-ctrl:identify all controller(s) attached'
'nvm-id-ctrl:display information about the nvm command set'
'nvm-id-ns:display information about the namespace of nvm command set'
'id-ns-lba-format:display information about the namespace of nvm command set capability fields for specific LBA format'
'list-endgrp:display information about nvme endurance group list'
'get-ns-id:get namespace id of opened block device'
'get-log:retrieve any log in raw format'
@ -56,6 +59,8 @@ _nvme () {
'fid-support-effects-log:retrieve fid support and effects log'
'supported-log-pages: retrieve support log pages details'
'lockdown:submit a lockdown command'
'media-unit-stat-log: retrieve media unit status log pages details'
'supported-cap-config-log: retrieve support log pages details'
'help:print brief descriptions of all nvme commands'
)
@ -99,6 +104,22 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme id-ns options" _idns
;;
(id-ns-lba-format)
local _idns_lba_format
_idns_lba_format=(
/dev/nvme':supply a device to use (required)'
--lba-format-index=':show infos for lba format index <lba-format-index>'
-i':alias of --lba-format-index'
--uuid-index=':uuid index'
-U':alias for --uuid-index'
--output-format=':Output format: normal|json|binary'
-o':alias for --output-format'
--verbose':show infos verbosely'
-v':alias of --verbose'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme id-ns-lba-format options" _idns_lba_format
;;
(list-ns)
local _listns
_listns=(
@ -145,7 +166,7 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme id-domain options" _iddomain
;;
nvm-id-ctrl)
(nvm-id-ctrl)
local _nvmidctrl
_nvmidctrl=(
/dev/nvme':supply a device to use (required)'
@ -153,6 +174,38 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme nvm-id-ctrl options" _nvmidctrl
;;
(nvm-id-ns)
local _nvmidns
_nvmidns=(
/dev/nvme':supply a device to use (required)'
--namespace-id=':show infos for namespace <nsid>'
-n':alias of --namespace-id'
--uuid-index=':uuid index'
-U':alias for --uuid-index'
--output-format=':Output format: normal|json|binary'
-o':alias for --output-format'
--verbose':show infos verbosely'
-v':alias of --verbose'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme nvm-id-ns options" _nvmidns
;;
(id-ns-lba-format)
local _nvm_idns_lba_format
_nvm_idns_lba_format=(
/dev/nvme':supply a device to use (required)'
--lba-format-index=':show infos for lba format index <lba-format-index>'
-i':alias of --lba-format-index'
--uuid-index=':uuid index'
-U':alias for --uuid-index'
--output-format=':Output format: normal|json|binary'
-o':alias for --output-format'
--verbose':show infos verbosely'
-v':alias of --verbose'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme nvm-id-ns-lba-format options" _nvm_idns_lba_format
;;
(list-endgrp)
local _listendgrp
_listendgrp=(
@ -516,6 +569,30 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme supported-log-pages options" _support
;;
(media-unit-stat-log)
local _medialog
_medialog=(
/dev/nvme':supply a device to use (required)'
--dom-id=':show infos for domain id'
-d':alias of --dom-id'
--raw-binary':dump infos in binary format'
-b':alias of --raw-binary'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme media-unit-stat-log" _medialog
;;
(supported-cap-config-log)
local _caplog
_caplog=(
/dev/nvme':supply a device to use (required)'
--dom-id=':show infos for domain id'
-d':alias of --dom-id'
--raw-binary':dump infos in binary format'
-b':alias of --raw-binary'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme supported-cap-config-log" _caplog
;;
(admin-passthru)
local _admin
_admin=(
@ -694,6 +771,8 @@ _nvme () {
-n':alias of --namespace-id'
--numd=':number of dwords of reservation status to xfer'
-d':alias of --numd'
--eds':request extended data structure'
-e':alias of --eds'
--raw-binary':dump output in binary format'
-b':alias of --raw-binary'
)
@ -899,8 +978,8 @@ _nvme () {
resv-report flush compare read write copy show-regs persistent-event-log
pred-lat-event-agg-log nvm-id-ctrl endurance-event-agg-log lba-status-log
resv-notif-log capacity-mgmt id-domain boot-part-log fid-support-effects-log
supported-log-pages lockdown
supported-log-pages list-endgrp
supported-log-pages lockdown media-unit-stat-log id-ns-lba-format nvm-id-ns
nvm-id-ns-lba-format supported-cap-config-log
)
_arguments '*:: :->subcmds'
_describe -t commands "help: infos on a specific nvme command, or provide no option to see a synopsis of all nvme commands" _h

View file

@ -13,8 +13,6 @@ readonly _plugin_subcmds=(
set-bucket-thresholds lat-stats-tracking \
market-name smart-log-add temp-stats"
[amzn]="id-ctrl"
[lnvm]="list info id-ns chunk-log init create \
remove factory diag-bbtbl diag-set-bbtbl"
[memblaze]="smart-log-add get-pm-status set-pm-status \
select-download lat-stats lat-stats-print lat-log \
lat-log-print clear-error-log"
@ -61,7 +59,6 @@ typeset -A _plugin_funcs
readonly _plugin_funcs=(
[intel]="plugin_intel_opts"
[amzn]="plugin_amzn_opts"
[lnvm]="plugin_lnvm_opts"
[memblaze]="plugin_memblaze_opts"
[wdc]="plugin_wdc_opts"
[huawei]="plugin_huawei_opts"
@ -81,6 +78,7 @@ readonly _plugin_funcs=(
# Top level commands
_cmds="list list-subsys id-ctrl id-ns \
id-ns-granularity list-ns list-ctrl \
id-ns-lba-format nvm-id-ns nvm-id-ns-lba-format \
nvm-id-ctrl primary-ctrl-caps list-secondary \
ns-descs id-nvmset id-uuid id-iocs create-ns \
delete-ns get-ns-id get-log telemetry-log \
@ -101,8 +99,8 @@ _cmds="list list-subsys id-ctrl id-ns \
connect disconnect disconnect-all gen-hostnqn \
show-hostnqn dir-receive dir-send virt-mgmt \
rpmb boot-part-log fid-support-effects-log \
supported-log-pages lockdown"
supported-log-pages list-endgrp"
supported-log-pages lockdown media-unit-stat-log \
supported-cap-config-log dim"
# Add plugins:
for plugin in "${!_plugin_subcmds[@]}"; do
@ -148,6 +146,10 @@ nvme_list_opts () {
"id-ns-granularity")
opts+=" --output-format= -o"
;;
"id-ns-lba-format")
opts+=" --lba-format-index= -i --uuid-index= -U \
--verbose -v --output-format= -o"
;;
"list-ns")
opts+=" --namespace-id= -n --al -a --csi= -y \
--outputformat= -o"
@ -160,12 +162,17 @@ nvme_list_opts () {
opts+=" --namespace-id= -n --raw-binary -b \
--human-readable -H --output-format= -o"
;;
"id-domain")
opts+=" --dom-id= -d --output-format= -o"
;;
"nvm-id-ctrl")
opts+=" --output-format= -o"
;;
"nvm-id-ns")
opts+=" --namespace-id= -n --uuid-index= -U\
--verbose -v --output-format= -o"
;;
"nvm-id-ns-lba-format")
opts+=" --lba-format-index= -i --uuid-index= -U \
--verbose -v --output-format= -o"
;;
"primary-ctrl-caps")
opts+=" --output-format= -o --human-readable -H"
;;
@ -271,6 +278,14 @@ nvme_list_opts () {
opts+=" --lsp -s --output-file= -f \
--output-format= -o"
;;
"media-unit-stat-log")
opts+=" --dom-id= -d --output-format= -o \
--raw-binary -b"
;;
"supported-cap-config-log")
opts+=" --dom-id= -d --output-format= -o \
--raw-binary -b"
;;
"get-feature")
opts+=" --namespace-id= -n --feature-id= -f --sel= -s \
--data-len= -l --cdw11= --c -uuid-index= -U --raw-binary -b \
@ -356,11 +371,11 @@ nvme_list_opts () {
--rrela= -a --iekey -i"
;;
"resv-report")
opts+=" --namespace-id= -n --numd= -d --cdw11 -c \
--output-format= -o --raw-binary -b"
opts+=" --namespace-id= -n --numd= -d --eds -e \
--raw-binary= -b --output-format= -o"
;;
"dsm")
opts+=" --namespace-id= -n --ctx-attrs= -a --blocks= -b \
opts+=" --namespace-id= -n --ctx-attrs= -a --blocks= -b\
--slbs= -s --ad -d --idw -w --idr -r --cdw11= -c"
;;
"copy")
@ -442,26 +457,26 @@ nvme_list_opts () {
;;
"discover")
opts+=" --transport= -t -traddr= -a -trsvcid= -s \
--host-traddr= -w --hsot-iface= -f \
--host-traddr= -w --host-iface= -f \
--hostnqn= -q --hostid -I --raw= -r \
--raw= -r --device= -d --keep-alive-tmo= -k \
--ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \
--tos= -T --hdr-digest= -g --data-digest -G \
--nr-io-queues= -i --nr-write-queues= -W \
--nr-poll-queues= -P --queue-size= -Q \
--persistent -p --quiet -S --matching -m \
--persistent -p --quiet -S \
--output-format= -o"
;;
"connect-all")
opts+=" --transport= -t -traddr= -a -trsvcid= -s \
--host-traddr= -w --hsot-iface= -f \
--host-traddr= -w --host-iface= -f \
--hostnqn= -q --hostid -I --raw= -r \
--raw= -r --device= -d --keep-alive-tmo= -k \
--ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \
--tos= -T --hdr-digest= -g --data-digest -G \
--nr-io-queues= -i --nr-write-queues= -W \
--nr-poll-queues= -P --queue-size= -Q \
--persistent -p --quiet -S --matching -m \
--persistent -p --quiet -S \
--output-format= -o"
;;
"connect")
@ -473,6 +488,9 @@ nvme_list_opts () {
--tos= -T --duplicate-connect -D --disable-sqflow -d\
--hdr-digest -g --data-digest -G --output-format= -o"
;;
"dim")
opts+=" --task -t --nqn -n --device -d"
;;
"disconnect")
opts+=" --nqn -n --device -d"
;;
@ -606,68 +624,6 @@ plugin_amzn_opts () {
return 0
}
plugin_lnvm_opts () {
local opts=""
local compargs=""
local nonopt_args=0
for (( i=0; i < ${#words[@]}-1; i++ )); do
if [[ ${words[i]} != -* ]]; then
let nonopt_args+=1
fi
done
if [ $nonopt_args -eq 3 ]; then
opts="/dev/nvme* "
fi
opts+=" "
case "$1" in
"list")
opts+=$NO_OPTS
;;
"info")
opts+=$NO_OPTS
;;
"id-ns")
opts+=" --namespace-id= -n --raw-binary -b --human-readable -H"
;;
"chunk-log")
opts+=" --output-format= -o --human-readable -H"
;;
"init")
opts+=" --device-name= -d --mediamgr-name -m"
;;
"create")
opts+=" --device-name= -d --target-name= -n --target-type= -t \
--lun-begin= -b --lun-end= -e --over-prov= -o --factory -f"
;;
"remove")
opts+=" --target-name= -n"
;;
"factory")
opts+=" --device-name= -d --erase-only-marked -e
--clear-host-side-blks -s --clear-bb-blks -b"
;;
"diag-bbtbl")
opts+=" --namespace-id= -n --channel-id= -c --lun-id= -l \
--raw-binary -b"
;;
"diag-set-bbtbl")
opts+=" --namespace-id= -n --channel-id= -c --lun-id= -l \
--plane-id= -p --block-id= -b --value= -v"
;;
"help")
opts+=$NO_OPTS
;;
esac
COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
return 0
}
plugin_memblaze_opts () {
local opts=""
local compargs=""
@ -1261,7 +1217,7 @@ plugin_zns_opts () {
--data-len= -l"
;;
"zone-mgmt-send")
opts+=" --namespace-id= -n --start-lba= -s \
opts+=" --namespace-id= -n --start-lba= -s --zsaso -o \
--select-all -a --zsa= -z --data-len= -l \
--data= -d --timeout= -t"
;;
@ -1280,7 +1236,7 @@ plugin_zns_opts () {
;;
"open-zone")
opts+=" --namespace-id= -n --start-lba= -s \
--select-all -a --timeout= -t"
--select-all -a --timeout= -t --zrwa -r"
;;
"reset-zone")
opts+=" --namespace-id= -n --start-lba= -s \
@ -1292,7 +1248,10 @@ plugin_zns_opts () {
;;
"set-zone-desc")
opts+=" --namespace-id= -n --start-lba= -s \
--data= -d --timeout= -t"
--data= -d --timeout= -t --zrwa -r"
;;
"flush-zone")
opts+=" --namespace-id= -n --last-lba= -l --timeout= -t"
;;
"zone-append")
opts+=" --namespace-id= -n --zslba= -s --data-size= -z \