From 1f24a954e488a1e09db0539f1fb850ee31b0586f Mon Sep 17 00:00:00 2001 From: DaanDeMeyer Date: Thu, 3 Jul 2025 14:50:05 +0200 Subject: [PATCH] vmspawn: Use virtio-blk-pci for image instead of virtio-scsi-pci We don't need a full blown SCSI controller just to present the main root drive device to the VM. Let's simplify the storage stack by using virtio-blk-pci instead. Additionally, virtio-blk-pci is a builtin module in Arch and Fedora which means we can do qemu direct kernel boot without needing an initrd. --- src/vmspawn/vmspawn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 2771b263498..0ddc1cdb5af 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -1942,7 +1942,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { return log_oom(); } - if (arg_image || strv_length(arg_extra_drives) > 0) { + if (strv_length(arg_extra_drives) > 0) { r = strv_extend_many(&cmdline, "-device", "virtio-scsi-pci,id=scsi"); if (r < 0) return log_oom(); @@ -1979,7 +1979,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { if (r < 0) return log_oom(); - r = strv_extend_many(&cmdline, "-device", "scsi-hd,drive=vmspawn,bootindex=1"); + r = strv_extend_many(&cmdline, "-device", "virtio-blk-pci,drive=vmspawn,bootindex=1"); if (r < 0) return log_oom(); -- 2.47.3