Revert "ci/fix: upgrade QEMU on windows"

This commit is contained in:
Nicholas Bishop 2026-01-25 23:21:36 -05:00 committed by GitHub
parent c417fbc332
commit 98f0d5c33c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 27 deletions

View file

@ -65,7 +65,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Install QEMU
run: choco install qemu --version 2025.12.24
run: choco install qemu --version 2023.4.24
- name: Checkout sources
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2

View file

@ -312,38 +312,20 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
UefiArch::AArch64 => "qemu-system-aarch64",
UefiArch::IA32 | UefiArch::X86_64 => "qemu-system-x86_64",
};
let mut cmd = Command::new(qemu_exe);
// The QEMU installer for Windows does not automatically add the
// directory containing the QEMU executables to the PATH. Add
// the default directory to the PATH to make it more likely that
// QEMU will be found on Windows. (The directory is appended, so
// if a different directory on the PATH already has the QEMU
// binary this change won't affect anything.)
let fn_append_win_path = |cmd: &mut Command| {
if platform::is_windows() {
// The QEMU installer for Windows does not automatically add the
// directory containing the QEMU executables to the PATH. Add
// the default directory to the PATH to make it more likely that
// QEMU will be found on Windows. (The directory is appended, so
// if a different directory on the PATH already has the QEMU
// binary this change won't affect anything.)
let mut path = env::var_os("PATH").unwrap_or_default();
path.push(r";C:\Program Files\qemu");
cmd.env("PATH", path);
};
// Print the QEMU version
{
let mut cmd = Command::new(qemu_exe);
if platform::is_windows() {
fn_append_win_path(&mut cmd)
};
cmd.arg("--version");
let output = cmd.output()?;
eprintln!("QEMU:");
eprintln!(" binary : {qemu_exe}");
eprintln!(" version: {}", String::from_utf8(output.stdout)?);
}
// Construct the actual QEMU argument
let mut cmd = Command::new(qemu_exe);
if platform::is_windows() {
fn_append_win_path(&mut cmd)
};
// Disable default devices.
// QEMU by defaults enables a ton of devices which slow down boot.
cmd.arg("-nodefaults");