libvirt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package libvirt provides VM domain operations by running virsh commands inside the virt-launcher container via the Podman exec API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainName

func DomainName(vmName string) string

Types

type Client

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

func NewClient

func NewClient(vmName string) *Client

func (*Client) Destroy

func (c *Client) Destroy(vmName string) error

func (*Client) GetInfo

func (c *Client) GetInfo(vmName string) (*DomainInfo, error)

func (*Client) GetState

func (c *Client) GetState(vmName string) (DomainState, error)

func (*Client) ListDomains

func (c *Client) ListDomains() ([]string, error)

func (*Client) Shutdown

func (c *Client) Shutdown(vmName string) error

type DomainInfo

type DomainInfo struct {
	Name       string
	State      DomainState
	CPUs       int
	MaxMemKiB  uint64
	UsedMemKiB uint64
}

type DomainState

type DomainState string
const (
	StateRunning  DomainState = "running"
	StatePaused   DomainState = "paused"
	StateShutOff  DomainState = "shut off"
	StateShutting DomainState = "in shutdown"
	StateCrashed  DomainState = "crashed"
	StateUnknown  DomainState = "unknown"
)

Jump to

Keyboard shortcuts

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