avocado-vt
avocado-vt copied to clipboard
refactor: Move UEFI detection to utils_misc
Previously, the UEFI guest detection functions were part of the specific VMCheck classes (LinuxVMCheck
and WindowsVMCheck
) in the virttest/utils_v2v.py
file. This commit refactors and relocates these functions to the more generic virttest/utils_misc.py
file.
Motivation:
- The
is_uefi_guest
function, previously defined in theVMCheck
classes, had dependencies that were not universally available across different architectures (e.g., ovrit on s390x). - To enhance code reusability the UEFI guest detection functions are moved to the utils_misc module.
Updated Functions:
-
is_linux_uefi_guest(runner)
: Check if a Linux guest is a UEFI guest. -
is_windows_uefi_guest(runner)
: Check if a Windows guest is a UEFI guest.
These changes improve the code reusability in the codebase and make the UEFI guest detection functionality more accessible for various scenarios.