From 25b3a770bd9f7a7be380bbc3ca962e663a1e889d Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Tue, 12 Jan 2021 05:31:19 -0500 Subject: [PATCH] scripts/config_converter: remove always empty subsystems JSON configuration that does not contain a particular subsystem is a valid one. If needed, the defaults are always present in the subsystem itself. accel, interface, net_framework, scsi, nbd do not have legacy configuration to convert. Including those in the output of config_converter does not serve any purpose. Signed-off-by: Tomasz Zawadzki Change-Id: I6442ac1b8f65ac7271102e782068846f86c2d09f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5878 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Michal Berger Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Tested-by: SPDK CI Jenkins --- scripts/config_converter.py | 22 ++++--------------- test/config_converter/spdk_config.json | 20 ----------------- test/config_converter/spdk_config_virtio.json | 20 ----------------- 3 files changed, 4 insertions(+), 58 deletions(-) diff --git a/scripts/config_converter.py b/scripts/config_converter.py index de43062e7f..072eafcd55 100755 --- a/scripts/config_converter.py +++ b/scripts/config_converter.py @@ -35,13 +35,8 @@ nvmf_dict["subsystems"] = [] # dictionary with new config that will be written to new json config file subsystem = { - "accel": None, - "interface": None, - "net_framework": None, "bdev": bdev_dict, - "scsi": [], "nvmf": nvmf_dict, - "nbd": [], "vhost": vhost_dict, "iscsi": iscsi_dict } @@ -60,32 +55,23 @@ no_yes_map = {"no": False, "No": False, "Yes": True, "yes": True} def generate_new_json_config(): json_subsystem = [ - {'subsystem': "accel", 'config': None}, - {"subsystem": "interface", "config": None}, - {"subsystem": "net_framework", "config": None}, {"subsystem": "bdev", "config": []}, - {"subsystem": "scsi", "config": None}, {"subsystem": "nvmf", "config": []}, - {"subsystem": "nbd", "config": []}, {"subsystem": "vhost", "config": []}, {"subsystem": "iscsi", "config": []} ] for method in subsystem['bdev']: for item in subsystem['bdev'][method]: - json_subsystem[3]['config'].append(item) - for item in subsystem['scsi']: - if json_subsystem[4]['config'] is None: - json_subsystem[4]['config'] = [] - json_subsystem[4]['config'].append(item) + json_subsystem[0]['config'].append(item) for method in subsystem['nvmf']: for item in subsystem['nvmf'][method]: - json_subsystem[5]['config'].append(item) + json_subsystem[1]['config'].append(item) for method in subsystem['vhost']: for item in subsystem['vhost'][method]: - json_subsystem[7]['config'].append(item) + json_subsystem[2]['config'].append(item) for method in subsystem['iscsi']: for item in subsystem['iscsi'][method]: - json_subsystem[8]['config'].append(item) + json_subsystem[3]['config'].append(item) return {"subsystems": json_subsystem} diff --git a/test/config_converter/spdk_config.json b/test/config_converter/spdk_config.json index 297933dc6f..3276f7d1d2 100644 --- a/test/config_converter/spdk_config.json +++ b/test/config_converter/spdk_config.json @@ -1,17 +1,5 @@ { "subsystems": [ - { - "subsystem": "accel", - "config": null - }, - { - "subsystem": "interface", - "config": null - }, - { - "subsystem": "net_framework", - "config": null - }, { "subsystem": "bdev", "config": [ @@ -168,10 +156,6 @@ } ] }, - { - "subsystem": "scsi", - "config": null - }, { "subsystem": "nvmf", "config": [ @@ -306,10 +290,6 @@ } ] }, - { - "subsystem": "nbd", - "config": [] - }, { "subsystem": "vhost", "config": [ diff --git a/test/config_converter/spdk_config_virtio.json b/test/config_converter/spdk_config_virtio.json index f9608311cb..e0d3ede30e 100644 --- a/test/config_converter/spdk_config_virtio.json +++ b/test/config_converter/spdk_config_virtio.json @@ -1,17 +1,5 @@ { "subsystems": [ - { - "subsystem": "accel", - "config": null - }, - { - "subsystem": "interface", - "config": null - }, - { - "subsystem": "net_framework", - "config": null - }, { "subsystem": "bdev", "config": [ @@ -74,10 +62,6 @@ } ] }, - { - "subsystem": "scsi", - "config": null - }, { "subsystem": "nvmf", "config": [ @@ -95,10 +79,6 @@ } ] }, - { - "subsystem": "nbd", - "config": [] - }, { "subsystem": "vhost", "config": []