Commit d7c00c17 authored by Pawel Kaminski's avatar Pawel Kaminski Committed by Jim Harris
Browse files

rpc: Rename construct_vhost_blk_controller to vhost_create_blk_controller

parent 8fbf2b68
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4580,9 +4580,9 @@ Example response:
}
~~~

## construct_vhost_blk_controller {#rpc_construct_vhost_blk_controller}
## vhost_create_blk_controller {#rpc_vhost_create_blk_controller}

Construct vhost block controller
Create vhost block controller

If `readonly` is `true` then vhost block target will be created as read only and fail any write requests.
The `VIRTIO_BLK_F_RO` feature flag will be offered to the initiator.
@@ -4608,7 +4608,7 @@ Example request:
    "ctrlr": "VhostBlk0"
  },
  "jsonrpc": "2.0",
  "method": "construct_vhost_blk_controller",
  "method": "vhost_create_blk_controller",
  "id": 1
}
~~~
+4 −4
Original line number Diff line number Diff line
@@ -161,14 +161,14 @@ always CPU 0. For NUMA systems, the cpumask should specify cores on the same CPU
socket as its associated VM.

~~~{.sh}
scripts/rpc.py construct_vhost_blk_controller --cpumask 0x1 vhost.1 Malloc0
scripts/rpc.py vhost_create_blk_controller --cpumask 0x1 vhost.1 Malloc0
~~~

It is also possible to construct a read-only vhost-blk device by specifying an
It is also possible to create a read-only vhost-blk device by specifying an
extra `-r` or `--readonly` parameter.

~~~{.sh}
scripts/rpc.py construct_vhost_blk_controller --cpumask 0x1 -r vhost.1 Malloc0
scripts/rpc.py vhost_create_blk_controller --cpumask 0x1 -r vhost.1 Malloc0
~~~

### Vhost-NVMe (experimental)
@@ -295,7 +295,7 @@ Malloc1
~~~

~~~{.sh}
host:~# ./scripts/rpc.py construct_vhost_blk_controller --cpumask 0x2 vhost.1 Malloc1
host:~# ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.1 Malloc1
vhost_blk.c: 719:spdk_vhost_blk_construct: *NOTICE*: Controller vhost.1: using bdev 'Malloc1'
~~~

+1 −1
Original line number Diff line number Diff line
@@ -807,7 +807,7 @@ vhost_blk_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_
	}

	spdk_json_write_object_begin(w);
	spdk_json_write_named_string(w, "method", "construct_vhost_blk_controller");
	spdk_json_write_named_string(w, "method", "vhost_create_blk_controller");

	spdk_json_write_named_object_begin(w, "params");
	spdk_json_write_named_string(w, "ctrlr", vdev->name);
+4 −3
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ free_rpc_vhost_blk_ctrlr(struct rpc_vhost_blk_ctrlr *req)
}

static void
spdk_rpc_construct_vhost_blk_controller(struct spdk_jsonrpc_request *request,
spdk_rpc_vhost_create_blk_controller(struct spdk_jsonrpc_request *request,
				     const struct spdk_json_val *params)
{
	struct rpc_vhost_blk_ctrlr req = {0};
@@ -293,8 +293,9 @@ invalid:
					 spdk_strerror(-rc));

}
SPDK_RPC_REGISTER("construct_vhost_blk_controller", spdk_rpc_construct_vhost_blk_controller,
SPDK_RPC_REGISTER("vhost_create_blk_controller", spdk_rpc_vhost_create_blk_controller,
		  SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_create_blk_controller, construct_vhost_blk_controller)

struct rpc_delete_vhost_ctrlr {
	char *ctrlr;
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ bdev_dict["bdev_virtio_attach_controller"] = []

vhost_dict = OrderedDict()
vhost_dict["vhost_create_scsi_controller"] = []
vhost_dict["construct_vhost_blk_controller"] = []
vhost_dict["vhost_create_blk_controller"] = []
vhost_dict["vhost_create_nvme_controller"] = []

iscsi_dict = OrderedDict()
@@ -434,7 +434,7 @@ def get_vhost_blk_json(config, section):
    ]
    for option in config.options(section):
        set_param(params, option, config.get(section, option))
    return [{"method": "construct_vhost_blk_controller",
    return [{"method": "vhost_create_blk_controller",
            "params": to_json_params(params)}]


Loading