Skip to content

Commit 7bdd369

Browse files
committed
uefi: Change the test memory device to a temporary file
1 parent 3275853 commit 7bdd369

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

xtask/src/qemu.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,16 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
483483

484484
// Sixth shared memory device used for testing Pci Root Bridge I/O's Copy function.
485485
// This is to provide a PCI device with large enough memory.
486-
cmd.arg("-device");
487-
cmd.arg("ivshmem-plain,memdev=hostmem,id=hostmem");
488-
cmd.arg("-object");
489-
cmd.arg("memory-backend-file,size=1M,share,mem-path=/dev/shm/ivshmem,id=hostmem");
486+
// Currently, providing host's virtual memory to guess is not supported on Windows
487+
if !platform::is_windows() {
488+
cmd.arg("-device");
489+
cmd.arg("ivshmem-plain,memdev=tempmem,id=tempmem");
490+
cmd.arg("-object");
491+
let mut object_args = OsString::from("memory-backend-file,size=1M,id=tempmem,mem-path=");
492+
let ram_path = tmp_dir.join("copy-test.ram");
493+
object_args.push(ram_path);
494+
cmd.arg(object_args);
495+
}
490496

491497
let qemu_monitor_pipe = Pipe::new(tmp_dir, "qemu-monitor")?;
492498
let serial_pipe = Pipe::new(tmp_dir, "serial")?;

0 commit comments

Comments
 (0)