virtigolib

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

This is the common libvirt xml handling code for virtigo & virtigod

This is used to import libvirt xml files (as used by virsh) and
save the information in a protocol buffer config file.

It re-creates the xml files needed for virsh on the hypervisor
and starts the vm with 'virsh create'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDomainDroplet

func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error)

import a libvirt xml file

func DumpLibvirtxmlDomainNames

func DumpLibvirtxmlDomainNames()

dump out all the fields in libvirtxml.DomainDeviceList

func DumpNonStandardXML

func DumpNonStandardXML(domcfg *libvirtxml.Domain) (string, error)

func GenerateDropletXml

func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error

generate the XML for 'virsh create'

func InsertFilename

func InsertFilename(d *pb.Droplet, filename string) (*pb.Event, error)

func IsStructEmptyOrNil

func IsStructEmptyOrNil(value interface{}) bool

IsStructEmptyOrNil checks if a struct or pointer to struct is empty, blank, or nil

func MergeXml

func MergeXml(d *libvirtxml.Domain, xml string) error

func MergelibvirtDomain

func MergelibvirtDomain(d *pb.Droplet, domcfg *libvirtxml.Domain) ([]*pb.Event, error)

merges and updates the droplet protobuf based on the libvirt XML

func ReadXml

func ReadXml(filename string) (*libvirtxml.Domain, error)

func SetSpicePort

func SetSpicePort(d *pb.Droplet, domcfg *libvirtxml.Domain) error

func TestLibvirtDomain

func TestLibvirtDomain(domcfg *libvirtxml.Domain) (*pb.Droplet, error)

do a test import of a libvirt xml domain

Types

type CloudManager added in v0.1.3

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

CloudManager is a concrete implementation of the Manager interface.

func NewCloud added in v0.1.3

func NewCloud() *CloudManager

func (*CloudManager) FindDropletByName added in v0.1.3

func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error)

FindByName retrieves a cluster by name.

func (*CloudManager) List added in v0.1.3

func (m *CloudManager) List() ([]*virtbuf.Cluster, error)

List retrieves all available clusters.

func (*CloudManager) Start added in v0.1.3

func (m *CloudManager) Start(cluster *virtbuf.Cluster) error

Start initiates the startup process for the specified cluster.

func (*CloudManager) Status added in v0.1.3

func (m *CloudManager) Status(cluster *virtbuf.Cluster) (string, error)

Status checks the current status of a specified cluster.

func (*CloudManager) Stop added in v0.1.3

func (m *CloudManager) Stop(cluster *virtbuf.Cluster) error

Stop halts the specified cluster.

Jump to

Keyboard shortcuts

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