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

rpc: Rename construct_vhost_scsi_controller


     to vhost_create_scsi_controller

Change-Id: I17919e0808241954f5584b7fa74913b24d5635fa
Signed-off-by: default avatarPawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469260


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 074413c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4381,7 +4381,7 @@ Example response:
}
~~~

## construct_vhost_scsi_controller {#rpc_construct_vhost_scsi_controller}
## vhost_create_scsi_controller {#rpc_vhost_create_scsi_controller}

Construct vhost SCSI target.

@@ -4403,7 +4403,7 @@ Example request:
    "ctrlr": "VhostScsi0"
  },
  "jsonrpc": "2.0",
  "method": "construct_vhost_scsi_controller",
  "method": "vhost_create_scsi_controller",
  "id": 1
}
~~~
+2 −2
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ on NUMA systems, the cpumask should specify cores on the same CPU socket as its
associated VM.

~~~{.sh}
scripts/rpc.py construct_vhost_scsi_controller --cpumask 0x1 vhost.0
scripts/rpc.py vhost_create_scsi_controller --cpumask 0x1 vhost.0
~~~

The following RPC will attach the Malloc0 bdev to the vhost.0 vhost-scsi
@@ -272,7 +272,7 @@ Malloc0
~~~

~~~{.sh}
host:~# ./scripts/rpc.py construct_vhost_scsi_controller --cpumask 0x1 vhost.0
host:~# ./scripts/rpc.py vhost_create_scsi_controller --cpumask 0x1 vhost.0
VHOST_CONFIG: vhost-user server: socket created, fd: 21
VHOST_CONFIG: bind to /var/tmp/vhost.0
vhost.c: 596:spdk_vhost_dev_construct: *NOTICE*: Controller vhost.0: new controller added
+7 −6
Original line number Diff line number Diff line
@@ -56,21 +56,21 @@ free_rpc_vhost_scsi_ctrlr(struct rpc_vhost_scsi_ctrlr *req)
	free(req->cpumask);
}

static const struct spdk_json_object_decoder rpc_construct_vhost_ctrlr[] = {
static const struct spdk_json_object_decoder rpc_vhost_create_scsi_ctrlr[] = {
	{"ctrlr", offsetof(struct rpc_vhost_scsi_ctrlr, ctrlr), spdk_json_decode_string },
	{"cpumask", offsetof(struct rpc_vhost_scsi_ctrlr, cpumask), spdk_json_decode_string, true},
};

static void
spdk_rpc_construct_vhost_scsi_controller(struct spdk_jsonrpc_request *request,
spdk_rpc_vhost_create_scsi_controller(struct spdk_jsonrpc_request *request,
				      const struct spdk_json_val *params)
{
	struct rpc_vhost_scsi_ctrlr req = {0};
	struct spdk_json_write_ctx *w;
	int rc;

	if (spdk_json_decode_object(params, rpc_construct_vhost_ctrlr,
				    SPDK_COUNTOF(rpc_construct_vhost_ctrlr),
	if (spdk_json_decode_object(params, rpc_vhost_create_scsi_ctrlr,
				    SPDK_COUNTOF(rpc_vhost_create_scsi_ctrlr),
				    &req)) {
		SPDK_DEBUGLOG(SPDK_LOG_VHOST_RPC, "spdk_json_decode_object failed\n");
		rc = -EINVAL;
@@ -94,8 +94,9 @@ invalid:
	spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
					 spdk_strerror(-rc));
}
SPDK_RPC_REGISTER("construct_vhost_scsi_controller", spdk_rpc_construct_vhost_scsi_controller,
SPDK_RPC_REGISTER("vhost_create_scsi_controller", spdk_rpc_vhost_create_scsi_controller,
		  SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_create_scsi_controller, construct_vhost_scsi_controller)

struct rpc_add_vhost_scsi_ctrlr_lun {
	char *ctrlr;
+1 −1
Original line number Diff line number Diff line
@@ -1534,7 +1534,7 @@ vhost_scsi_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write
	uint32_t i;

	spdk_json_write_object_begin(w);
	spdk_json_write_named_string(w, "method", "construct_vhost_scsi_controller");
	spdk_json_write_named_string(w, "method", "vhost_create_scsi_controller");

	spdk_json_write_named_object_begin(w, "params");
	spdk_json_write_named_string(w, "ctrlr", vdev->name);
+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ bdev_dict["bdev_pmem_create"] = []
bdev_dict["bdev_virtio_attach_controller"] = []

vhost_dict = OrderedDict()
vhost_dict["construct_vhost_scsi_controller"] = []
vhost_dict["vhost_create_scsi_controller"] = []
vhost_dict["construct_vhost_blk_controller"] = []
vhost_dict["construct_vhost_nvme_controller"] = []

@@ -414,7 +414,7 @@ def get_vhost_scsi_json(config, section):
                })
    vhost_scsi_json.append({
        "params": to_json_params(params),
        "method": "construct_vhost_scsi_controller"
        "method": "vhost_create_scsi_controller"
    })
    for target in targets:
        vhost_scsi_json.append({
@@ -703,7 +703,7 @@ if __name__ == "__main__":
                items = get_iscsi_target_node_json(config, section)
            for item in items:
                if match_section == "VhostScsi":
                    section_to_subsystem[match_section]["construct_vhost_scsi_controller"].append(item)
                    section_to_subsystem[match_section]["vhost_create_scsi_controller"].append(item)
                elif match_section == "VhostNvme":
                    section_to_subsystem[match_section]["construct_vhost_nvme_controller"].append(item)
                elif match_section == "Subsystem":
Loading