mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
Start takes what a VM's state asks of it, backend.Want (its size, agent folders, agent forwarding and ports), beside its Confinement, and a stopped VM's start changes only what differs, in one limactl edit with the confinement's own edits. CreateVM makes the VM as its spec's Want says (VMSpec embeds Want). SetSize, SetAgentDirs and SetAgentForwarding go, and with them vm_not_stopped: devvm size, ssh-agent and the agent mounts save to the state, and the next start applies them. A pure backend.Validate keeps the early refusal (disk_shrink) before anything changes. Lima's ports record (vms/<hash>/backend/ports) goes: which ports a VM forwards is vm.json's ports.forward alone, passed in Start's Want and in SetPorts, which now changes only a running VM's forwarder. Tests: backend TestValidate, TestFakeStartValidates; lima TestWantEdits, TestStartWantInOneEdit, TestSetPortsNoEdit, TestCreateVM and the forwarder tests on Want's ports, the real-Lima scenario's combined edit; vm tests read Start's Want; size, ports, up, up_size, layout and gc_orphans scripts. Co-Authored-By: Claude Opus 5.5 <[email protected]>