bdev/virtio: Remove deprecated construct_virtio_user_scsi_bdev RPC
Marked as deprecated in 18.10. Change-Id: Iac9f0033204dd468c2df11653ae46410dfbb1f7a Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/442414 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
b2d5bfd0d1
commit
8683a0fda1
@ -279,7 +279,6 @@ Example response:
|
|||||||
"remove_virtio_bdev",
|
"remove_virtio_bdev",
|
||||||
"remove_virtio_scsi_bdev",
|
"remove_virtio_scsi_bdev",
|
||||||
"construct_virtio_pci_scsi_bdev",
|
"construct_virtio_pci_scsi_bdev",
|
||||||
"construct_virtio_user_scsi_bdev",
|
|
||||||
"delete_aio_bdev",
|
"delete_aio_bdev",
|
||||||
"construct_aio_bdev",
|
"construct_aio_bdev",
|
||||||
"destruct_split_vbdev",
|
"destruct_split_vbdev",
|
||||||
@ -2277,12 +2276,6 @@ Example response:
|
|||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
## construct_virtio_user_scsi_bdev {#rpc_construct_virtio_user_scsi_bdev}
|
|
||||||
|
|
||||||
This is legacy RPC method. It is equivalent of @ref rpc_construct_virtio_dev with `trtype` set to `user` and `dev_type` set to `scsi`.
|
|
||||||
|
|
||||||
Because it will be deprecated soon it is intentionally undocumented.
|
|
||||||
|
|
||||||
|
|
||||||
## construct_virtio_pci_scsi_bdev {#rpc_construct_virtio_pci_scsi_bdev}
|
## construct_virtio_pci_scsi_bdev {#rpc_construct_virtio_pci_scsi_bdev}
|
||||||
|
|
||||||
|
@ -53,13 +53,6 @@ struct rpc_construct_virtio_scsi_dev {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct spdk_json_object_decoder rpc_construct_virtio_user_scsi_dev[] = {
|
|
||||||
{"path", offsetof(struct rpc_construct_virtio_scsi_dev, path), spdk_json_decode_string },
|
|
||||||
{"name", offsetof(struct rpc_construct_virtio_scsi_dev, name), spdk_json_decode_string },
|
|
||||||
{"vq_count", offsetof(struct rpc_construct_virtio_scsi_dev, vq_size), spdk_json_decode_uint32, true },
|
|
||||||
{"vq_size", offsetof(struct rpc_construct_virtio_scsi_dev, vq_size), spdk_json_decode_uint32, true },
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_rpc_construct_virtio_scsi_dev(struct rpc_construct_virtio_scsi_dev *req)
|
free_rpc_construct_virtio_scsi_dev(struct rpc_construct_virtio_scsi_dev *req)
|
||||||
{
|
{
|
||||||
@ -102,50 +95,6 @@ rpc_construct_virtio_scsi_dev_cb(void *ctx, int result, struct spdk_bdev **bdevs
|
|||||||
free_rpc_construct_virtio_scsi_dev(ctx);
|
free_rpc_construct_virtio_scsi_dev(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
spdk_rpc_create_virtio_user_scsi_bdev(struct spdk_jsonrpc_request *request,
|
|
||||||
const struct spdk_json_val *params)
|
|
||||||
{
|
|
||||||
struct rpc_construct_virtio_scsi_dev *req;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
SPDK_WARNLOG("construct_virtio_user_scsi_bdev command has been deprecated and will be removed "
|
|
||||||
"in the subsequent release. Please use construct_virtio_dev instead.\n");
|
|
||||||
|
|
||||||
req = calloc(1, sizeof(*req));
|
|
||||||
if (!req) {
|
|
||||||
rc = -ENOMEM;
|
|
||||||
goto invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
req->pci_address = NULL;
|
|
||||||
req->vq_count = SPDK_VIRTIO_USER_DEFAULT_VQ_COUNT;
|
|
||||||
req->vq_size = SPDK_VIRTIO_USER_DEFAULT_QUEUE_SIZE;
|
|
||||||
|
|
||||||
if (spdk_json_decode_object(params, rpc_construct_virtio_user_scsi_dev,
|
|
||||||
SPDK_COUNTOF(rpc_construct_virtio_user_scsi_dev),
|
|
||||||
req)) {
|
|
||||||
rc = -EINVAL;
|
|
||||||
goto invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
req->request = request;
|
|
||||||
rc = bdev_virtio_user_scsi_dev_create(req->name, req->path, req->vq_count, req->vq_size,
|
|
||||||
rpc_construct_virtio_scsi_dev_cb, req);
|
|
||||||
if (rc < 0) {
|
|
||||||
goto invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
invalid:
|
|
||||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
|
||||||
spdk_strerror(-rc));
|
|
||||||
free_rpc_construct_virtio_scsi_dev(req);
|
|
||||||
}
|
|
||||||
SPDK_RPC_REGISTER("construct_virtio_user_scsi_bdev", spdk_rpc_create_virtio_user_scsi_bdev,
|
|
||||||
SPDK_RPC_RUNTIME);
|
|
||||||
|
|
||||||
static const struct spdk_json_object_decoder rpc_construct_virtio_pci_scsi_dev[] = {
|
static const struct spdk_json_object_decoder rpc_construct_virtio_pci_scsi_dev[] = {
|
||||||
{"pci_address", offsetof(struct rpc_construct_virtio_scsi_dev, pci_address), spdk_json_decode_string },
|
{"pci_address", offsetof(struct rpc_construct_virtio_scsi_dev, pci_address), spdk_json_decode_string },
|
||||||
{"name", offsetof(struct rpc_construct_virtio_scsi_dev, name), spdk_json_decode_string },
|
{"name", offsetof(struct rpc_construct_virtio_scsi_dev, name), spdk_json_decode_string },
|
||||||
|
@ -1755,23 +1755,6 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
|||||||
p.add_argument('--vq-size', help='Size of each queue', type=int)
|
p.add_argument('--vq-size', help='Size of each queue', type=int)
|
||||||
p.set_defaults(func=construct_virtio_dev)
|
p.set_defaults(func=construct_virtio_dev)
|
||||||
|
|
||||||
def construct_virtio_user_scsi_bdev(args):
|
|
||||||
print_array(rpc.vhost.construct_virtio_user_scsi_bdev(args.client,
|
|
||||||
path=args.path,
|
|
||||||
name=args.name,
|
|
||||||
vq_count=args.vq_count,
|
|
||||||
vq_size=args.vq_size))
|
|
||||||
|
|
||||||
p = subparsers.add_parser('construct_virtio_user_scsi_bdev', help="""Connect to virtio user scsi device.
|
|
||||||
This imply scan and add bdevs offered by remote side.
|
|
||||||
Result is array of added bdevs.""")
|
|
||||||
p.add_argument('path', help='Path to Virtio SCSI socket')
|
|
||||||
p.add_argument('name', help="""Use this name as base instead of 'VirtioScsiN'
|
|
||||||
Base will be used to construct new bdev's found on target by adding 't<TARGET_ID>' sufix.""")
|
|
||||||
p.add_argument('--vq-count', help='Number of virtual queues to be used.', type=int)
|
|
||||||
p.add_argument('--vq-size', help='Size of each queue', type=int)
|
|
||||||
p.set_defaults(func=construct_virtio_user_scsi_bdev)
|
|
||||||
|
|
||||||
def construct_virtio_pci_scsi_bdev(args):
|
def construct_virtio_pci_scsi_bdev(args):
|
||||||
print_array(rpc.vhost.construct_virtio_pci_scsi_bdev(args.client,
|
print_array(rpc.vhost.construct_virtio_pci_scsi_bdev(args.client,
|
||||||
pci_address=args.pci_address,
|
pci_address=args.pci_address,
|
||||||
|
@ -155,25 +155,6 @@ def construct_virtio_dev(client, name, trtype, traddr, dev_type, vq_count=None,
|
|||||||
return client.call('construct_virtio_dev', params)
|
return client.call('construct_virtio_dev', params)
|
||||||
|
|
||||||
|
|
||||||
def construct_virtio_user_scsi_bdev(client, path, name, vq_count=None, vq_size=None):
|
|
||||||
"""Connect to virtio user scsi device.
|
|
||||||
Args:
|
|
||||||
path: path to Virtio SCSI socket
|
|
||||||
name: use this name as base instead of 'VirtioScsiN'
|
|
||||||
vq_count: number of virtual queues to be used
|
|
||||||
vq_size: size of each queue
|
|
||||||
"""
|
|
||||||
params = {
|
|
||||||
'path': path,
|
|
||||||
'name': name,
|
|
||||||
}
|
|
||||||
if vq_count:
|
|
||||||
params['vq_count'] = vq_count
|
|
||||||
if vq_size:
|
|
||||||
params['vq_size'] = vq_size
|
|
||||||
return client.call('construct_virtio_user_scsi_bdev', params)
|
|
||||||
|
|
||||||
|
|
||||||
def construct_virtio_pci_scsi_bdev(client, pci_address, name):
|
def construct_virtio_pci_scsi_bdev(client, pci_address, name):
|
||||||
"""Create a Virtio SCSI device from a virtio-pci device.
|
"""Create a Virtio SCSI device from a virtio-pci device.
|
||||||
Args:
|
Args:
|
||||||
|
Loading…
Reference in New Issue
Block a user