Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtio_win_installer: update the installer script #4137

Merged
merged 1 commit into from
Aug 30, 2024
Merged
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
21 changes: 13 additions & 8 deletions provider/win_driver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ def run_installer(vm, session, test, params, run_installer_cmd):
"""
Install/uninstall/repair virtio-win drivers and qxl,spice and
qemu-ga-win by installer.
If installer(virtio-win) version is bigger than 1.9.37,
then installer itself will restart vm,
otherwise it's needed to reboot vm to make sure all are
installed successfully.
If installer(virtio-win) version is in [1.9.37, 1.9.40]
then installer itself will restart vm for installation and
uninstallation function; otherwise there is no need to reboot guest.
While for repair function, installer itself always restart vm by
itself;

:param vm: vm object.
:param session: The guest session object.
Expand All @@ -196,7 +197,7 @@ def run_installer(vm, session, test, params, run_installer_cmd):
"""
cdrom_virtio = params["cdrom_virtio"]
installer_restart_version = params.get("installer_restart_version",
"[1.9.37.0,)")
"[1.9.37.0, 1.9.40.0]")
cdrom_virtio_path = os.path.basename(utils_misc.get_path(
data_dir.get_data_dir(), cdrom_virtio))
match = re.search(r"virtio-win-(\d+\.\d+(?:\.\d+)?-\d+)",
Expand All @@ -211,14 +212,18 @@ def run_installer(vm, session, test, params, run_installer_cmd):
params, session), 240, 2, 2):
test.fail("Autoit exe stop there for 240s,"
" please have a check.")

if cdrom_virtio_version in VersionInterval(installer_restart_version):
restart_con_ver = cdrom_virtio_version in VersionInterval(
installer_restart_version)
restart_con_repair = "repair" in run_installer_cmd
if restart_con_ver or restart_con_repair:
# Wait for vm re-start by installer itself
if not utils_misc.wait_for(lambda: not session.is_responsive(),
120, 5, 5):
test.fail("The previous session still exists,"
"seems that the vm doesn't restart.")
session = vm.wait_for_login(timeout=360)
else:
xiagao marked this conversation as resolved.
Show resolved Hide resolved
# for the early virtio-win instller, rebooting is needed.
if cdrom_virtio_version in VersionInterval("(,1.9.37.0)"):
session = vm.reboot(session)
return session

Expand Down
2 changes: 1 addition & 1 deletion qemu/tests/cfg/win_virtio_driver_install_by_installer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
run_uninstall_cmd = 'WIN_UTILS:\AutoIt3_%PROCESSOR_ARCHITECTURE%.exe C:\uninstall.au3'
signed_check_cmd = 'wmic product where name="Virtio-win-driver-installer" | findstr "Red Hat, Inc."'
# set virtio_win version range to determine the diff behavior of installer
installer_restart_version = [1.9.37.0,)
installer_restart_version = [1.9.37.0, 1.9.40.0]
monitor_type = qmp
monitors = qmp1
mem_stat_check_list = 'stat-free-memory'
Expand Down
Loading