mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
On Linux, a start of a VM whose protection is on pins .git, its git dirs and every lock path read-only in a user and mount namespace that devvm _qemu pinned makes around QEMU. It keeps the pins while QEMU runs, records each re-pin, refuses hard links and fails closed on watches and records; doctor says why a host can't lock, and such hosts watch .git instead. The pins' events file is read through safefile, and the command-line check takes "devvm lock" in prose as English. Co-Authored-By: Claude Opus 5.5 <[email protected]>
23 lines
805 B
Go
23 lines
805 B
Go
package platform
|
|
|
|
import "errors"
|
|
|
|
// A Pin is a path below a folder that a namespace pins (PinAll): relative
|
|
// to it, and read-only, or fixed in place but writable.
|
|
type Pin struct {
|
|
Path string
|
|
ReadOnly bool
|
|
}
|
|
|
|
// ErrLinked is PinBeneath's refusal of a file with another name: a bind
|
|
// covers one name, so another, in the project folder, would stay writable
|
|
// (macOS's flag locks the file itself, whatever its names).
|
|
var ErrLinked = errors.New("it has another name (a hard link)")
|
|
|
|
// What RunPinned reports of a pin while it keeps them.
|
|
const (
|
|
PinAgain = "pinned-again" // it lost its pin (a file renamed over it), and was pinned again
|
|
PinLinked = "linked" // it has another name now, so it can't be pinned
|
|
PinLost = "lost" // it lost its pin and can't be pinned again
|
|
)
|