Documentation ¶
Index ¶
- Constants
- Variables
- func ConvReason(status libvirt.DomainState, reason int) api.StateChangeReason
- func ConvState(status libvirt.DomainState) api.LifeCycle
- func DomainFromNamespaceName(namespace, name string) string
- func GetDomainSpec(status libvirt.DomainState, dom cli.VirDomain) (*api.DomainSpec, error)
- func GetDomainSpecWithFlags(dom cli.VirDomain, flags libvirt.DomainXMLFlags) (*api.DomainSpec, error)
- func GetDomainSpecWithRuntimeInfo(dom cli.VirDomain) (*api.DomainSpec, error)
- func GetPodCPUSet() ([]int, error)
- func NewDomain(dom cli.VirDomain) (*api.Domain, error)
- func NewDomainFromName(name string, vmiUID types.UID) *api.Domain
- func SetDomainSpecStr(virConn cli.Connection, vmi *v1.VirtualMachineInstance, wantedSpec string) (cli.VirDomain, error)
- func SetDomainSpecStrWithHooks(virConn cli.Connection, vmi *v1.VirtualMachineInstance, ...) (cli.VirDomain, error)
- func SplitVMINamespaceKey(domainName string) (namespace, name string)
- func StartVirtlog(stopChan chan struct{}, domainName string, nonRoot bool)
- func VMINamespaceKeyFunc(vmi *v1.VirtualMachineInstance) string
- type LibvirtWrapper
Constants ¶
View Source
const QEMUSeaBiosDebugPipe = converter.QEMUSeaBiosDebugPipe
Variables ¶
View Source
var CrashedReasonTranslationMap = map[libvirt.DomainCrashedReason]api.StateChangeReason{ libvirt.DOMAIN_CRASHED_UNKNOWN: api.ReasonUnknown, libvirt.DOMAIN_CRASHED_PANICKED: api.ReasonPanicked, }
View Source
var LifeCycleTranslationMap = map[libvirt.DomainState]api.LifeCycle{ libvirt.DOMAIN_NOSTATE: api.NoState, libvirt.DOMAIN_RUNNING: api.Running, libvirt.DOMAIN_BLOCKED: api.Blocked, libvirt.DOMAIN_PAUSED: api.Paused, libvirt.DOMAIN_SHUTDOWN: api.Shutdown, libvirt.DOMAIN_SHUTOFF: api.Shutoff, libvirt.DOMAIN_CRASHED: api.Crashed, libvirt.DOMAIN_PMSUSPENDED: api.PMSuspended, }
View Source
var PausedReasonTranslationMap = map[libvirt.DomainPausedReason]api.StateChangeReason{ libvirt.DOMAIN_PAUSED_UNKNOWN: api.ReasonPausedUnknown, libvirt.DOMAIN_PAUSED_USER: api.ReasonPausedUser, libvirt.DOMAIN_PAUSED_MIGRATION: api.ReasonPausedMigration, libvirt.DOMAIN_PAUSED_SAVE: api.ReasonPausedSave, libvirt.DOMAIN_PAUSED_DUMP: api.ReasonPausedDump, libvirt.DOMAIN_PAUSED_IOERROR: api.ReasonPausedIOError, libvirt.DOMAIN_PAUSED_WATCHDOG: api.ReasonPausedWatchdog, libvirt.DOMAIN_PAUSED_FROM_SNAPSHOT: api.ReasonPausedFromSnapshot, libvirt.DOMAIN_PAUSED_SHUTTING_DOWN: api.ReasonPausedShuttingDown, libvirt.DOMAIN_PAUSED_SNAPSHOT: api.ReasonPausedSnapshot, libvirt.DOMAIN_PAUSED_CRASHED: api.ReasonPausedCrashed, libvirt.DOMAIN_PAUSED_STARTING_UP: api.ReasonPausedStartingUp, libvirt.DOMAIN_PAUSED_POSTCOPY: api.ReasonPausedPostcopy, libvirt.DOMAIN_PAUSED_POSTCOPY_FAILED: api.ReasonPausedPostcopyFailed, }
View Source
var ShutdownReasonTranslationMap = map[libvirt.DomainShutdownReason]api.StateChangeReason{ libvirt.DOMAIN_SHUTDOWN_UNKNOWN: api.ReasonUnknown, libvirt.DOMAIN_SHUTDOWN_USER: api.ReasonUser, }
View Source
var ShutoffReasonTranslationMap = map[libvirt.DomainShutoffReason]api.StateChangeReason{ libvirt.DOMAIN_SHUTOFF_UNKNOWN: api.ReasonUnknown, libvirt.DOMAIN_SHUTOFF_SHUTDOWN: api.ReasonShutdown, libvirt.DOMAIN_SHUTOFF_DESTROYED: api.ReasonDestroyed, libvirt.DOMAIN_SHUTOFF_CRASHED: api.ReasonCrashed, libvirt.DOMAIN_SHUTOFF_MIGRATED: api.ReasonMigrated, libvirt.DOMAIN_SHUTOFF_SAVED: api.ReasonSaved, libvirt.DOMAIN_SHUTOFF_FAILED: api.ReasonFailed, libvirt.DOMAIN_SHUTOFF_FROM_SNAPSHOT: api.ReasonFromSnapshot, }
Functions ¶
func ConvReason ¶
func ConvReason(status libvirt.DomainState, reason int) api.StateChangeReason
func DomainFromNamespaceName ¶ added in v0.9.0
func GetDomainSpec ¶
func GetDomainSpec(status libvirt.DomainState, dom cli.VirDomain) (*api.DomainSpec, error)
GetDomainSpec return the domain XML without runtime information. The result XML is merged from inactive XML and migratable XML.
func GetDomainSpecWithFlags ¶
func GetDomainSpecWithFlags(dom cli.VirDomain, flags libvirt.DomainXMLFlags) (*api.DomainSpec, error)
func GetDomainSpecWithRuntimeInfo ¶ added in v0.10.0
func GetDomainSpecWithRuntimeInfo(dom cli.VirDomain) (*api.DomainSpec, error)
GetDomainSpecWithRuntimeInfo return the active domain XML with runtime information embedded
func GetPodCPUSet ¶ added in v0.9.0
func NewDomainFromName ¶ added in v0.9.0
func SetDomainSpecStr ¶ added in v0.11.1
func SetDomainSpecStr(virConn cli.Connection, vmi *v1.VirtualMachineInstance, wantedSpec string) (cli.VirDomain, error)
base64.StdEncoding.EncodeToString
func SetDomainSpecStrWithHooks ¶ added in v0.36.0
func SetDomainSpecStrWithHooks(virConn cli.Connection, vmi *v1.VirtualMachineInstance, wantedSpec *api.DomainSpec) (cli.VirDomain, error)
func SplitVMINamespaceKey ¶ added in v0.6.1
returns the namespace and name that is encoded in the domain name.
func StartVirtlog ¶
func VMINamespaceKeyFunc ¶ added in v0.6.1
func VMINamespaceKeyFunc(vmi *v1.VirtualMachineInstance) string
VMINamespaceKeyFunc constructs the domain name with a namespace prefix i.g. namespace_name.
Types ¶
type LibvirtWrapper ¶ added in v0.44.1
type LibvirtWrapper struct {
// contains filtered or unexported fields
}
func NewLibvirtWrapper ¶ added in v0.44.1
func NewLibvirtWrapper(nonRoot bool) *LibvirtWrapper
func (LibvirtWrapper) SetupLibvirt ¶ added in v0.44.1
func (l LibvirtWrapper) SetupLibvirt(customLogFilters *string) (err error)
func (LibvirtWrapper) StartLibvirt ¶ added in v0.44.1
func (l LibvirtWrapper) StartLibvirt(stopChan chan struct{})
Click to show internal directories.
Click to hide internal directories.