From 970ae05559a859fa86ddbee40729499608cd1799 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Fri, 13 Oct 2023 16:51:47 +0800 Subject: [PATCH] qemu_get_config.py: fix name 'PMU' is not defined issue If test_params.py doesn't define PMU, qemu_get_config.py will report below error: " NameError: name 'PMU' is not defined " Fix this type of error issue. Signed-off-by: Pengfei Xu --- guest-test/qemu_get_config.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/guest-test/qemu_get_config.py b/guest-test/qemu_get_config.py index 17adcf03..d9e906d0 100755 --- a/guest-test/qemu_get_config.py +++ b/guest-test/qemu_get_config.py @@ -53,37 +53,37 @@ # test_params.py is generated by test_launcher.sh for both qemu_runner.py and test_executor.sh # O-list variables default value from qemu.config.json vm_type = qemu_config["common"]["vm_type"] -if PMU is not None: +if 'PMU' in dir(): pmu = PMU else: pmu = qemu_config["common"]["pmu"] -if VCPU is not None: +if 'VCPU' in dir(): cpus = VCPU else: cpus = qemu_config["common"]["cpus"] -if SOCKETS is not None: +if 'SOCKETS' in dir(): sockets = SOCKETS else: sockets = qemu_config["common"]["sockets"] -if MEM is not None: +if 'MEM' in dir(): mem = MEM else: mem = qemu_config["common"]["mem"] -if CMDLINE is not None: +if 'CMDLINE' in dir(): cmdline = CMDLINE else: cmdline = qemu_config["common"]["cmdline"] -if DEBUG is not None: +if 'DEBUG' in dir(): debug = DEBUG else: debug = qemu_config["common"]["debug"] -if TESTCASE is not None: +if 'TESTCASE' in dir(): testcase = TESTCASE else: print("No TESTCASE info found, can't run any test!")