Skip to content

Commit

Permalink
qemu_get_config.py: fix name 'PMU' is not defined issue
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xupengfe authored and ysun committed Oct 17, 2023
1 parent fdabb13 commit 970ae05
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions guest-test/qemu_get_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down

0 comments on commit 970ae05

Please sign in to comment.