virtmon

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package virtmon watches the state changes of the libvirt domains, and publishes them as pubsub events, for the instances holding a kvm resource to evaluate their status again.

A domain changes state with no action of the node to tell: its guest shuts it down, its qemu dies, an admin destroys or migrates it by hand. Without the monitor, the change is seen at the next scheduled status: within the monitor schedule for a monitored resource, the status schedule otherwise, with the instance said up meanwhile.

It reads the event stream "virsh -r event --event lifecycle --loop" prints, on a read-only connection, while the node holds a kvm resource: a node holding none has no domain event to wait for, and the connection would keep a socket-activated libvirtd running (see package evwatch). A stream ending, as libvirtd restarting ends it, runs again after a delay, and the domains held are refreshed once it runs. Where virsh is not installed, or too old to print the events, the monitor disables itself and says so once, until no kvm resource is left.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager watches the libvirt domain events and publishes a VirtDomainUpdated message for each domain of the local instances whose state changed.

func NewManager

func NewManager(drainDuration time.Duration, subQS pubsub.QueueSizer) *Manager

NewManager creates a new libvirt monitor manager

func (*Manager) Start

func (t *Manager) Start(parent context.Context) error

Start starts the libvirt monitor, which runs the event stream while the node holds a kvm resource.

func (*Manager) Stop

func (t *Manager) Stop() error

Stop stops the libvirt monitor manager

Jump to

Keyboard shortcuts

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