{"id":"XE-16759","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"658","source_url":"https://github.com/xeprotocol/xe/issues/658","reporter_id":2920,"title":"[Low] QEMU Provision leaks the VM workdir on waitForQEMUPID / waitForSSHPort failure (latent — QEMUManager currently unwired)","area":"leasing-ledger","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T05:47:03.751984+00:00","updated_at":"2026-11-22T23:26:16.586597+00:00","source_created_at":"2026-11-17T05:46:25+00:00","told_at":"2026-11-22T23:26:16.599735+00:00","status_changed_at":"2026-11-22T23:26:16.591799+00:00","url":"https://bounty.xe.network/XE-16759","body":"## Summary\nOn `waitForQEMUPID` failure, `QEMUManager.Provision` kills the QEMU process and returns without removing the VM workdir. On `waitForSSHPort` failure, same. Every earlier failure path in the same function (seed ISO, qcow2 overlay, OVMF vars, qemu start) calls `os.RemoveAll(workDir)`. Each failed provision at these stages leaks a workdir (`seed.iso`, `user-data`, `meta-data`, `guest.qcow2` overlay, `OVMF_VARS.fd`, `serial.log`, `qemu.pid`); repeated failures accumulate disk usage. The killed VM is also untracked (never entered `m.vms`).\n\n## Root Cause\n`vm/qemu_manager.go:235-247`: the `waitForQEMUPID` failure path (`killQEMUByName(name)` then return) and the `waitForSSHPort` failure path (`killQEMU(pid)` then return) both lack the `os.RemoveAll(workDir)` call that the qemu-start failure path (just above) has.\n\n## Impact\nDisk accumulation from repeated failed provisions. Latent: `QEMUManager` has no production caller -- the provider path wires only Lima (or Mock with `XE_VM_MOCK=1`); repo-wide grep finds no `NewQEMUManager` callers outside `vm/`. Same standing as #655 (binary codec, accepted as Minor).\n\n## Verification\nSource-level at HEAD `8cc209d` (testnet-0006).\n\n## Suggested fix\nAdd `_ = os.RemoveAll(workDir)` to both failure paths, matching the earlier paths.","patch_refs":[],"thread":[{"id":18867,"source":"desk","source_ref":"reply:16544","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-16759 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:16.586597+00:00"}]}