Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions avocado-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def config(self):
self.shortname)
cmd = 'cp -f %s %s' % (local_cfg, cfg)
os.system(cmd)
emulator = helper.get_qemu_emulator()
if emulator != '/usr/bin/qemu-system-ppc64':
cmd = "sed -i 's#/usr/bin/qemu-system-ppc64#%s#g' %s" % (
emulator, cfg)
os.system(cmd)
self.conf = cfg
elif self.type == 'host':
local_cfg = "%s/%s/%s.cfg" % (TEST_CONF_PATH,
Expand Down
16 changes: 16 additions & 0 deletions lib/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ def is_rhel8():
return False


def get_qemu_emulator():
"""
Return the QEMU emulator binary to use for guest tests

Older releases provide /usr/bin/qemu-system-ppc64, newer ones (RHEL 10
and later) ship only /usr/libexec/qemu-kvm.

:return: path of the emulator binary which exists on the host
"""
default = "/usr/bin/qemu-system-ppc64"
alternate = "/usr/libexec/qemu-kvm"
if not os.path.exists(default) and os.path.exists(alternate):
return alternate
return default


def remove_file(src, dest):
"""
Remove Files from Destination Folder which is common in Source and Destination
Expand Down
Loading