lxd: github.com/lxc/lxd/lxd/sys Index | Files

package sys

import "github.com/lxc/lxd/lxd/sys"

Index

Package Files

apparmor.go cgroup.go fs.go os.go testing.go

func SetupTestCerts Uses

func SetupTestCerts(dir string) error

SetupTestCerts populates the given test LXD directory with server certificates.

Since generating certificates is CPU intensive, they will be simply symlink'ed from the test/deps/ directory.

FIXME: this function is exported because some tests use it

directly. Eventually we should rework those tests to use NewTestOS
instead.

type InotifyInfo Uses

type InotifyInfo struct {
    Fd  int
    sync.RWMutex
    Targets map[string]*InotifyTargetInfo
}

InotifyInfo records the inotify information associated with a given inotify instance

type InotifyTargetInfo Uses

type InotifyTargetInfo struct {
    Mask uint32
    Wd   int
    Path string
}

InotifyTargetInfo records the inotify information associated with a given inotify target

type OS Uses

type OS struct {
    // Directories
    CacheDir string // Cache directory (e.g. /var/cache/lxd/).
    LogDir   string // Log directory (e.g. /var/log/lxd).
    VarDir   string // Data directory (e.g. /var/lib/lxd/).

    // Daemon environment
    Architectures   []int           // Cache of detected system architectures
    BackingFS       string          // Backing filesystem of $LXD_DIR/containers
    ExecPath        string          // Absolute path to the LXD executable
    IdmapSet        *idmap.IdmapSet // Information about user/group ID mapping
    InotifyWatch    InotifyInfo
    LxcPath         string // Path to the $LXD_DIR/containers directory
    MockMode        bool   // If true some APIs will be mocked (for testing)
    RunningInUserNS bool

    // Apparmor features
    AppArmorAdmin     bool
    AppArmorAvailable bool
    AppArmorConfined  bool
    AppArmorStacked   bool
    AppArmorStacking  bool

    // Cgroup features
    CGroupBlkioController       bool
    CGroupBlkioWeightController bool
    CGroupCPUacctController     bool
    CGroupCPUController         bool
    CGroupCPUsetController      bool
    CGroupDevicesController     bool
    CGroupFreezerController     bool
    CGroupMemoryController      bool
    CGroupNetPrioController     bool
    CGroupPidsController        bool
    CGroupSwapAccounting        bool

    // Kernel features
    NetnsGetifaddrs         bool
    SeccompListener         bool
    SeccompListenerContinue bool
    Shiftfs                 bool
    UeventInjection         bool
    VFS3Fscaps              bool

    // LXC features
    LXCFeatures map[string]bool
}

OS is a high-level facade for accessing all operating-system level functionality that LXD uses.

func DefaultOS Uses

func DefaultOS() *OS

DefaultOS returns a fresh uninitialized OS instance with default values.

func NewTestOS Uses

func NewTestOS(t *testing.T) (*OS, func())

NewTestOS returns a new OS instance initialized with test values.

func (*OS) GlobalDatabaseDir Uses

func (s *OS) GlobalDatabaseDir() string

GlobalDatabaseDir returns the path of the global database directory.

func (*OS) GlobalDatabasePath Uses

func (s *OS) GlobalDatabasePath() string

GlobalDatabasePath returns the path of the global database SQLite file managed by dqlite.

func (*OS) Init Uses

func (s *OS) Init() error

Init our internal data structures.

func (*OS) LegacyGlobalDatabasePath Uses

func (s *OS) LegacyGlobalDatabasePath() string

LegacyGlobalDatabasePath returns the path of legacy global database file.

func (*OS) LegacyLocalDatabasePath Uses

func (s *OS) LegacyLocalDatabasePath() string

LegacyLocalDatabasePath returns the path of legacy local database file.

func (*OS) LocalDatabasePath Uses

func (s *OS) LocalDatabasePath() string

LocalDatabasePath returns the path of the local database file.

Package sys imports 18 packages (graph) and is imported by 18 packages. Updated 2019-10-22. Refresh now. Tools for package owners.