From b997e957d8c3088550bfdf217888d37d0843c319 Mon Sep 17 00:00:00 2001 From: Monica Kenguva Date: Tue, 2 Mar 2021 00:53:52 +0000 Subject: [PATCH] rpc: Document bdev_error_inject_error Signed-off-by: Monica Kenguva Change-Id: I42d11341df2c364b0ad0c948c195e13448426c59 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6633 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Paul Luse Community-CI: Mellanox Build Bot --- doc/jsonrpc.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index c8016b81dd..45c2516ee8 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -3445,6 +3445,48 @@ Example response: } ~~~ +## bdev_error_inject_error {#rpc_bdev_error_inject_error} + +Inject an error via an error bdev. Create an error bdev on base bdev first. Default 'num' +value is 1 and if 'num' is set to zero, the specified injection is disabled. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +name | Required | string | Name of the error injection bdev +io_type | Required | string | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all' +error_type | Required | string | error type 'failure' 'pending' +num | Optional | int | the number of commands you want to fail.(default:1) + +### Example + +Example request: + +~~~ +{ + "jsonrpc": "2.0", + "method": "bdev_error_inject_error", + "id": 1, + "params": { + "name": "EE_Malloc0", + "io_type": "write", + "error_type": "pending", + "num": 1 + } +} +~~~ + +Example response: + +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ + ## bdev_iscsi_create {#rpc_bdev_iscsi_create} Connect to iSCSI target and create bdev backed by this connection.