Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1887,8 +1887,9 @@ function vm_boot() {

# Add the disks
# - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/
# Optimise disk I/O: enable TRIM/discard and zero detection for thin provisioning
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap"
# Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning,
# writeback caching and threaded async I/O
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Setting cache=writeback as a default for all VM disks increases the risk of data loss on host failures (docs warn that writeback reports writes complete before they hit storage). Consider leaving cache unspecified or using a safer mode by default and making writeback opt‑in.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At quickemu, line 1892:

<comment>Setting `cache=writeback` as a default for all VM disks increases the risk of data loss on host failures (docs warn that writeback reports writes complete before they hit storage). Consider leaving cache unspecified or using a safer mode by default and making writeback opt‑in.</comment>

<file context>
@@ -1887,8 +1887,9 @@ function vm_boot() {
-    DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap"
+    # Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning,
+    # writeback caching and threaded async I/O
+    DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
 
     if [[ "${boot}" == *"efi"* ]]; then
</file context>
Suggested change
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,aio=threads"


if [[ "${boot}" == *"efi"* ]]; then
QCOW2CODE=$(is_firmware_qcow2 "${EFI_CODE}")
Expand Down
Loading