]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
qemu: Set device_id for scsi-hd and scsi-cd devices 3622/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Mar 2025 09:25:35 +0000 (10:25 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Mar 2025 09:35:30 +0000 (10:35 +0100)
When we used -drive this was done automatically but that's not the
case anymore with -blockdev, so do it explicitly ourselves.

mkosi/qemu.py

index 8e6ec7770c065c12123ce27020f53a1d90efe7ba..0c406d818a9fa9dcce3be97d0c89e9df0d2a96fa 100644 (file)
@@ -1472,9 +1472,9 @@ def run_qemu(args: Args, config: Config) -> None:
 
             device_type = "virtio-blk-pci"
             if config.cdrom:
-                device_type = "scsi-cd"
+                device_type = "scsi-cd,device_id=mkosi"
             elif config.removable:
-                device_type = "scsi-hd,removable=on"
+                device_type = "scsi-hd,device_id=mkosi,removable=on"
 
             cmdline += [
                 "-blockdev", ",".join(blockdev),