lxd: github.com/lxc/lxd/lxd/device/config Index | Files

package config

import "github.com/lxc/lxd/lxd/device/config"


Package Files

device_proxyaddress.go device_runconfig.go devices.go devices_sort.go devices_utils.go


const MountOwnerShiftDynamic = "dynamic"

MountOwnerShiftDynamic use shiftfs for dynamic owner shifting.

const MountOwnerShiftNone = ""

MountOwnerShiftNone do not use owner shifting.

const MountOwnerShiftStatic = "static"

MountOwnerShiftStatic statically modify ownership.

type Device Uses

type Device map[string]string

Device represents a LXD container device

func (Device) Clone Uses

func (device Device) Clone() Device

Clone returns a copy of the Device.

func (Device) NICType Uses

func (device Device) NICType() string

NICType returns the derived NIC Type for a NIC device. If the "network" property is specified then this implicitly (at least for now) means the nictype is "bridged". Otherwise the "nictype" property is returned. If the device type is not a NIC then an empty string is returned.

func (Device) Validate Uses

func (device Device) Validate(rules map[string]func(value string) error) error

Validate accepts a map of field/validation functions to run against the device's config.

type DeviceNamed Uses

type DeviceNamed struct {
    Name   string
    Config Device

DeviceNamed contains the name of a device and its config.

type Devices Uses

type Devices map[string]Device

Devices represents a set of LXD container devices

func NewDevices Uses

func NewDevices(nativeSet map[string]map[string]string) Devices

NewDevices creates a new Devices set from a native map[string]map[string]string set.

func (Devices) Clone Uses

func (list Devices) Clone() Devices

Clone returns a copy of the Devices set.

func (Devices) CloneNative Uses

func (list Devices) CloneNative() map[string]map[string]string

CloneNative returns a copy of the Devices set as a native map[string]map[string]string type.

func (Devices) Contains Uses

func (list Devices) Contains(k string, d Device) bool

Contains checks if a given device exists in the set and if it's identical to that provided

func (Devices) Reversed Uses

func (list Devices) Reversed() DevicesSortable

Reversed returns the name of all devices in the set, sorted reversed.

func (Devices) Sorted Uses

func (list Devices) Sorted() DevicesSortable

Sorted returns the name of all devices in the set, sorted properly.

func (Devices) Update Uses

func (list Devices) Update(newlist Devices, updateFields func(Device, Device) []string) (map[string]Device, map[string]Device, map[string]Device, []string)

Update returns the difference between two sets

type DevicesSortable Uses

type DevicesSortable []DeviceNamed

DevicesSortable is a sortable slice of device names and config.

func (DevicesSortable) Len Uses

func (devices DevicesSortable) Len() int

func (DevicesSortable) Less Uses

func (devices DevicesSortable) Less(i, j int) bool

func (DevicesSortable) Swap Uses

func (devices DevicesSortable) Swap(i, j int)

type MountEntryItem Uses

type MountEntryItem struct {
    DevName    string   // The internal name for the device.
    DevPath    string   // Describes the block special device or remote filesystem to be mounted.
    TargetPath string   // Describes the mount point (target) for the filesystem.
    FSType     string   // Describes the type of the filesystem.
    Opts       []string // Describes the mount options associated with the filesystem.
    Freq       int      // Used by dump(8) to determine which filesystems need to be dumped. Defaults to zero (don't dump) if not present.
    PassNo     int      // Used by fsck(8) to determine the order in which filesystem checks are done at boot time. Defaults to zero (don't fsck) if not present.
    OwnerShift string   // Ownership shifting mode, use constants MountOwnerShiftNone, MountOwnerShiftStatic or MountOwnerShiftDynamic.

MountEntryItem represents a single mount entry item.

type ProxyAddress Uses

type ProxyAddress struct {
    ConnType string
    Addr     []string
    Abstract bool

ProxyAddress represents a proxy address configuration.

type RootFSEntryItem Uses

type RootFSEntryItem struct {
    Path string   // Describes the root file system source.
    Opts []string // Describes the mount options associated with the filesystem.

RootFSEntryItem represents the root filesystem options for an Instance.

type RunConfig Uses

type RunConfig struct {
    RootFS           RootFSEntryItem  // RootFS to setup.
    NetworkInterface []RunConfigItem  // Network interface configuration settings.
    CGroups          []RunConfigItem  // Cgroup rules to setup.
    Mounts           []MountEntryItem // Mounts to setup/remove.
    Uevents          [][]string       // Uevents to inject.
    PostHooks        []func() error   // Functions to be run after device attach/detach.
    GPUDevice        []RunConfigItem  // GPU device configuration settings.

RunConfig represents LXD defined run-time config used for device setup/cleanup.

type RunConfigItem Uses

type RunConfigItem struct {
    Key   string
    Value string

RunConfigItem represents a single config item.

Package config imports 2 packages (graph) and is imported by 31 packages. Updated 2020-07-06. Refresh now. Tools for package owners.