nodelabeller

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HV_X64_MSR_RESET                   = 0x40000003
	HV_X64_MSR_VP_INDEX                = 0x40000002
	HV_X64_MSR_VP_RUNTIME              = 0x40000010
	HV_X64_MSR_SCONTROL                = 0x40000080
	HV_X64_MSR_STIMER0_CONFIG          = 0x400000B0
	HV_X64_MSR_TSC_FREQUENCY           = 0x40000022
	HV_X64_MSR_REENLIGHTENMENT_CONTROL = 0x40000106
)
View Source
const (
	NodeLabellerVolumePath = "/var/lib/kubevirt-node-labeller/"
)

Variables

View Source
var CapsDesc = []capability{
	{
		Extension: uintptr(C.CapHyperv),
		Name:      "base",
	},
	{
		Extension: uintptr(C.CapHypervTime),
		Name:      "time",
	},
	{
		Extension: uintptr(C.CapHypervVpIndex),
		MSR:       HV_X64_MSR_VP_INDEX,
		Name:      "vpindex",
	},
	{
		Extension: uintptr(C.CapHypervTlbflush),
		Name:      "tlbflush",
	},
	{
		Extension: uintptr(C.CapHypervSendIPI),
		Name:      "ipi",
	},
	{
		Extension: uintptr(C.CapHypervSynic),
		MSR:       HV_X64_MSR_SCONTROL,
		Name:      "synic",
	},
	{
		Extension: uintptr(C.CapHypervSynic2),
		MSR:       HV_X64_MSR_SCONTROL,
		Name:      "synic2",
	},
	{
		MSR:  HV_X64_MSR_TSC_FREQUENCY,
		Name: "frequencies",
	},
	{
		MSR:  HV_X64_MSR_RESET,
		Name: "reset",
	},
	{
		MSR:  HV_X64_MSR_VP_RUNTIME,
		Name: "runtime",
	},
	{
		MSR:  HV_X64_MSR_STIMER0_CONFIG,
		Name: "synictimer",
	},
	{
		MSR:  HV_X64_MSR_REENLIGHTENMENT_CONTROL,
		Name: "reenlightenment",
	},
}

Functions

This section is empty.

Types

type CPU

type CPU struct {
	Mode []Mode `xml:"mode"`
}

CPU represents slice of cpu modes

type Feature

type Feature struct {
	Name string `xml:"name,attr"`
}

type FeatureModel

type FeatureModel struct {
	Model Features `xml:"model"`
}

Structures needed to parse cpu features

type Features

type Features struct {
	Features []Feature `xml:"feature"`
}

type HostDomCapabilities

type HostDomCapabilities struct {
	CPU CPU              `xml:"cpu"`
	SEV SEVConfiguration `xml:"features>sev"`
}

HostDomCapabilities represents structure for parsing output of virsh capabilities

type HostFeature added in v0.40.0

type HostFeature struct {
	Policy string `xml:"policy,attr"`
	Name   string `xml:"name,attr"`
}

type Mode

type Mode struct {
	Name      string        `xml:"name,attr"`
	Supported string        `xml:"supported,attr"`
	Vendor    Vendor        `xml:"vendor"`
	Feature   []HostFeature `xml:"feature"`
	Model     []Model       `xml:"model"`
}

Mode represents slice of cpu models

type Model

type Model struct {
	Name     string `xml:",chardata"`
	Usable   string `xml:"usable,attr"`
	Fallback string `xml:"fallback,attr"`
}

Model represents cpu model

type NodeLabeller

type NodeLabeller struct {
	SEV SEVConfiguration
	// contains filtered or unexported fields
}

NodeLabeller struct holds information needed to run node-labeller

func NewNodeLabeller

func NewNodeLabeller(clusterConfig *virtconfig.ClusterConfig, nodeClient k8scli.NodeInterface, host string, recorder record.EventRecorder, cpuCounter *libvirtxml.CapsHostCPUCounter) (*NodeLabeller, error)

func (*NodeLabeller) GetHostCpuModel added in v0.54.0

func (n *NodeLabeller) GetHostCpuModel() hostCPUModel

func (*NodeLabeller) Run

func (n *NodeLabeller) Run(threadiness int, stop chan struct{})

Run runs node-labeller

type SEVConfiguration added in v0.49.0

type SEVConfiguration struct {
	Supported       string `xml:"supported,attr"`
	CBitPos         uint   `xml:"cbitpos"`
	ReducedPhysBits uint   `xml:"reducedPhysBits"`
	MaxGuests       uint   `xml:"maxGuests"`
	MaxESGuests     uint   `xml:"maxESGuests"`
	SupportedES     string `xml:"-"`
}

type SupportedHostFeature added in v0.40.0

type SupportedHostFeature struct {
	Feature []HostFeature `xml:"feature"`
}

type Vendor

type Vendor struct {
	Name string `xml:",chardata"`
}

Vendor represents vendor of host CPU

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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