]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
completions: add ocp set-error-injection command
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 21 Jul 2024 01:16:28 +0000 (10:16 +0900)
committerDaniel Wagner <wagi@monom.org>
Wed, 24 Jul 2024 06:10:22 +0000 (08:10 +0200)
The command injects error conditions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
completions/_nvme
completions/bash-nvme-completion.sh

index fd8e5d5893525a230a6dd3ae4a47c94c9927861a..70ab9d3e89e6b98b2d86e49ef0a44c403b181957 100644 (file)
@@ -335,6 +335,29 @@ _nvme () {
                                _arguments '*:: :->subcmds'
                                _describe -t commands "nvme ocp get-error-injection options" _get_error_injection
                                ;;
+                       (set-error-injection)
+                               local _set_error_injection
+                               _set_error_injection=(
+                               /dev/nvme':supply a device to use (required)'
+                               --data=':Error injection data structure entries'
+                               -d':alias for --data'
+                               --number=':Number of valid error injection data entries'
+                               -n':alias for --number'
+                               --no-uuid':Skip UUID index search'
+                               -N':alias for --no-uuid'
+                               --type=':Error injection type'
+                               -t':alias for --type'
+                               --nrtdp=':Number of reads to trigger device panic'
+                               -r':alias for --nrtdp'
+                               --verbose':Increase the information detail in the output.'
+                               -v':alias for --verbose'
+                               --output-format=':Output format: normal|json|binary'
+                               -o ':alias for --output-format'
+                               --timeout=':value for timeout'
+                               )
+                               _arguments '*:: :->subcmds'
+                               _describe -t commands "nvme ocp set-error-injection options" _set_error_injection
+                               ;;
                        (*)
                                _files
                                ;;
@@ -2543,6 +2566,7 @@ _nvme () {
                        set-telemetry-profile':Set Telemetry Profile'
                        tcg-configuration-log':tcg configuration log'
                        get-error-injection':get error injection'
+                       set-error-injection':set error injection'
                        )
                        _arguments '*:: :->subcmds'
                        _describe -t commands "nvme ocp options" _ocp
index 35149c196b38fe89683d436db42f87e8be038632..8e80ddbf8479760ba106145a6e7f5a427c7b905e 100644 (file)
@@ -1487,6 +1487,10 @@ plugin_ocp_opts () {
                "get-error-injection")
                opts+=" --sel= -s --no-uuid -n"
                        ;;
+               "set-error-injection")
+               opts+=" --data= -d --number= -n --no-uuid -N --type= -t \
+                       --nrtdp= -r --verbose -v --output-format -o --timeout="
+                       ;;
                "help")
                opts+=$NO_OPTS
                        ;;
@@ -1565,7 +1569,7 @@ _nvme_subcmds () {
                        set-dssd-power-state-feature get-dssd-power-state-feature \
                        telemetry-string-log set-telemetry-profile \
                        set-dssd-async-event-config get-dssd-async-event-config \
-                       get-error-injection"
+                       get-error-injection set-error-injection"
        )
 
        # Associative array mapping plugins to corresponding option completions