-
Notifications
You must be signed in to change notification settings - Fork 653
/
Copy pathfilenames.go
88 lines (76 loc) · 3 KB
/
filenames.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Package filenames defines the names of the files that appear under an instance dir
// or inside the config directory.
//
// See https://lima-vm.io/docs/dev/internals/
package filenames
// Instance names starting with an underscore are reserved for lima internal usage
const (
ConfigDir = "_config"
CacheDir = "_cache" // not yet implemented
NetworksDir = "_networks" // network log files are stored here
DisksDir = "_disks" // disks are stored here
)
// Filenames used inside the ConfigDir
const (
UserPrivateKey = "user"
UserPublicKey = UserPrivateKey + ".pub"
NetworksConfig = "networks.yaml"
Default = "default.yaml"
Override = "override.yaml"
)
// Filenames that may appear under an instance directory
const (
LimaYAML = "lima.yaml"
LimaVersion = "lima-version" // Lima version used to create instance
CIDataISO = "cidata.iso"
CIDataISODir = "cidata"
CloudConfig = "cloud-config.yaml"
BaseDisk = "basedisk"
DiffDisk = "diffdisk"
Kernel = "kernel"
KernelCmdline = "kernel.cmdline"
Initrd = "initrd"
QMPSock = "qmp.sock"
SerialLog = "serial.log" // default serial (ttyS0, but ttyAMA0 on qemu-system-{arm,aarch64})
SerialSock = "serial.sock"
SerialPCILog = "serialp.log" // pci serial (ttyS0 on qemu-system-{arm,aarch64})
SerialPCISock = "serialp.sock"
SerialVirtioLog = "serialv.log" // virtio serial
SerialVirtioSock = "serialv.sock"
SSHSock = "ssh.sock"
SSHConfig = "ssh.config"
VhostSock = "virtiofsd-%d.sock"
VNCDisplayFile = "vncdisplay"
VNCPasswordFile = "vncpassword"
GuestAgentSock = "ga.sock"
VirtioPort = "io.lima-vm.guest_agent.0"
HostAgentPID = "ha.pid"
HostAgentSock = "ha.sock"
HostAgentStdoutLog = "ha.stdout.log"
HostAgentStderrLog = "ha.stderr.log"
VzIdentifier = "vz-identifier"
VzEfi = "vz-efi" // efi variable store
VzMachineState = "vz-machine-state" // machine state file
QemuEfiCodeFD = "qemu-efi-code.fd" // efi code; not always created
AnsibleInventoryYAML = "ansible-inventory.yaml"
// SocketDir is the default location for forwarded sockets with a relative paths in HostSocket.
SocketDir = "sock"
Protected = "protected" // empty file; used by `limactl protect`
)
// Filenames used under a disk directory
const (
DataDisk = "datadisk"
InUseBy = "in_use_by"
)
// LongestSock is the longest socket name.
// On macOS, the full path of the socket (excluding the NUL terminator) must be less than 104 characters.
// See unix(4).
//
// On Linux, the full path must be less than 108 characters.
//
// ssh appends 16 bytes of random characters when it first creates the socket:
// https://github.com/openssh/openssh-portable/blob/V_8_7_P1/mux.c#L1271-L1285
const LongestSock = SSHSock + ".1234567890123456"
func PIDFile(name string) string {
return name + ".pid"
}