Skip to content

Commit

Permalink
qemu: move removable_flag into device_type
Browse files Browse the repository at this point in the history
Also drop the no longer needed noqa for the overly long line.

Followup for 1c3e71b.
  • Loading branch information
behrmann authored and DaanDeMeyer committed Oct 30, 2024
1 parent 1c3e71b commit 2ab7cc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mkosi/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,16 +1288,16 @@ def add_virtiofs_mount(
direct = fname.stat().st_size % resource.getpagesize() == 0
ephemeral = config.ephemeral
cache = f"cache.writeback=on,cache.direct={yes_no(direct)},cache.no-flush={yes_no(ephemeral)},aio=io_uring" # noqa: E501

device_type = "virtio-blk-pci"
removable_flag = ""
if config.qemu_cdrom:
device_type = "scsi-cd"
elif config.qemu_removable:
device_type = "scsi-hd"
removable_flag = ",removable=on"
device_type = "scsi-hd,removable=on"

cmdline += [
"-drive", f"if=none,id=mkosi,file={fname},format=raw,discard=on,{cache}",
"-device", f"{device_type},drive=mkosi,bootindex=1{removable_flag}", # noqa: E501
"-device", f"{device_type},drive=mkosi,bootindex=1",
] # fmt: skip

if config.qemu_swtpm == ConfigFeature.enabled or (
Expand Down

0 comments on commit 2ab7cc6

Please sign in to comment.