Skip to content

Commit 020d7ee

Browse files
authored
Merge pull request #1102 from chrisx8/master
Enable trimming QEMU disks
2 parents 67c9e41 + 26c0491 commit 020d7ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/qemu/qemu.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ func Cmdline(cfg Config) (string, []string, error) {
433433
args = appendArgsIfNoConflict(args, "-boot", "order=c,splash-time=0,menu=on")
434434
}
435435
if diskSize, _ := units.RAMInBytes(*cfg.LimaYAML.Disk); diskSize > 0 {
436-
args = append(args, "-drive", fmt.Sprintf("file=%s,if=virtio", diffDisk))
436+
args = append(args, "-drive", fmt.Sprintf("file=%s,if=virtio,discard=on", diffDisk))
437437
} else if !isBaseDiskCDROM {
438-
args = append(args, "-drive", fmt.Sprintf("file=%s,if=virtio", baseDisk))
438+
args = append(args, "-drive", fmt.Sprintf("file=%s,if=virtio,discard=on", baseDisk))
439439
}
440440
// cloud-init
441441
switch *y.Arch {

0 commit comments

Comments
 (0)