From: DaanDeMeyer Date: Thu, 3 Jul 2025 12:50:05 +0000 (+0200) Subject: vmspawn: Use virtio-blk-pci for image instead of virtio-scsi-pci X-Git-Tag: v258-rc1~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f24a954e488a1e09db0539f1fb850ee31b0586f;p=thirdparty%2Fsystemd.git 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. --- 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();