From 41bc570bfbb0c899ab057ba229ea26d29cb82bfc Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sat, 29 Aug 2026 21:04:27 +0200 Subject: [PATCH] Print qemu command --- example/alpine/Containerfile | 2 ++ src/qemu.rs | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/example/alpine/Containerfile b/example/alpine/Containerfile index a9a7f20..4317e30 100644 --- a/example/alpine/Containerfile +++ b/example/alpine/Containerfile @@ -2,6 +2,8 @@ FROM alpine:latest RUN mkdir -p /lib/apk/db /run RUN apk add --no-cache --initdb linux-virt busybox util-linux RUN cp /boot/vmlinuz-virt /vmlinuz && echo "Welcome to slim!" > /etc/motd + +# Use custom init script COPY init /init RUN chmod +x /init diff --git a/src/qemu.rs b/src/qemu.rs index 5a2d85c..5d15f3b 100644 --- a/src/qemu.rs +++ b/src/qemu.rs @@ -33,7 +33,8 @@ pub(crate) fn run(name: &str) -> Result<()> { ] .join(" "); - let status = Command::new("qemu-system-x86_64") + let mut command = Command::new("qemu-system-x86_64"); + command .args(["-m", "1024M"]) .arg("-kernel") .arg(vmlinuz_path.as_os_str()) @@ -41,7 +42,11 @@ pub(crate) fn run(name: &str) -> Result<()> { .arg(initrd_path.as_os_str()) .args(["-append", &cmdline]) .args(["-nographic"]) - .args(["-nic", "user,model=virtio-net-pci"]) + .args(["-nic", "user,model=virtio-net-pci"]); + + println!("{command:?}"); + + let status = command .status() .context("Failed to launch qemu-system-x86_64")?;