bdev/virtio: Remove deprecated remove_virtio_scsi_bdev rpc
Marked as deprecated in 18.10 Change-Id: I67eb3e7b83995c2e53905f9a6bc5b8562a3dffc4 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/442418 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
9a016643dc
commit
b5c7ae072d
@ -275,7 +275,6 @@ Example response:
|
||||
"construct_virtio_dev",
|
||||
"get_virtio_scsi_devs",
|
||||
"remove_virtio_bdev",
|
||||
"remove_virtio_scsi_bdev",
|
||||
"delete_aio_bdev",
|
||||
"construct_aio_bdev",
|
||||
"destruct_split_vbdev",
|
||||
|
@ -51,60 +51,6 @@ static const struct spdk_json_object_decoder rpc_remove_virtio_dev[] = {
|
||||
{"name", offsetof(struct rpc_remove_virtio_dev, name), spdk_json_decode_string },
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_remove_virtio_scsi_bdev_cb(void *ctx, int errnum)
|
||||
{
|
||||
struct spdk_jsonrpc_request *request = ctx;
|
||||
struct spdk_json_write_ctx *w;
|
||||
|
||||
if (errnum != 0) {
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
spdk_strerror(-errnum));
|
||||
return;
|
||||
}
|
||||
|
||||
w = spdk_jsonrpc_begin_result(request);
|
||||
if (w == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_json_write_bool(w, true);
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_rpc_remove_virtio_scsi_bdev(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_remove_virtio_dev req = {NULL};
|
||||
int rc;
|
||||
|
||||
SPDK_WARNLOG("remove_virtio_scsi_bdev command has been deprecated and will be removed "
|
||||
"in the subsequent release. Please use remove_virtio_bdev instead.\n");
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_remove_virtio_dev,
|
||||
SPDK_COUNTOF(rpc_remove_virtio_dev),
|
||||
&req)) {
|
||||
rc = -EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
rc = bdev_virtio_scsi_dev_remove(req.name, spdk_rpc_remove_virtio_scsi_bdev_cb, request);
|
||||
if (rc != 0) {
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
free(req.name);
|
||||
|
||||
return;
|
||||
|
||||
invalid:
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
spdk_strerror(-rc));
|
||||
free(req.name);
|
||||
}
|
||||
SPDK_RPC_REGISTER("remove_virtio_scsi_bdev", spdk_rpc_remove_virtio_scsi_bdev, SPDK_RPC_RUNTIME);
|
||||
|
||||
static void
|
||||
spdk_rpc_remove_virtio_bdev_cb(void *ctx, int errnum)
|
||||
{
|
||||
|
@ -1761,15 +1761,6 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p = subparsers.add_parser('get_virtio_scsi_devs', help='List all Virtio-SCSI devices.')
|
||||
p.set_defaults(func=get_virtio_scsi_devs)
|
||||
|
||||
def remove_virtio_scsi_bdev(args):
|
||||
rpc.vhost.remove_virtio_scsi_bdev(args.client,
|
||||
name=args.name)
|
||||
|
||||
p = subparsers.add_parser('remove_virtio_scsi_bdev', help="""Remove a Virtio-SCSI device
|
||||
This will delete all bdevs exposed by this device (this call is deprecated - please use remove_virtio_bdev call instead).""")
|
||||
p.add_argument('name', help='Virtio device name. E.g. VirtioUser0')
|
||||
p.set_defaults(func=remove_virtio_scsi_bdev)
|
||||
|
||||
def remove_virtio_bdev(args):
|
||||
rpc.vhost.remove_virtio_bdev(args.client,
|
||||
name=args.name)
|
||||
|
@ -155,16 +155,6 @@ def construct_virtio_dev(client, name, trtype, traddr, dev_type, vq_count=None,
|
||||
return client.call('construct_virtio_dev', params)
|
||||
|
||||
|
||||
def remove_virtio_scsi_bdev(client, name):
|
||||
"""Remove a Virtio-SCSI device
|
||||
This will delete all bdevs exposed by this device.
|
||||
Args:
|
||||
name: virtio device name
|
||||
"""
|
||||
params = {'name': name}
|
||||
return client.call('remove_virtio_scsi_bdev', params)
|
||||
|
||||
|
||||
def remove_virtio_bdev(client, name):
|
||||
"""Remove a Virtio device
|
||||
This will delete all bdevs exposed by this device.
|
||||
|
Loading…
Reference in New Issue
Block a user