mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 05:02:24 +00:00
acrn-config: Fix target xml generation issue when no P-state scaling driver is present
There seems to be a corner case where target xml file fails to get generated if there was no P-state scaling driver or C-state idle driver present. This patch addresses it by handling the file not present exception and setting a warning as well a "not available" string to successfully generate target xml file. Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Tracked-On: #4199 Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
parent
8c87ee3951
commit
f3688c7e45
@ -417,6 +417,7 @@ def store_cx_data(sysnode1, sysnode2, config):
|
||||
"""
|
||||
i = 0
|
||||
state_cpus = {}
|
||||
try:
|
||||
with open(sysnode1, 'r') as acpi_idle:
|
||||
idle_driver = acpi_idle.read(32)
|
||||
|
||||
@ -430,6 +431,10 @@ def store_cx_data(sysnode1, sysnode2, config):
|
||||
parser_lib.print_yel("please make sure ACPI Cstate is enabled in BIOS.", warn=True)
|
||||
print("\t/* Cx data is not available */", file=config)
|
||||
return
|
||||
except IOError:
|
||||
parser_lib.print_yel("No idle driver found.", warn=True)
|
||||
print("\t/* Cx data is not available */", file=config)
|
||||
return
|
||||
|
||||
files = os.listdir(sysnode2)
|
||||
for d_path in files:
|
||||
@ -486,6 +491,8 @@ def store_px_data(sysnode, config):
|
||||
"""
|
||||
px_tmp = PxPkg()
|
||||
px_data = {}
|
||||
|
||||
try:
|
||||
with open(sysnode+'cpu0/cpufreq/scaling_driver', 'r') as f_node:
|
||||
freq_driver = f_node.read()
|
||||
if freq_driver.find("acpi-cpufreq") == -1:
|
||||
@ -498,6 +505,10 @@ def store_px_data(sysnode, config):
|
||||
parser_lib.print_yel("please make sure ACPI Pstate is enabled in BIOS.", warn=True)
|
||||
print("\t/* Px data is not available */", file=config)
|
||||
return
|
||||
except IOError:
|
||||
parser_lib.print_yel("No scaling_driver found.", warn=True)
|
||||
print("\t/* Px data is not available */", file=config)
|
||||
return
|
||||
|
||||
try:
|
||||
with open(sysnode+'cpufreq/boost', 'r') as f_node:
|
||||
|
Loading…
Reference in New Issue
Block a user