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

rpc: Rename remove_vhost_scsi_target to vhost_scsi_controller_remove_target

parent d4245df9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4462,7 +4462,7 @@ response:
}
~~~

## remove_vhost_scsi_target {#rpc_remove_vhost_scsi_target}
## vhost_scsi_controller_remove_target {#rpc_vhost_scsi_controller_remove_target}

Remove SCSI target ID `scsi_target_num` from vhost target `scsi_target_num`.

@@ -4487,7 +4487,7 @@ request:
    "ctrlr": "VhostScsi0"
  },
  "jsonrpc": "2.0",
  "method": "remove_vhost_scsi_target",
  "method": "vhost_scsi_controller_remove_target",
  "id": 1
}
~~~
@@ -4777,7 +4777,7 @@ Example response:
Remove vhost target.

This call will fail if there is an initiator connected or there is at least one SCSI target configured in case of
vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_remove_vhost_scsi_target.
vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_vhost_scsi_controller_remove_target.

### Parameters

+2 −2
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ scripts/rpc.py vhost_scsi_controller_add_target vhost.0 0 Malloc0
To remove a bdev from a vhost-scsi controller use the following RPC:

~~~{.sh}
scripts/rpc.py remove_vhost_scsi_target vhost.0 0
scripts/rpc.py vhost_scsi_controller_remove_target vhost.0 0
~~~

### Vhost-BLK
@@ -387,7 +387,7 @@ Just like hot-attach, the hot-detach is done by simply removing bdev from a cont
when QEMU VM is already started.

~~~{.sh}
scripts/rpc.py remove_vhost_scsi_target vhost.0 0
scripts/rpc.py vhost_scsi_controller_remove_target vhost.0 0
~~~

Removing an entire bdev will hot-detach it from a controller as well.
+7 −5
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static const struct spdk_json_object_decoder rpc_vhost_remove_target[] = {
};

static int
spdk_rpc_remove_vhost_scsi_target_finish_cb(struct spdk_vhost_dev *vdev, void *arg)
spdk_rpc_vhost_scsi_controller_remove_target_finish_cb(struct spdk_vhost_dev *vdev, void *arg)
{
	struct spdk_jsonrpc_request *request = arg;
	struct spdk_json_write_ctx *w;
@@ -193,7 +193,7 @@ spdk_rpc_remove_vhost_scsi_target_finish_cb(struct spdk_vhost_dev *vdev, void *a
}

static void
spdk_rpc_remove_vhost_scsi_target(struct spdk_jsonrpc_request *request,
spdk_rpc_vhost_scsi_controller_remove_target(struct spdk_jsonrpc_request *request,
		const struct spdk_json_val *params)
{
	struct rpc_remove_vhost_scsi_ctrlr_target req = {0};
@@ -217,7 +217,7 @@ spdk_rpc_remove_vhost_scsi_target(struct spdk_jsonrpc_request *request,
	}

	rc = spdk_vhost_scsi_dev_remove_tgt(vdev, req.scsi_target_num,
					    spdk_rpc_remove_vhost_scsi_target_finish_cb,
					    spdk_rpc_vhost_scsi_controller_remove_target_finish_cb,
					    request);
	spdk_vhost_unlock();
	if (rc < 0) {
@@ -233,7 +233,9 @@ invalid:
					 spdk_strerror(-rc));
}

SPDK_RPC_REGISTER("remove_vhost_scsi_target", spdk_rpc_remove_vhost_scsi_target, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER("vhost_scsi_controller_remove_target",
		  spdk_rpc_vhost_scsi_controller_remove_target, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_scsi_controller_remove_target, remove_vhost_scsi_target)

struct rpc_vhost_blk_ctrlr {
	char *ctrlr;
+9 −7
Original line number Diff line number Diff line
@@ -1888,15 +1888,17 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
    p.add_argument('bdev_name', help='bdev name')
    p.set_defaults(func=vhost_scsi_controller_add_target)

    def remove_vhost_scsi_target(args):
        rpc.vhost.remove_vhost_scsi_target(args.client,
    def vhost_scsi_controller_remove_target(args):
        rpc.vhost.vhost_scsi_controller_remove_target(args.client,
                                                      ctrlr=args.ctrlr,
                                                      scsi_target_num=args.scsi_target_num)

    p = subparsers.add_parser('remove_vhost_scsi_target', help='Remove target from vhost controller')
    p = subparsers.add_parser('vhost_scsi_controller_remove_target',
                              aliases=['remove_vhost_scsi_target'],
                              help='Remove target from vhost controller')
    p.add_argument('ctrlr', help='controller name to remove target from')
    p.add_argument('scsi_target_num', help='scsi_target_num', type=int)
    p.set_defaults(func=remove_vhost_scsi_target)
    p.set_defaults(func=vhost_scsi_controller_remove_target)

    def construct_vhost_blk_controller(args):
        rpc.vhost.construct_vhost_blk_controller(args.client,
+3 −2
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ def vhost_scsi_controller_add_target(client, ctrlr, scsi_target_num, bdev_name):
    return client.call('vhost_scsi_controller_add_target', params)


def remove_vhost_scsi_target(client, ctrlr, scsi_target_num):
@deprecated_alias('remove_vhost_scsi_target')
def vhost_scsi_controller_remove_target(client, ctrlr, scsi_target_num):
    """Remove target from vhost scsi controller.
    Args:
        ctrlr: controller name to remove target from
@@ -58,7 +59,7 @@ def remove_vhost_scsi_target(client, ctrlr, scsi_target_num):
        'ctrlr': ctrlr,
        'scsi_target_num': scsi_target_num
    }
    return client.call('remove_vhost_scsi_target', params)
    return client.call('vhost_scsi_controller_remove_target', params)


def construct_vhost_nvme_controller(client, ctrlr, io_queues, cpumask=None):
Loading