avocado-vt icon indicating copy to clipboard operation
avocado-vt copied to clipboard

refactor: Move UEFI detection to utils_misc

Open veedlaw opened this issue 1 year ago • 0 comments

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 the VMCheck 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.

veedlaw avatar Feb 22 '24 11:02 veedlaw