Files
reims-vgpu/docs
Anees Iqbal 4b3a5cfeda 🐛 Keep every QEMU's pipeline answer records in the file runs read
The QEMUs of one build on a host share one kept pipeline answers file, and
each held it open from its start. When one wrote the file again (at its
open past half the capacity, or at the capacity), the rename put a new file
in its place while the others kept appending to the replaced one, which no
run reads: their later records were lost, a drop among them, so the next
run could seed the kext with an answer the device had dropped. And a
rewrite at the capacity took the writing QEMU's memory, so it could bring
back an answer another QEMU had dropped, and counted only its own records.

A store now takes the file's lock (File:🔒 flock on Linux and macOS,
LockFileEx on Windows) for each record, rewrite and removal, and with it
the file the path names now: the one it holds where that is still it
(device and inode on Unix, volume and file ID on Windows), else the one
another store put there. A rewrite reads every store's records from the
file under that lock, and the capacity is the file's length. On Windows the
rename replaces a file other stores hold open through std's POSIX rename
semantics, from Windows 10 1607; a full file that cannot be written again
is removed. For the guest: no QEMU's drop is lost to another's rewrite, so
no dropped answer reaches a later run's PIPELINE_ANSWERS.

The capacity test now counts the drop's key among the file's newest, and
the lost-drop test puts an unwritable file in place (Unix); two tests hold
two stores of one identity: one's drop after the other's rewrite at open,
and a rewrite at the capacity that keeps another store's drop.
2026-11-15 10:28:35 -08:00
..