Commit 378ad60b authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

RPC: rename get_subsystem_config to framework_get_config



Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ia0d20a04cf2dd5b23ad201d2ae9677a703ec92f3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468682


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 8710b600
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ Example response:
    "bdev_set_qos_limit",
    "bdev_get_bdevs",
    "bdev_get_iostat",
    "get_subsystem_config",
    "framework_get_config",
    "framework_get_subsystems",
    "framework_monitor_context_switch",
    "spdk_kill_instance",
@@ -402,9 +402,9 @@ Example response:
}
~~~

## get_subsystem_config {#rpc_get_subsystem_config}
## framework_get_config {#rpc_framework_get_config}

Get current configuration of the specified SPDK subsystem
Get current configuration of the specified SPDK framework

### Parameters

@@ -415,7 +415,7 @@ name | Required | string | SPDK subsystem name
### Response

The response is current configuration of the specified SPDK subsystem.
Null is returned if it is not retrievable by the get_subsystem_config method and empty array is returned if it is empty.
Null is returned if it is not retrievable by the framework_get_config method and empty array is returned if it is empty.

### Example

@@ -425,7 +425,7 @@ Example request:
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_subsystem_config",
  "method": "framework_get_config",
  "params": {
    "name": "bdev"
  }
+9 −8
Original line number Diff line number Diff line
@@ -74,24 +74,24 @@ spdk_rpc_framework_get_subsystems(struct spdk_jsonrpc_request *request,
SPDK_RPC_REGISTER("framework_get_subsystems", spdk_rpc_framework_get_subsystems, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_get_subsystems, get_subsystems)

struct rpc_get_subsystem_config {
struct rpc_framework_get_config {
	char *name;
};

static const struct spdk_json_object_decoder rpc_get_subsystem_config[] = {
	{"name", offsetof(struct rpc_get_subsystem_config, name), spdk_json_decode_string},
static const struct spdk_json_object_decoder rpc_framework_get_config[] = {
	{"name", offsetof(struct rpc_framework_get_config, name), spdk_json_decode_string},
};

static void
spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request,
spdk_rpc_framework_get_config(struct spdk_jsonrpc_request *request,
			      const struct spdk_json_val *params)
{
	struct rpc_get_subsystem_config req = {};
	struct rpc_framework_get_config req = {};
	struct spdk_json_write_ctx *w;
	struct spdk_subsystem *subsystem;

	if (spdk_json_decode_object(params, rpc_get_subsystem_config,
				    SPDK_COUNTOF(rpc_get_subsystem_config), &req)) {
	if (spdk_json_decode_object(params, rpc_framework_get_config,
				    SPDK_COUNTOF(rpc_framework_get_config), &req)) {
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid arguments");
		return;
	}
@@ -111,4 +111,5 @@ spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request,
	spdk_jsonrpc_end_result(request, w);
}

SPDK_RPC_REGISTER("get_subsystem_config", spdk_rpc_get_subsystem_config, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER("framework_get_config", spdk_rpc_framework_get_config, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_get_config, get_subsystem_config)
+5 −4
Original line number Diff line number Diff line
@@ -1836,12 +1836,13 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
    entry contain (unsorted) array of subsystems it depends on.""")
    p.set_defaults(func=framework_get_subsystems)

    def get_subsystem_config(args):
        print_dict(rpc.subsystem.get_subsystem_config(args.client, args.name))
    def framework_get_config(args):
        print_dict(rpc.subsystem.framework_get_config(args.client, args.name))

    p = subparsers.add_parser('get_subsystem_config', help="""Print subsystem configuration""")
    p = subparsers.add_parser('framework_get_config', aliases=['get_subsystem_config'],
                              help="""Print subsystem configuration""")
    p.add_argument('name', help='Name of subsystem to query')
    p.set_defaults(func=get_subsystem_config)
    p.set_defaults(func=framework_get_config)

    # vhost
    def set_vhost_controller_coalescing(args):
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ def save_config(client, fd, indent=2):
    for elem in client.call('framework_get_subsystems'):
        cfg = {
            'subsystem': elem['subsystem'],
            'config': client.call('get_subsystem_config', {"name": elem['subsystem']})
            'config': client.call('framework_get_config', {"name": elem['subsystem']})
        }
        config['subsystems'].append(cfg)

@@ -149,7 +149,7 @@ def save_subsystem_config(client, fd, indent=2, name=None):
    """
    cfg = {
        'subsystem': name,
        'config': client.call('get_subsystem_config', {"name": name})
        'config': client.call('framework_get_config', {"name": name})
    }

    _json_dump(cfg, fd, indent)
+3 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ def framework_get_subsystems(client):
    return client.call('framework_get_subsystems')


def get_subsystem_config(client, name):
@deprecated_alias('get_subsystem_config')
def framework_get_config(client, name):
    params = {'name': name}
    return client.call('get_subsystem_config', params)
    return client.call('framework_get_config', params)
Loading