Commit Graph

3 Commits

Author SHA1 Message Date
James Cuzella 9d3deb0222
Prevent qcow2 image ballooning with discard=unmap,detect-zeroes=unmap
To prevent the `qcow2` image file from inevitably ballooning or expanding on the
host, we need to tell qcow2 image format block driver to unmap on discard/TRIM.

Due to how `qcow2` sparse images integrate with SSD TRIM (a.k.a. "`discard`"),
we also must set `discard=unmap`, and `detect-zeroes=unmap`.

However, these parameters are usually specified on the block device, so we must
fallback to the more declarative `-blockdev ...` + `-device ...` form of QEMU
CLI args to specify them [^1].  For example:

```console
  # need to specify 'discard=unmap, detect-zeroes=unmap' on blockdev
  -blockdev driver=qcow2,node-name=MacHDD,file.driver=file,file.filename="$REPO_PATH/mac_hdd_ng.img",file.aio=threads,discard=unmap,detect-zeroes=unmap
  -device ide-hd,bus=sata.4,drive=MacHDD,id=macssd,rotation_rate=1
```

[^1]: See: [_QEMU User Documentation: Block device options_][1] or `man qemu` "_Block device options_" section:

> The  most  explicit  way  to describe disks is to use a combination of
> `-device` to specify the hardware device and `-blockdev` to describe the
> backend. The device defines what the guest sees and the backend describes how
> QEMU handles the data. _**It is the only guaranteed stable interface for
> describing block devices and as such is recommended for management tools and
scripting**_.
> The `-drive` option combines the device and backend into a single command line
> option which is a more human friendly. There is however
> _no interface stability guarantee_ although some older board models still need
> updating to work with the modern `blockdev` forms.

Signed-off-by: James Cuzella <james.cuzella@lyraphase.com>
Suggested-by: Daniel Collins <solemnwarning@solemnwarning.net>
2025-05-06 02:28:01 -06:00
Dhiru Kholia 422bb3b713 Batch Update 2 - September 2023
Changes:

- Update to OpenCore 0.9.5

- Switch around the emulated video device (required for Ventura)

- Change default resolution to 1920x1080

- Include ventura in shortname CLI help

- Add notes on 'bridged networking'

- Better networking documentation (thomaspaulb)

- Support for offline installations (kwadwokyeremeh)

- Initial WIP macOS Sonoma support (via 'luchina-gabriel')
2023-10-02 14:36:40 +05:30
Dhiru Kholia 7fed0d7c5c Batch Update 1 - January 2023
Changes:

- Update to OpenCore 0.8.8

- New 'ISO' creation scripts (mikehardy)
2023-01-27 14:49:57 +05:30