From 97c79fd598d6e58f2343e909224f812a09b37b8b Mon Sep 17 00:00:00 2001 From: Kunhui-Li Date: Wed, 10 Nov 2021 13:39:00 +0800 Subject: [PATCH] config_tools: fix the duplicate PT_SLOT value issue in UI when we add two or more virtio block devices and rename them for a VM in launch xml files, then generate launch scripts through the UI. After ensuring the devices names are different, we repeat these operations continuously. Finally we will get the duplicate PT_SLOT value for different virtio block devices in a launch script. This is wrong. After user click the "Generate Launch Script" button to generate the launch scripts every time, we will reset PT_SLOT variate to fix the issue. Tracked-On: #6767 Signed-off-by: Kunhui-Li --- misc/config_tools/launch_config/launch_cfg_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index f6afa62bd..d8a47257e 100644 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -112,6 +112,7 @@ def ui_entry_api(board_info, scenario_info, launch_info, out=''): return err_dic err_dic = main(arg_list) + launch_cfg_lib.reset_pt_slot() return err_dic @@ -154,7 +155,6 @@ def generate_script_file(names, pt_sel, virt_io, dm, sriov, vmid, config): print("{}".format(header_info), file=config) com.gen(names, pt_sel, virt_io, dm, sriov, vmid, config) - launch_cfg_lib.reset_pt_slot() if launch_cfg_lib.ERR_LIST: return launch_cfg_lib.ERR_LIST