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

rpc: rename get_vhost_controllers to vhost_get_controllers

parent bb9d17a5
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -4623,7 +4623,7 @@ Example response:
}
~~~

## get_vhost_controllers {#rpc_get_vhost_controllers}
## vhost_get_controllers {#rpc_vhost_get_controllers}

Display information about all or specific vhost controller(s).

@@ -4637,7 +4637,7 @@ Name | Optional | Type | Description
name                    | Optional | string      | Vhost controller name


### Response {#rpc_get_vhost_controllers_response}
### Response {#rpc_vhost_get_controllers_response}

Response is an array of objects describing requested controller(s). Common fields are:

@@ -4649,7 +4649,7 @@ delay_base_us | number | Base (minimum) coalescing time in micros
iops_threshold          | number      | Coalescing activation level
backend_specific        | object      | Backend specific informations

### Vhost block {#rpc_get_vhost_controllers_blk}
### Vhost block {#rpc_vhost_get_controllers_blk}

`backend_specific` contains one `block` object  of type:

@@ -4658,7 +4658,7 @@ Name | Type | Description
bdev                    | string      | Backing bdev name or Null if bdev is hot-removed
readonly                | boolean     | True if controllers is readonly, false otherwise

### Vhost SCSI {#rpc_get_vhost_controllers_scsi}
### Vhost SCSI {#rpc_vhost_get_controllers_scsi}

`backend_specific` contains `scsi` array of following objects:

@@ -4667,9 +4667,9 @@ Name | Type | Description
target_name             | string      | Name of this SCSI target
id                      | number      | Unique SPDK global SCSI target ID
scsi_dev_num            | number      | SCSI target ID initiator will see when scanning this controller
luns                    | array       | array of objects describing @ref rpc_get_vhost_controllers_scsi_luns
luns                    | array       | array of objects describing @ref rpc_vhost_get_controllers_scsi_luns

### Vhost SCSI LUN {#rpc_get_vhost_controllers_scsi_luns}
### Vhost SCSI LUN {#rpc_vhost_get_controllers_scsi_luns}

Object of type:

@@ -4678,7 +4678,7 @@ Name | Type | Description
id                      | number      | SCSI LUN ID
bdev_name               | string      | Backing bdev name

### Vhost NVMe {#rpc_get_vhost_controllers_nvme}
### Vhost NVMe {#rpc_vhost_get_controllers_nvme}

`backend_specific` contains `namespaces` array of following objects:

@@ -4694,7 +4694,7 @@ Example request:
~~~
{
  "jsonrpc": "2.0",
  "method": "get_vhost_controllers",
  "method": "vhost_get_controllers",
  "id": 1
}
~~~
+3 −2
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ free_rpc_get_vhost_ctrlrs(struct rpc_get_vhost_ctrlrs *req)
}

static void
spdk_rpc_get_vhost_controllers(struct spdk_jsonrpc_request *request,
spdk_rpc_vhost_get_controllers(struct spdk_jsonrpc_request *request,
			       const struct spdk_json_val *params)
{
	struct rpc_get_vhost_ctrlrs req = {0};
@@ -452,7 +452,8 @@ invalid:
	spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
					 spdk_strerror(-rc));
}
SPDK_RPC_REGISTER("get_vhost_controllers", spdk_rpc_get_vhost_controllers, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER("vhost_get_controllers", spdk_rpc_vhost_get_controllers, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_get_controllers, get_vhost_controllers)


struct rpc_vhost_ctrlr_coalescing {
+5 −4
Original line number Diff line number Diff line
@@ -1938,12 +1938,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
    p.add_argument('bdev_name', help='block device name for a new Namespace')
    p.set_defaults(func=vhost_nvme_controller_add_ns)

    def get_vhost_controllers(args):
        print_dict(rpc.vhost.get_vhost_controllers(args.client, args.name))
    def vhost_get_controllers(args):
        print_dict(rpc.vhost.vhost_get_controllers(args.client, args.name))

    p = subparsers.add_parser('get_vhost_controllers', help='List all or specific vhost controller(s)')
    p = subparsers.add_parser('vhost_get_controllers', aliases=['get_vhost_controllers'],
                              help='List all or specific vhost controller(s)')
    p.add_argument('-n', '--name', help="Name of vhost controller", required=False)
    p.set_defaults(func=get_vhost_controllers)
    p.set_defaults(func=vhost_get_controllers)

    def vhost_delete_controller(args):
        rpc.vhost.vhost_delete_controller(args.client,
+3 −2
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ def construct_vhost_blk_controller(client, ctrlr, dev_name, cpumask=None, readon
    return client.call('construct_vhost_blk_controller', params)


def get_vhost_controllers(client, name=None):
@deprecated_alias('get_vhost_controllers')
def vhost_get_controllers(client, name=None):
    """Get information about configured vhost controllers.

    Args:
@@ -127,7 +128,7 @@ def get_vhost_controllers(client, name=None):
    params = {}
    if name:
        params['name'] = name
    return client.call('get_vhost_controllers', params)
    return client.call('vhost_get_controllers', params)


@deprecated_alias('remove_vhost_controller')
+4 −4
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ class UIVhostBlk(UIVhost):

    def refresh(self):
        self._children = set([])
        for ctrlr in self.get_root().get_vhost_controllers(ctrlr_type=self.name):
        for ctrlr in self.get_root().vhost_get_controllers(ctrlr_type=self.name):
            UIVhostBlkCtrlObj(ctrlr, self)

    def ui_command_create(self, name, bdev, cpumask=None, readonly=False):
@@ -706,7 +706,7 @@ class UIVhostScsi(UIVhost):

    def refresh(self):
        self._children = set([])
        for ctrlr in self.get_root().get_vhost_controllers(ctrlr_type=self.name):
        for ctrlr in self.get_root().vhost_get_controllers(ctrlr_type=self.name):
            UIVhostScsiCtrlObj(ctrlr, self)

    def ui_command_create(self, name, cpumask=None):
@@ -756,7 +756,7 @@ class UIVhostScsiCtrlObj(UIVhostCtrl):
        """
        self.get_root().vhost_scsi_controller_remove_target(ctrlr=self.ctrlr.ctrlr,
                                                            scsi_target_num=int(target_num))
        for ctrlr in self.get_root().get_vhost_controllers(ctrlr_type="scsi"):
        for ctrlr in self.get_root().vhost_get_controllers(ctrlr_type="scsi"):
            if ctrlr.ctrlr == self.ctrlr.ctrlr:
                self.ctrlr = ctrlr

@@ -773,7 +773,7 @@ class UIVhostScsiCtrlObj(UIVhostCtrl):
        self.get_root().vhost_scsi_controller_add_target(ctrlr=self.ctrlr.ctrlr,
                                                         scsi_target_num=int(target_num),
                                                         bdev_name=bdev_name)
        for ctrlr in self.get_root().get_vhost_controllers(ctrlr_type="scsi"):
        for ctrlr in self.get_root().vhost_get_controllers(ctrlr_type="scsi"):
            if ctrlr.ctrlr == self.ctrlr.ctrlr:
                self.ctrlr = ctrlr

Loading