Skip to content

Commit

Permalink
Merge pull request #5036 from meinaLi/firmware_type
Browse files Browse the repository at this point in the history
guest_os_booting: fix loader/nvram script to use firmware_type
  • Loading branch information
dzhengfy authored Jul 26, 2023
2 parents 33cab96 + 7c51459 commit 54510bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
start_vm = no
loader_path = "/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd"
smm_state = "on"
firmware_type = "ovmf"
only q35
variants:
- positive_test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
smm_state = "on"
loader_path = "/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd"
nvram_dict = {'secure': 'yes', 'loader_readonly': 'yes', 'loader_type': 'pflash', 'loader': '${loader_path}', 'nvram_attrs': {'template': '%s'}}
firmware_type = "ovmf"
only q35
variants:
- positive_test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def run(test, params, env):
2) Start and boot the guest.
"""
vm_name = params.get("main_vm")
firmware_type = params.get("firmware_type")
loader_dict = eval(params.get("loader_dict", "{}"))
loader_xpath = eval(params.get("loader_xpath", "[]"))
smm_state = params.get("smm_state", "off")
Expand All @@ -40,7 +41,7 @@ def run(test, params, env):

try:
guest_os.prepare_smm_xml(vm_name, smm_state, "")
vmxml = guest_os.prepare_os_xml(vm_name, loader_dict)
vmxml = guest_os.prepare_os_xml(vm_name, loader_dict, firmware_type)
# stateless='yes' only use for AMD test, so here we only check the dumpxml for it to avoid the machine issue
if stateless:
virsh.start(vm_name, debug=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def run(test, params, env):
2) Start and boot the guest.
"""
vm_name = params.get("main_vm")
firmware_type = params.get("firmware_type")
smm_state = params.get("smm_state", "off")
error_msg = params.get("error_msg", "")
template_path = params.get("template_path", "")
Expand All @@ -32,7 +33,7 @@ def run(test, params, env):

try:
guest_os.prepare_smm_xml(vm_name, smm_state, smm_size=None)
guest_os.prepare_os_xml(vm_name, nvram_dict)
guest_os.prepare_os_xml(vm_name, nvram_dict, firmware_type)
guest_os.check_vm_startup(vm, vm_name, error_msg)
finally:
bkxml.sync()

0 comments on commit 54510bd

Please sign in to comment.