sysutils

package
v0.0.0-...-6410feb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KVM_MODULE_INTEL     = "kvm-intel"
	KVM_MODULE_AMD       = "kvm-amd"
	KVM_MODULE           = "kvm"
	KVM_MODULE_UNSUPPORT = "unsupport"
	KVM_MODULE_BUILDIN   = "buildin"

	HOST_NEST_UNSUPPORT = "0"
	HOST_NEST_SUPPORT   = "1"
	HOST_NEST_ENABLE    = "3"
)
View Source
const (
	UUID_EMPTY = "00000000-0000-0000-0000-000000000000"
)

Variables

This section is empty.

Functions

func DetectStorageType

func DetectStorageType() (string, error)

func DumpMapToObject

func DumpMapToObject(data map[string]string, obj interface{}) error

func GetKVMModuleSupport

func GetKVMModuleSupport() string

func GetKernelModuleParameter

func GetKernelModuleParameter(name, moduel string) string

func GetNestSupport

func GetNestSupport() string

func GetSecureTTYs

func GetSecureTTYs(lines []string) []string

func GetSerialPorts

func GetSerialPorts(lines []string) []string

func GetSysConfig

func GetSysConfig(pa string) string

func GetSysConfigQuiet

func GetSysConfigQuiet(pa string) string

func IsHypervisor

func IsHypervisor() bool

func IsKernelModuleLoaded

func IsKernelModuleLoaded(name string) bool

func IsKvmSupport

func IsKvmSupport() bool

func IsNestEnabled

func IsNestEnabled() bool

func IsProcessorAmd

func IsProcessorAmd() bool

func IsProcessorIntel

func IsProcessorIntel() bool

func IsRootPermission

func IsRootPermission() bool

func ModprobeKvmModule

func ModprobeKvmModule(name string, remove, nest bool) bool

func Nics

func Nics() ([]*types.SNicDevInfo, error)

func NormalizeUuid

func NormalizeUuid(uuid string) string

func ParseCPUInfo

func ParseCPUInfo(lines []string) (*types.SCPUInfo, error)

func ParseDMICPUInfo

func ParseDMICPUInfo(lines []string) *types.SDMICPUInfo

func ParseDMIIPMIInfo

func ParseDMIIPMIInfo(lines []string) bool

func ParseDMIMemInfo

func ParseDMIMemInfo(lines []string) *types.SDMIMemInfo

func ParseDMISysinfo

func ParseDMISysinfo(lines []string) (*types.SSystemInfo, error)

func ParseDiskInfo

func ParseDiskInfo(lines []string, driver string) []*types.SDiskInfo

func ParseIPMIUser

func ParseIPMIUser(lines []string) []compute.IPMIUser

func ParseNicInfo

func ParseNicInfo(lines []string) []*types.SNicDevInfo

func ParsePCIEDiskInfo

func ParsePCIEDiskInfo(lines []string) []*types.SDiskInfo

func ParseSCSIDiskInfo

func ParseSCSIDiskInfo(lines []string) []*types.SDiskInfo

func ParseSGMap

func ParseSGMap(lines []string) []compute.SGMapItem

ParseSGMap parse command 'sg_map -x' outputs:

/dev/sg1 0 2 0 0 0 /dev/sda
/dev/sg2 0 2 1 0 0 /dev/sdb
/dev/sg3 0 2 2 0 0 /dev/sdc

func SetHostname

func SetHostname(name string) error

func SetSysConfig

func SetSysConfig(cpath, val string) bool

func Start

func Start(closeFd bool, args ...string) (p *os.Process, err error)

Types

type SHugepageInfo

type SHugepageInfo struct {
	SizeKb int
	Total  int
	Free   int
}

func (SHugepageInfo) BytesMb

func (h SHugepageInfo) BytesMb() int64

type SStorage

type SStorage struct {
	Device     string
	Rotational bool
	Size       int64
	ReadOnly   bool
	Removable  bool
	Partition  bool
	Scheduler  string
}

func DetectStorages

func DetectStorages() ([]SStorage, error)

type THugepages

type THugepages []SHugepageInfo

func GetHugepages

func GetHugepages() (THugepages, error)

func (THugepages) BytesMb

func (a THugepages) BytesMb() int64

func (THugepages) Len

func (a THugepages) Len() int

func (THugepages) Less

func (a THugepages) Less(i, j int) bool

func (THugepages) PageSizes

func (a THugepages) PageSizes() []int

func (THugepages) Swap

func (a THugepages) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL