bdev/virtio: Remove deprecated construct_virtio_pci_scsi_bdev rpc
Marked as deprecated in 18.10 Change-Id: If7e105194e2ca8227b3b50b8e7b02c633c27daaf Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/442415 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
8683a0fda1
commit
63edd8bad0
@ -278,7 +278,6 @@ Example response:
|
||||
"get_virtio_scsi_devs",
|
||||
"remove_virtio_bdev",
|
||||
"remove_virtio_scsi_bdev",
|
||||
"construct_virtio_pci_scsi_bdev",
|
||||
"delete_aio_bdev",
|
||||
"construct_aio_bdev",
|
||||
"destruct_split_vbdev",
|
||||
@ -2276,13 +2275,6 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
|
||||
## construct_virtio_pci_scsi_bdev {#rpc_construct_virtio_pci_scsi_bdev}
|
||||
|
||||
This is legacy RPC method. It is equivalent of @ref rpc_construct_virtio_dev with `trtype` set to `pci` and `dev_type` set to `scsi`.
|
||||
|
||||
Because it will be deprecated soon it is intentionally undocumented.
|
||||
|
||||
## construct_virtio_user_blk_bdev {#rpc_construct_virtio_user_blk_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 `blk`.
|
||||
|
@ -43,112 +43,6 @@
|
||||
#define SPDK_VIRTIO_USER_DEFAULT_VQ_COUNT 1
|
||||
#define SPDK_VIRTIO_USER_DEFAULT_QUEUE_SIZE 512
|
||||
|
||||
struct rpc_construct_virtio_scsi_dev {
|
||||
char *path;
|
||||
char *pci_address;
|
||||
char *name;
|
||||
uint32_t vq_count;
|
||||
uint32_t vq_size;
|
||||
struct spdk_jsonrpc_request *request;
|
||||
|
||||
};
|
||||
|
||||
static void
|
||||
free_rpc_construct_virtio_scsi_dev(struct rpc_construct_virtio_scsi_dev *req)
|
||||
{
|
||||
if (!req) {
|
||||
return;
|
||||
}
|
||||
|
||||
free(req->path);
|
||||
free(req->pci_address);
|
||||
free(req->name);
|
||||
free(req);
|
||||
}
|
||||
|
||||
static void
|
||||
rpc_construct_virtio_scsi_dev_cb(void *ctx, int result, struct spdk_bdev **bdevs, size_t cnt)
|
||||
{
|
||||
struct rpc_construct_virtio_scsi_dev *req = ctx;
|
||||
struct spdk_json_write_ctx *w;
|
||||
size_t i;
|
||||
|
||||
if (result) {
|
||||
spdk_jsonrpc_send_error_response(req->request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
spdk_strerror(-result));
|
||||
free_rpc_construct_virtio_scsi_dev(req);
|
||||
return;
|
||||
}
|
||||
|
||||
w = spdk_jsonrpc_begin_result(req->request);
|
||||
if (w) {
|
||||
spdk_json_write_array_begin(w);
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
spdk_json_write_string(w, spdk_bdev_get_name(bdevs[i]));
|
||||
}
|
||||
|
||||
spdk_json_write_array_end(w);
|
||||
spdk_jsonrpc_end_result(req->request, w);
|
||||
}
|
||||
|
||||
free_rpc_construct_virtio_scsi_dev(ctx);
|
||||
}
|
||||
|
||||
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 },
|
||||
{"name", offsetof(struct rpc_construct_virtio_scsi_dev, name), spdk_json_decode_string },
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_construct_virtio_pci_scsi_dev(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_construct_virtio_scsi_dev *req;
|
||||
struct spdk_pci_addr pci_addr;
|
||||
int rc;
|
||||
|
||||
SPDK_WARNLOG("construct_virtio_pci_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->path = NULL;
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_construct_virtio_pci_scsi_dev,
|
||||
SPDK_COUNTOF(rpc_construct_virtio_pci_scsi_dev),
|
||||
req)) {
|
||||
rc = -EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
if (spdk_pci_addr_parse(&pci_addr, req->pci_address) != 0) {
|
||||
SPDK_ERRLOG("Invalid PCI address '%s'\n", req->pci_address);
|
||||
rc = -EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
req->request = request;
|
||||
rc = bdev_virtio_pci_scsi_dev_create(req->name, &pci_addr,
|
||||
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_pci_scsi_bdev", spdk_rpc_construct_virtio_pci_scsi_dev,
|
||||
SPDK_RPC_RUNTIME);
|
||||
|
||||
struct rpc_remove_virtio_dev {
|
||||
char *name;
|
||||
};
|
||||
|
@ -1755,19 +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.set_defaults(func=construct_virtio_dev)
|
||||
|
||||
def construct_virtio_pci_scsi_bdev(args):
|
||||
print_array(rpc.vhost.construct_virtio_pci_scsi_bdev(args.client,
|
||||
pci_address=args.pci_address,
|
||||
name=args.name))
|
||||
|
||||
p = subparsers.add_parser('construct_virtio_pci_scsi_bdev', help="""Create a Virtio
|
||||
SCSI device from a virtio-pci device.""")
|
||||
p.add_argument('pci_address', help="""PCI address in domain:bus:device.function format or
|
||||
domain.bus.device.function format""")
|
||||
p.add_argument('name', help="""Name for the virtio device.
|
||||
It will be inhereted by all created bdevs, which are named n the following format: <name>t<target_id>""")
|
||||
p.set_defaults(func=construct_virtio_pci_scsi_bdev)
|
||||
|
||||
def get_virtio_scsi_devs(args):
|
||||
print_dict(rpc.vhost.get_virtio_scsi_devs(args.client))
|
||||
|
||||
|
@ -155,22 +155,6 @@ def construct_virtio_dev(client, name, trtype, traddr, dev_type, vq_count=None,
|
||||
return client.call('construct_virtio_dev', params)
|
||||
|
||||
|
||||
def construct_virtio_pci_scsi_bdev(client, pci_address, name):
|
||||
"""Create a Virtio SCSI device from a virtio-pci device.
|
||||
Args:
|
||||
pci_address: PCI address in domain:bus:device.function format or
|
||||
domain.bus.device.function format
|
||||
name: Name for the virtio device. It will be inhereted by all created
|
||||
bdevs, which are named n the following format:
|
||||
<name>t<target_id>
|
||||
"""
|
||||
params = {
|
||||
'pci_address': pci_address,
|
||||
'name': name,
|
||||
}
|
||||
return client.call('construct_virtio_pci_scsi_bdev', params)
|
||||
|
||||
|
||||
def remove_virtio_scsi_bdev(client, name):
|
||||
"""Remove a Virtio-SCSI device
|
||||
This will delete all bdevs exposed by this device.
|
||||
|
Loading…
Reference in New Issue
Block a user