bdev/virtio: Remove deprecated construct_virtio_pci_blk_dev rpc
Marked as deprecated in 18.10 release. Change-Id: Icbe3ef087ba681189f9b440e4b9cecaad02eb874 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/442417 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
766b7ef2ed
commit
9a016643dc
@ -273,7 +273,6 @@ Example response:
|
||||
"kill_instance",
|
||||
"scan_ioat_copy_engine",
|
||||
"construct_virtio_dev",
|
||||
"construct_virtio_pci_blk_bdev",
|
||||
"get_virtio_scsi_devs",
|
||||
"remove_virtio_bdev",
|
||||
"remove_virtio_scsi_bdev",
|
||||
@ -2274,13 +2273,6 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
|
||||
## construct_virtio_pci_blk_bdev {#rpc_construct_virtio_pci_blk_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 `blk`.
|
||||
|
||||
Because it will be deprecated soon it is intentionally undocumented.
|
||||
|
||||
## get_virtio_scsi_devs {#rpc_get_virtio_scsi_devs}
|
||||
|
||||
Show information about all available Virtio SCSI devices.
|
||||
|
@ -182,80 +182,6 @@ spdk_rpc_get_virtio_scsi_devs(struct spdk_jsonrpc_request *request,
|
||||
}
|
||||
SPDK_RPC_REGISTER("get_virtio_scsi_devs", spdk_rpc_get_virtio_scsi_devs, SPDK_RPC_RUNTIME)
|
||||
|
||||
struct rpc_construct_virtio_blk_dev {
|
||||
char *path;
|
||||
char *pci_address;
|
||||
char *name;
|
||||
uint32_t vq_count;
|
||||
uint32_t vq_size;
|
||||
};
|
||||
|
||||
static void
|
||||
free_rpc_construct_virtio_blk_dev(struct rpc_construct_virtio_blk_dev *req)
|
||||
{
|
||||
free(req->path);
|
||||
free(req->pci_address);
|
||||
free(req->name);
|
||||
}
|
||||
|
||||
static const struct spdk_json_object_decoder rpc_construct_virtio_pci_blk_dev[] = {
|
||||
{"pci_address", offsetof(struct rpc_construct_virtio_blk_dev, pci_address), spdk_json_decode_string },
|
||||
{"name", offsetof(struct rpc_construct_virtio_blk_dev, name), spdk_json_decode_string },
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_create_virtio_pci_blk_bdev(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_construct_virtio_blk_dev req = {0};
|
||||
struct spdk_json_write_ctx *w;
|
||||
struct spdk_bdev *bdev;
|
||||
struct spdk_pci_addr pci_addr;
|
||||
int rc;
|
||||
|
||||
req.pci_address = NULL;
|
||||
|
||||
SPDK_WARNLOG("construct_virtio_pci_blk_bdev command has been deprecated and will be removed "
|
||||
"in the subsequent release. Please use construct_virtio_dev instead.\n");
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_construct_virtio_pci_blk_dev,
|
||||
SPDK_COUNTOF(rpc_construct_virtio_pci_blk_dev),
|
||||
&req)) {
|
||||
free_rpc_construct_virtio_blk_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);
|
||||
free_rpc_construct_virtio_blk_dev(&req);
|
||||
rc = -EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
bdev = bdev_virtio_pci_blk_dev_create(req.name, &pci_addr);
|
||||
free_rpc_construct_virtio_blk_dev(&req);
|
||||
if (bdev == NULL) {
|
||||
rc = -EINVAL;
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
w = spdk_jsonrpc_begin_result(request);
|
||||
if (w == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_json_write_string(w, spdk_bdev_get_name(bdev));
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
return;
|
||||
|
||||
invalid:
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
spdk_strerror(-rc));
|
||||
}
|
||||
SPDK_RPC_REGISTER("construct_virtio_pci_blk_bdev", spdk_rpc_create_virtio_pci_blk_bdev,
|
||||
SPDK_RPC_RUNTIME);
|
||||
|
||||
struct rpc_construct_virtio_dev {
|
||||
char *name;
|
||||
char *trtype;
|
||||
|
@ -1779,17 +1779,6 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p.add_argument('name', help='Virtio device name. E.g. VirtioUser0')
|
||||
p.set_defaults(func=remove_virtio_bdev)
|
||||
|
||||
def construct_virtio_pci_blk_bdev(args):
|
||||
print(rpc.vhost.construct_virtio_pci_blk_bdev(args.client,
|
||||
pci_address=args.pci_address,
|
||||
name=args.name))
|
||||
|
||||
p = subparsers.add_parser('construct_virtio_pci_blk_bdev', help='Create a Virtio Blk 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 bdev')
|
||||
p.set_defaults(func=construct_virtio_pci_blk_bdev)
|
||||
|
||||
# ioat
|
||||
def scan_ioat_copy_engine(args):
|
||||
pci_whitelist = []
|
||||
|
@ -178,17 +178,3 @@ def remove_virtio_bdev(client, name):
|
||||
def get_virtio_scsi_devs(client):
|
||||
"""Get list of virtio scsi devices."""
|
||||
return client.call('get_virtio_scsi_devs')
|
||||
|
||||
|
||||
def construct_virtio_pci_blk_bdev(client, pci_address, name):
|
||||
"""Create a Virtio Blk 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 blk device
|
||||
"""
|
||||
params = {
|
||||
'pci_address': pci_address,
|
||||
'name': name,
|
||||
}
|
||||
return client.call('construct_virtio_pci_blk_bdev', params)
|
||||
|
Loading…
Reference in New Issue
Block a user