qemu_vsock_cid: int
qemu_swtpm: ConfigFeature
qemu_cdrom: bool
+ qemu_removable: bool
qemu_firmware: QemuFirmware
qemu_firmware_variables: Optional[Path]
qemu_kernel: Optional[Path]
parse=config_parse_boolean,
help="Attach the image as a CD-ROM to the virtual machine",
),
+ ConfigSetting(
+ dest="qemu_removable",
+ metavar="BOOLEAN",
+ nargs="?",
+ section="Host",
+ parse=config_parse_boolean,
+ help="Attach the image as a removable drive to the virtual machine",
+ ),
ConfigSetting(
dest="qemu_firmware",
section="Host",
cache = f"cache.writeback=on,cache.direct={yes_no(direct)},cache.no-flush={yes_no(ephemeral)},aio=io_uring" # noqa: E501
cmdline += [
"-drive", f"if=none,id=mkosi,file={fname},format=raw,discard=on,{cache}",
- "-device", f"scsi-{'cd' if config.qemu_cdrom else 'hd'},drive=mkosi,bootindex=1",
+ "-device", f"scsi-{'cd' if config.qemu_cdrom else 'hd'},drive=mkosi,bootindex=1{',removable=on' if config.qemu_removable else ''}", # noqa: E501
] # fmt: skip
if config.qemu_swtpm == ConfigFeature.enabled or (
attach the image to the virtual machine as a CD-ROM device. Takes a
boolean. Defaults to `no`.
+`QemuRemovable=`, `--qemu-removable=`
+: When used with the `qemu` verb, this option specifies whether to attach the image to the virtual machine
+ as a removable device. Takes a boolean. Defaults to `no`.
+
`QemuFirmware=`, `--qemu-firmware=`
: When used with the `qemu` verb, this option specifies which firmware
to use. Takes one of `uefi`, `uefi-secure-boot`, `bios`, `linux`, or
"QemuKernel": null,
"QemuKvm": "auto",
"QemuMem": 123,
+ "QemuRemovable": false,
"QemuSmp": 2,
"QemuSwtpm": "auto",
"QemuVsock": "enabled",
proxy_url="https://my/proxy",
qemu_args=[],
qemu_cdrom=False,
+ qemu_removable=False,
qemu_drives=[
QemuDrive("abc", 200, Path("/foo/bar"), "abc,qed", "red"),
QemuDrive("abc", 200, None, "", "wcd"),