tart/Tests
G 3678f45d82 Add optional Virtio memory balloon support
Add a per-VM "memoryBalloon" setting (disabled by default) that, when
enabled via "tart set <name> --memory-balloon true", attaches a
VZVirtioTraditionalMemoryBalloonDeviceConfiguration to the VM,
allowing supported guest operating systems to participate in
best-effort memory reclaim.

A balloon target can be requested at run time via
"tart run --balloon-target-memory <MB>". The target is re-applied
periodically, since a target set before the guest's virtio-balloon
driver probes the device is lost when the guest resets the device
while booting (the same applies to guest reboots).

The balloon device is skipped for suspendable VMs (similarly to the
entropy device) to not interfere with the save/restore support.

VM.craftConfiguration() is split into a buildConfiguration() part and
a validation part, so that the device wiring can be unit-tested
without the "com.apple.security.virtualization" entitlement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:51:48 +09:00
..
TartTests Add optional Virtio memory balloon support 2026-07-03 10:51:48 +09:00