bdev/virtio: deprecate old bdev construct RPCs

The 4 different RPC commands to create Virtio bdevs
have been unified to a single, yet another RPC command
in hopes the previous ones will be eventually removed.
That happened in 18.07 and now in order to remove the
old ones we mark them deprecated.

The unified RPC command was introduced in 18.07 and
has already replaced the old, separate RPCs in our
test scripts some time ago.

This patch also removes the old RPCs from doc/bdev.md
and while here, rephrases the Virtio section a bit to
make it more readable after some alphabetization
changes from the past.

jsonrpc.md already described the old RPCs as about to
be deprecated, so there are no changes required in
there.

Change-Id: I77ebf2dde56b1f4a6e4090ed76de16a97310c1c5
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/429908
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Darek Stojaczyk 2018-10-18 14:25:17 +02:00 committed by Jim Harris
parent d9208c884b
commit f3096dace8
3 changed files with 38 additions and 15 deletions

View File

@ -115,6 +115,17 @@ Two additional parameters were added to spdk_sock_get_addr() for the server
port and client port. These parameters are named "sport" and "cport"
respectively.
### Virtio
The following RPC commands have been deprecated:
- construct_virtio_user_scsi_bdev
- construct_virtio_pci_scsi_bdev
- construct_virtio_user_blk_bdev
- construct_virtio_pci_blk_bdev
They're replaced with a single `construct_virtio_dev` command that can create
any type of Virtio bdev(s).
## v18.07:
### bdev

View File

@ -388,15 +388,22 @@ To remove a block device representation use the delete_pmem_bdev command.
# Virtio Block {#bdev_config_virtio_blk}
The Virtio-Block driver can expose an SPDK bdev from a Virtio-Block device.
The Virtio-Block driver allows creating SPDK bdevs from Virtio-Block devices.
Virtio-Block bdevs are constructed the same way as Virtio-SCSI ones.
The following command creates a Virtio-Block device named `VirtioBlk0` from a vhost-user
socket `/tmp/vhost.0` exposed directly by SPDK @ref vhost. Optional `vq-count` and
`vq-size` params specify number of request queues and queue depth to be used.
`rpc.py construct_virtio_user_blk_bdev /tmp/virtio.0 VirtioBlk0 --vq-count 2 --vq-size 512`
`rpc.py construct_virtio_dev --dev-type blk --trtype user --traddr /tmp/vhost.0 --vq-count 2 --vq-size 512 VirtioBlk0`
`rpc.py construct_virtio_pci_blk_bdev 0000:01:00.0 VirtioBlk1`
The driver can be also used inside QEMU-based VMs. The following command creates a Virtio
Block device named `VirtioBlk0` from a Virtio PCI device at address `0000:00:01.0`.
The entire configuration will be read automatically from PCI Configuration Space. It will
reflect all parameters passed to QEMU's vhost-user-scsi-pci device.
Virtio-BLK devices can be removed with the following command
`rpc.py construct_virtio_dev --dev-type blk --trtype pci --traddr 0000:01:00.0 VirtioBlk1`
Virtio-Block devices can be removed with the following command
`rpc.py remove_virtio_bdev VirtioBlk0`
@ -404,18 +411,11 @@ Virtio-BLK devices can be removed with the following command
The Virtio-SCSI driver allows creating SPDK block devices from Virtio-SCSI LUNs.
The following command creates a Virtio-SCSI device named `VirtioScsi0` from a vhost-user
socket `/tmp/vhost.0` exposed directly by SPDK @ref vhost. Optional `vq-count` and
`vq-size` params specify number of request queues and queue depth to be used.
Virtio-SCSI bdevs are constructed the same way as Virtio-Block ones.
`rpc.py construct_virtio_user_scsi_bdev /tmp/vhost.0 VirtioScsi0 --vq-count 2 --vq-size 512`
`rpc.py construct_virtio_dev --dev-type scsi --trtype user --traddr /tmp/vhost.0 --vq-count 2 --vq-size 512 VirtioScsi0`
The driver can be also used inside QEMU-based VMs. The following command creates a Virtio
SCSI device named `VirtioScsi0` from a Virtio PCI device at address `0000:00:01.0`.
The entire configuration will be read automatically from PCI Configuration Space. It will
reflect all parameters passed to QEMU's vhost-user-scsi-pci device.
`rpc.py construct_virtio_pci_scsi_bdev 0000:00:01.0 VirtioScsi0`
`rpc.py construct_virtio_dev --dev-type scsi --trtype pci --traddr 0000:01:00.0 VirtioScsi0`
Each Virtio-SCSI device may export up to 64 block devices named VirtioScsi0t0 ~ VirtioScsi0t63,
one LUN (LUN0) per SCSI device. The above 2 commands will output names of all exposed bdevs.

View File

@ -109,6 +109,9 @@ spdk_rpc_create_virtio_user_scsi_bdev(struct spdk_jsonrpc_request *request,
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;
@ -156,6 +159,9 @@ spdk_rpc_construct_virtio_pci_scsi_dev(struct spdk_jsonrpc_request *request,
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;
@ -366,6 +372,9 @@ spdk_rpc_create_virtio_user_blk_bdev(struct spdk_jsonrpc_request *request,
req.vq_count = SPDK_VIRTIO_USER_DEFAULT_VQ_COUNT;
req.vq_size = SPDK_VIRTIO_USER_DEFAULT_QUEUE_SIZE;
SPDK_WARNLOG("construct_virtio_user_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_user_blk_dev,
SPDK_COUNTOF(rpc_construct_virtio_user_blk_dev),
&req)) {
@ -414,6 +423,9 @@ spdk_rpc_create_virtio_pci_blk_bdev(struct spdk_jsonrpc_request *request,
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)) {