Skip to content

Commit

Permalink
Merge pull request #5026 from meinaLi/booting_base
Browse files Browse the repository at this point in the history
guest_os_booting_base.py: add firmware_type argument for ovmf guest
  • Loading branch information
dzhengfy authored Jul 17, 2023
2 parents 19469e7 + 61a5e00 commit 24f2826
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions provider/guest_os_booting/guest_os_booting_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
LOG = log.getLogger('avocado.' + __name__)


def prepare_os_xml(vm_name, os_dict):
def prepare_os_xml(vm_name, os_dict, firmware_type=None):
"""
Prepare a guest with related os loader xml.
:params vm_name: the name of guest
:params os_dict: the dict of os elements
:params firmware_type: seabios or ovmf
"""
vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)
vmxml.os = libvirt_bios.remove_bootconfig_items_from_vmos(vmxml.os)
if firmware_type == "ovmf":
vmxml.os = libvirt_bios.remove_bootconfig_items_from_vmos(vmxml.os)
LOG.debug("Set the os xml")
vmxml.setup_attrs(os=os_dict)
vmxml.sync()
Expand Down Expand Up @@ -45,7 +47,7 @@ def prepare_smm_xml(vm_name, smm_state, smm_size):
return vmxml


def check_vm_startup(vm, vm_name, error_msg):
def check_vm_startup(vm, vm_name, error_msg=None):
"""
Start and boot the guest
Expand Down

0 comments on commit 24f2826

Please sign in to comment.