This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / spindle / engines / microvm / cgroup_other.go
877 B 46 lines
1//go:build !linux 2 3package microvm 4 5import ( 6 "fmt" 7 "log/slog" 8) 9 10type CgroupLimits struct { 11 Enabled bool 12 Parent *CgroupParent 13 Name string 14 MemoryMaxMiB int64 15 SwapMaxMiB *int64 16 PidsMax int64 17 CPUQuotaPercent int64 18 IOWeight uint64 19} 20 21type CgroupParent struct{} 22 23type CgroupHandle struct{} 24 25func initCgroupParent(string, int64, *slog.Logger) (*CgroupParent, error) { 26 return nil, fmt.Errorf("microVM cgroups are only supported on Linux") 27} 28 29func prepareCgroup(limits CgroupLimits, _ *slog.Logger) (*CgroupHandle, error) { 30 if !limits.Enabled { 31 return nil, nil 32 } 33 return nil, fmt.Errorf("microVM cgroups are only supported on Linux") 34} 35 36func (*CgroupHandle) AddProcess(int, *slog.Logger) error { 37 return nil 38} 39 40func (*CgroupHandle) Close() error { 41 return nil 42} 43 44func (*CgroupHandle) OOMKilled() bool { 45 return false 46}