libvirtxml

package module
v0.0.0-...-a513129 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: MIT Imports: 1 Imported by: 0

README

libvirt-go-xml Build Status GoDoc

Go API for manipulating libvirt XML documents

This package provides a Go API that defines a set of structs, annotated for use with "encoding/xml", that can represent libvirt XML documents. There is no dependancy on the libvirt library itself, so this can be used regardless of the way in which the application talks to libvirt.

Documentation

Contributing

The libvirt project aims to add support for new APIs to libvirt-go as soon as they are added to the main libvirt C library. If you are submitting changes to the libvirt C library API, please submit a libvirt-go change at the same time.

Bug fixes and other improvements to the libvirt-go library are welcome at any time. The preferred submission method is to use git send-email to submit patches to the libvir-list@redhat.com mailing list. eg. to send a single patch

  # git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go-xml" \
       --smtp-server=$HOSTNAME -1

Or to send all patches on the current branch, against master

  $ git send-email --to libvir-list@redhat.com --subject-prefix "PATCH go-xml" \
       --smtp-server=$HOSTNAME --no-chain-reply-to --cover-letter --annotate \
       master..

Note the master GIT repository is at

   http://libvirt.org/git/?p=libvirt-go.git;a=summary

The following automatic read-only mirrors are available as a convenience to allow contributors to "fork" the repository:

  https://gitlab.com/libvirt/libvirt-go
  https://github.com/libvirt/libvirt-go

While you can send pull-requests to these mirrors, they will be re-submitted via emai to the mailing list for review before being merged, unless they are trivial/obvious bug fixes.

Documentation

Overview

Package libvirt-go-xml defines structs for parsing libvirt XML schemas

The libvirt API uses XML schemas/documents to describe the configuration of many of its managed objects. Thus when using the libvirt-go package, it is often neccessary to either parse or format XML documents. This package defines a set of Go structs which have been annotated for use with the encoding/xml API to manage libvirt XML documents.

Example creating a domain XML document from configuration:

import (
 "github.com/libvirt/libvirt-go-xml"
)

domcfg := &libvirtxml.Domain{Type: "kvm", Name: "demo",
                             UUID: "8f99e332-06c4-463a-9099-330fb244e1b3",
                             ....}
xmldoc, err := domcfg.Marshal()

Example parsing a domainXML document, in combination with libvirt-go

import (
  "github.com/libvirt/libvirt-go"
  "github.com/libvirt/libvirt-go-xml"
  "fmt"
)

conn, err := libvirt.NewConnect("qemu:///system")
dom := conn.LookupDomainByName("demo")
xmldoc, err := dom.GetXMLDesc(0)

domcfg := &libvirtxml.Domain{}
err := domcfg.Unmarshal(xmldoc)

fmt.Printf("Virt type %s", domcfg.Type)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caps

type Caps struct {
	XMLName xml.Name    `xml:"capabilities"`
	Host    CapsHost    `xml:"host"`
	Guests  []CapsGuest `xml:"guest"`
}

func (*Caps) Marshal

func (c *Caps) Marshal() (string, error)

func (*Caps) Unmarshal

func (c *Caps) Unmarshal(doc string) error

type CapsGuest

type CapsGuest struct {
	OSType   string             `xml:"os_type"`
	Arch     CapsGuestArch      `xml:"arch"`
	Features *CapsGuestFeatures `xml:"features"`
}

type CapsGuestArch

type CapsGuestArch struct {
	Name     string             `xml:"name,attr"`
	WordSize string             `xml:"wordsize"`
	Emulator string             `xml:"emulator"`
	Machines []CapsGuestMachine `xml:"machine"`
	Domains  []CapsGuestDomain  `xml:"domain"`
}

type CapsGuestDomain

type CapsGuestDomain struct {
	Type     string             `xml:"type,attr"`
	Emulator string             `xml:"emulator"`
	Machines []CapsGuestMachine `xml:"machine"`
}

type CapsGuestFeatures

type CapsGuestFeatures struct {
	CPUSelection *struct{} `xml:"cpuselection"`
	DeviceBoot   *struct{} `xml:"deviceboot"`
}

type CapsGuestMachine

type CapsGuestMachine struct {
	Name      string  `xml:",chardata"`
	MaxCPUs   int     `xml:"maxCpus,attr"`
	Canonical *string `xml:"canonical,attr"`
}

type CapsHost

type CapsHost struct {
	UUID     string                `xml:"uuid"`
	CPU      *CapsHostCPU          `xml:"cpu"`
	NUMA     *CapsHostNUMATopology `xml:"topology"`
	SecModel []CapsHostSecModel    `xml:"secmodel"`
}

type CapsHostCPU

type CapsHostCPU struct {
	Arch      string                `xml:"arch"`
	Model     string                `xml:"model"`
	Vendor    string                `xml:"vendor"`
	Topology  CapsHostCPUTopology   `xml:"topology"`
	Features  []CapsHostCPUFeature  `xml:"feature"`
	PageSizes []CapsHostCPUPageSize `xml:"pages"`
}

type CapsHostCPUFeature

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

type CapsHostCPUPageSize

type CapsHostCPUPageSize struct {
	Size int    `xml:"size,attr"`
	Unit string `xml:"unit,attr"`
}

type CapsHostCPUTopology

type CapsHostCPUTopology struct {
	Sockets int `xml:"sockets,attr"`
	Cores   int `xml:"cores,attr"`
	Threads int `xml:"threads,attr"`
}

type CapsHostNUMACPU

type CapsHostNUMACPU struct {
	ID       int    `xml:"id,attr"`
	SocketID int    `xml:"socket_id,attr"`
	CoreID   int    `xml:"core_id,attr"`
	Siblings string `xml:"siblings,attr"`
}

type CapsHostNUMACell

type CapsHostNUMACell struct {
	ID        int                    `xml:"id,attr"`
	Memory    CapsHostNUMAMemory     `xml:"memory"`
	PageInfo  []CapsHostNUMAPageInfo `xml:"pages"`
	Distances []CapsHostNUMADistance `xml:"distances>sibling"`
	CPUS      []CapsHostNUMACPU      `xml:"cpus>cpu"`
}

type CapsHostNUMADistance

type CapsHostNUMADistance struct {
	ID    int `xml:"id,attr"`
	Value int `xml:"value,attr"`
}

type CapsHostNUMAMemory

type CapsHostNUMAMemory struct {
	Size uint64 `xml:"size,attr"`
	Unit string `xml:"unit,attr"`
}

type CapsHostNUMAPageInfo

type CapsHostNUMAPageInfo struct {
	Size  int    `xml:"size,attr"`
	Unit  string `xml:"unit,attr"`
	Count uint64 `xml:",chardata"`
}

type CapsHostNUMATopology

type CapsHostNUMATopology struct {
	Cells []CapsHostNUMACell `xml:"cells>cell"`
}

type CapsHostSecModel

type CapsHostSecModel struct {
	Name   string                  `xml:"model"`
	DOI    string                  `xml:"doi"`
	Labels []CapsHostSecModelLabel `xml:"baselabel"`
}

type CapsHostSecModelLabel

type CapsHostSecModelLabel struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",chardata"`
}

type Document

type Document interface {
	Unmarshal(doc string) error
	Marshal() (string, error)
}

type Domain

type Domain struct {
	XMLName       xml.Name           `xml:"domain"`
	Type          string             `xml:"type,attr,omitempty"`
	Name          string             `xml:"name"`
	UUID          string             `xml:"uuid,omitempty"`
	Memory        *DomainMemory      `xml:"memory"`
	CurrentMemory *DomainMemory      `xml:"currentMemory"`
	MaximumMemory *DomainMaxMemory   `xml:"maxMemory"`
	VCPU          *DomainVCPU        `xml:"vcpu"`
	Resource      *DomainResource    `xml:"resource"`
	SysInfo       *DomainSysInfo     `xml:"sysinfo"`
	OS            *DomainOS          `xml:"os"`
	Features      *DomainFeatureList `xml:"features"`
	CPU           *DomainCPU         `xml:"cpu"`
	OnPoweroff    string             `xml:"on_poweroff,omitempty"`
	OnReboot      string             `xml:"on_reboot,omitempty"`
	OnCrash       string             `xml:"on_crash,omitempty"`
	Devices       *DomainDeviceList  `xml:"devices"`
}

NB, try to keep the order of fields in this struct matching the order of XML elements that libvirt will generate when dumping XML.

func (*Domain) Marshal

func (d *Domain) Marshal() (string, error)

func (*Domain) Unmarshal

func (d *Domain) Unmarshal(doc string) error

type DomainAddress

type DomainAddress struct {
	Type       string `xml:"type,attr"`
	Controller *uint  `xml:"controller,attr"`
	Domain     *uint  `xml:"domain,attr"`
	Bus        *uint  `xml:"bus,attr"`
	Port       *uint  `xml:"port,attr"`
	Slot       *uint  `xml:"slot,attr"`
	Function   *uint  `xml:"function,attr"`
	Target     *uint  `xml:"target,attr"`
	Unit       *uint  `xml:"unit,attr"`
}

type DomainAlias

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

type DomainBIOS

type DomainBIOS struct {
	UseSerial     string `xml:"useserial,attr"`
	RebootTimeout string `xml:"rebootTimeout,attr"`
}

type DomainBootDevice

type DomainBootDevice struct {
	Dev string `xml:"dev,attr"`
}

type DomainBootMenu

type DomainBootMenu struct {
	Enabled string `xml:"enabled,attr"`
	Timeout string `xml:"timeout,attr"`
}

type DomainCPU

type DomainCPU struct {
	Match    string             `xml:"match,attr,omitempty"`
	Mode     string             `xml:"mode,attr,omitempty"`
	Model    *DomainCPUModel    `xml:"model"`
	Vendor   string             `xml:"vendor,omitempty"`
	Topology *DomainCPUTopology `xml:"topology"`
	Features []DomainCPUFeature `xml:"feature"`
}

type DomainCPUFeature

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

type DomainCPUModel

type DomainCPUModel struct {
	Fallback string `xml:"fallback,attr,omitempty"`
	Value    string `xml:",chardata"`
}

type DomainCPUTopology

type DomainCPUTopology struct {
	Sockets int `xml:"sockets,attr,omitempty"`
	Cores   int `xml:"cores,attr,omitempty"`
	Threads int `xml:"threads,attr,omitempty"`
}

type DomainChannel

type DomainChannel struct {
	XMLName xml.Name             `xml:"channel"`
	Type    string               `xml:"type,attr"`
	Source  *DomainChardevSource `xml:"source"`
	Target  *DomainChannelTarget `xml:"target"`
	Alias   *DomainAlias         `xml:"alias"`
	Address *DomainAddress       `xml:"address"`
}

func (*DomainChannel) Marshal

func (d *DomainChannel) Marshal() (string, error)

func (*DomainChannel) Unmarshal

func (d *DomainChannel) Unmarshal(doc string) error

type DomainChannelTarget

type DomainChannelTarget struct {
	Type  string `xml:"type,attr,omitempty"`
	Name  string `xml:"name,attr,omitempty"`
	State string `xml:"state,attr,omitempty"` // is guest agent connected?
}

type DomainChardevSource

type DomainChardevSource struct {
	Mode   string `xml:"mode,attr,omitempty"`
	Path   string `xml:"path,attr"`
	Append string `xml:"append,attr,omitempty"`
}

type DomainChardevTarget

type DomainChardevTarget struct {
	Type  string `xml:"type,attr,omitempty"`
	Name  string `xml:"name,attr,omitempty"`
	State string `xml:"state,attr,omitempty"` // is guest agent connected?
	Port  *uint  `xml:"port,attr"`
}

type DomainConsole

type DomainConsole struct {
	XMLName xml.Name             `xml:"console"`
	Type    string               `xml:"type,attr"`
	Source  *DomainChardevSource `xml:"source"`
	Target  *DomainConsoleTarget `xml:"target"`
	Alias   *DomainAlias         `xml:"alias"`
	Address *DomainAddress       `xml:"address"`
}

func (*DomainConsole) Marshal

func (d *DomainConsole) Marshal() (string, error)

func (*DomainConsole) Unmarshal

func (d *DomainConsole) Unmarshal(doc string) error

type DomainConsoleTarget

type DomainConsoleTarget struct {
	Type string `xml:"type,attr,omitempty"`
	Port *uint  `xml:"port,attr"`
}

type DomainController

type DomainController struct {
	XMLName xml.Name       `xml:"controller"`
	Type    string         `xml:"type,attr"`
	Index   *uint          `xml:"index,attr"`
	Model   string         `xml:"model,attr,omitempty"`
	Address *DomainAddress `xml:"address"`
}

func (*DomainController) Marshal

func (d *DomainController) Marshal() (string, error)

func (*DomainController) Unmarshal

func (d *DomainController) Unmarshal(doc string) error

type DomainDeviceBoot

type DomainDeviceBoot struct {
	Order uint `xml:"order,attr"`
}

type DomainDeviceList

type DomainDeviceList struct {
	Emulator    string             `xml:"emulator,omitempty"`
	Controllers []DomainController `xml:"controller"`
	Disks       []DomainDisk       `xml:"disk"`
	Filesystems []DomainFilesystem `xml:"filesystem"`
	Interfaces  []DomainInterface  `xml:"interface"`
	Serials     []DomainSerial     `xml:"serial"`
	Consoles    []DomainConsole    `xml:"console"`
	Inputs      []DomainInput      `xml:"input"`
	Graphics    []DomainGraphic    `xml:"graphics"`
	Videos      []DomainVideo      `xml:"video"`
	Channels    []DomainChannel    `xml:"channel"`
	MemBalloon  *DomainMemBalloon  `xml:"memballoon"`
	Sounds      []DomainSound      `xml:"sound"`
}

type DomainDisk

type DomainDisk struct {
	XMLName   xml.Name             `xml:"disk"`
	Type      string               `xml:"type,attr"`
	Device    string               `xml:"device,attr"`
	Snapshot  string               `xml:"snapshot,attr,omitempty"`
	Driver    *DomainDiskDriver    `xml:"driver"`
	Auth      *DomainDiskAuth      `xml:"auth"`
	Source    *DomainDiskSource    `xml:"source"`
	Target    *DomainDiskTarget    `xml:"target"`
	IOTune    *DomainDiskIOTune    `xml:"iotune"`
	Serial    string               `xml:"serial,omitempty"`
	ReadOnly  *DomainDiskReadOnly  `xml:"readonly"`
	Shareable *DomainDiskShareable `xml:"shareable"`
	Address   *DomainAddress       `xml:"address"`
	Boot      *DomainDeviceBoot    `xml:"boot"`
}

func (*DomainDisk) Marshal

func (d *DomainDisk) Marshal() (string, error)

func (*DomainDisk) Unmarshal

func (d *DomainDisk) Unmarshal(doc string) error

type DomainDiskAuth

type DomainDiskAuth struct {
	Username string            `xml:"username,attr,omitempty"`
	Secret   *DomainDiskSecret `xml:"secret"`
}

type DomainDiskDriver

type DomainDiskDriver struct {
	Name        string `xml:"name,attr,omitempty"`
	Type        string `xml:"type,attr,omitempty"`
	Cache       string `xml:"cache,attr,omitempty"`
	IO          string `xml:"io,attr,omitempty"`
	ErrorPolicy string `xml:"error_policy,attr,omitempty"`
	Discard     string `xml:"discard,attr,omitempty"`
}

type DomainDiskIOTune

type DomainDiskIOTune struct {
	TotalBytesSec          uint64 `xml:"total_bytes_sec"`
	ReadBytesSec           uint64 `xml:"read_bytes_sec"`
	WriteBytesSec          uint64 `xml:"write_bytes_sec"`
	TotalIopsSec           uint64 `xml:"total_iops_sec"`
	ReadIopsSec            uint64 `xml:"read_iops_sec"`
	WriteIopsSec           uint64 `xml:"write_iops_sec"`
	TotalBytesSecMax       uint64 `xml:"total_bytes_sec_max"`
	ReadBytesSecMax        uint64 `xml:"read_bytes_sec_max"`
	WriteBytesSecMax       uint64 `xml:"write_bytes_sec_max"`
	TotalIopsSecMax        uint64 `xml:"total_iops_sec_max"`
	ReadIopsSecMax         uint64 `xml:"read_iops_sec_max"`
	WriteIopsSecMax        uint64 `xml:"write_iops_sec_max"`
	TotalBytesSecMaxLength uint64 `xml:"total_bytes_sec_max_length"`
	ReadBytesSecMaxLength  uint64 `xml:"read_bytes_sec_max_length"`
	WriteBytesSecMaxLength uint64 `xml:"write_bytes_sec_max_length"`
	TotalIopsSecMaxLength  uint64 `xml:"total_iops_sec_max_length"`
	ReadIopsSecMaxLength   uint64 `xml:"read_iops_sec_max_length"`
	WriteIopsSecMaxLength  uint64 `xml:"write_iops_sec_max_length"`
	SizeIopsSec            uint64 `xml:"size_iops_sec"`
	GroupName              string `xml:"group_name"`
}

type DomainDiskReadOnly

type DomainDiskReadOnly struct {
}

type DomainDiskSecret

type DomainDiskSecret struct {
	Type  string `xml:"type,attr,omitempty"`
	Usage string `xml:"usage,attr,omitempty"`
	UUID  string `xml:"uuid,attr,omitempty"`
}

type DomainDiskShareable

type DomainDiskShareable struct {
}

type DomainDiskSource

type DomainDiskSource struct {
	File          string                 `xml:"file,attr,omitempty"`
	Device        string                 `xml:"dev,attr,omitempty"`
	Protocol      string                 `xml:"protocol,attr,omitempty"`
	Name          string                 `xml:"name,attr,omitempty"`
	Pool          string                 `xml:"pool,attr,omitempty"`
	Volume        string                 `xml:"volume,attr,omitempty"`
	Hosts         []DomainDiskSourceHost `xml:"host"`
	StartupPolicy string                 `xml:"startupPolicy,attr,omitempty"`
}

type DomainDiskSourceHost

type DomainDiskSourceHost struct {
	Transport string `xml:"transport,attr,omitempty"`
	Name      string `xml:"name,attr,omitempty"`
	Port      string `xml:"port,attr,omitempty"`
	Socket    string `xml:"socket,attr,omitempty"`
}

type DomainDiskTarget

type DomainDiskTarget struct {
	Dev string `xml:"dev,attr,omitempty"`
	Bus string `xml:"bus,attr,omitempty"`
}

type DomainFeature

type DomainFeature struct {
}

type DomainFeatureAPIC

type DomainFeatureAPIC struct {
	EOI string `xml:"eio,attr,omitempty"`
}

type DomainFeatureGIC

type DomainFeatureGIC struct {
	Version string `xml:"version,attr,omitempty"`
}

type DomainFeatureHyperV

type DomainFeatureHyperV struct {
	DomainFeature
	Relaxed   *DomainFeatureState           `xml:"relaxed"`
	VAPIC     *DomainFeatureState           `xml:"vapic"`
	Spinlocks *DomainFeatureHyperVSpinlocks `xml:"spinlocks"`
	VPIndex   *DomainFeatureState           `xml:"vpindex"`
	Runtime   *DomainFeatureState           `xml:"runtime"`
	Synic     *DomainFeatureState           `xml:"synic"`
	STimer    *DomainFeatureState           `xml:"stimer"`
	Reset     *DomainFeatureState           `xml:"reset"`
	VendorId  *DomainFeatureHyperVVendorId  `xml:"vendor_id"`
}

type DomainFeatureHyperVSpinlocks

type DomainFeatureHyperVSpinlocks struct {
	DomainFeatureState
	Retries uint `xml:"retries,attr,omitempty"`
}

type DomainFeatureHyperVVendorId

type DomainFeatureHyperVVendorId struct {
	DomainFeatureState
	Value string `xml:"value,attr,omitempty"`
}

type DomainFeatureKVM

type DomainFeatureKVM struct {
	Hidden *DomainFeatureState `xml:"hidden"`
}

type DomainFeatureList

type DomainFeatureList struct {
	PAE        *DomainFeature       `xml:"pae"`
	ACPI       *DomainFeature       `xml:"acpi"`
	APIC       *DomainFeatureAPIC   `xml:"apic"`
	HAP        *DomainFeatureState  `xml:"hap"`
	Viridian   *DomainFeature       `xml:"viridian"`
	PrivNet    *DomainFeature       `xml:"privnet"`
	HyperV     *DomainFeatureHyperV `xml:"hyperv"`
	KVM        *DomainFeatureKVM    `xml:"kvm"`
	PVSpinlock *DomainFeatureState  `xml:"pvspinlock"`
	PMU        *DomainFeatureState  `xml:"pmu"`
	VMPort     *DomainFeatureState  `xml:"vmport"`
	GIC        *DomainFeatureGIC    `xml:"gic"`
	SMM        *DomainFeatureState  `xml:"smm"`
}

type DomainFeatureState

type DomainFeatureState struct {
	State string `xml:"state,attr,omitempty"`
}

type DomainFilesystem

type DomainFilesystem struct {
	XMLName        xml.Name                        `xml:"filesystem"`
	Type           string                          `xml:"type,attr"`
	AccessMode     string                          `xml:"accessmode,attr"`
	Driver         *DomainFilesystemDriver         `xml:"driver"`
	Source         *DomainFilesystemSource         `xml:"source"`
	Target         *DomainFilesystemTarget         `xml:"target"`
	ReadOnly       *DomainFilesystemReadOnly       `xml:"readonly"`
	SpaceHardLimit *DomainFilesystemSpaceHardLimit `xml:"space_hard_limit"`
	SpaceSoftLimit *DomainFilesystemSpaceSoftLimit `xml:"space_soft_limit"`
	Address        *DomainAddress                  `xml:"address"`
}

func (*DomainFilesystem) Marshal

func (d *DomainFilesystem) Marshal() (string, error)

func (*DomainFilesystem) Unmarshal

func (d *DomainFilesystem) Unmarshal(doc string) error

type DomainFilesystemDriver

type DomainFilesystemDriver struct {
	Type     string `xml:"type,attr"`
	Name     string `xml:"name,attr,omitempty"`
	WRPolicy string `xml:"wrpolicy,attr,omitempty"`
}

type DomainFilesystemReadOnly

type DomainFilesystemReadOnly struct {
}

type DomainFilesystemSource

type DomainFilesystemSource struct {
	Dir  string `xml:"dir,attr,omitempty"`
	File string `xml:"file,attr,omitempty"`
}

type DomainFilesystemSpaceHardLimit

type DomainFilesystemSpaceHardLimit struct {
	Value uint   `xml:",chardata"`
	Unit  string `xml:"unit,attr,omitempty"`
}

type DomainFilesystemSpaceSoftLimit

type DomainFilesystemSpaceSoftLimit struct {
	Value uint   `xml:",chardata"`
	Unit  string `xml:"unit,attr,omitempty"`
}

type DomainFilesystemTarget

type DomainFilesystemTarget struct {
	Dir string `xml:"dir,attr"`
}

type DomainGraphic

type DomainGraphic struct {
	XMLName       xml.Name                `xml:"graphics"`
	Type          string                  `xml:"type,attr"`
	AutoPort      string                  `xml:"autoport,attr,omitempty"`
	Port          int                     `xml:"port,attr,omitempty"`
	TLSPort       int                     `xml:"tlsPort,attr,omitempty"`
	WebSocket     int                     `xml:"websocket,attr,omitempty"`
	Listen        string                  `xml:"listen,attr,omitempty"`
	Socket        string                  `xml:"socket,attr,omitempty"`
	Keymap        string                  `xml:"keymap,attr,omitempty"`
	Passwd        string                  `xml:"passwd,attr,omitempty"`
	PasswdValidTo string                  `xml:"passwdValidTo,attr,omitempty"`
	Connected     string                  `xml:"connected,attr,omitempty"`
	SharePolicy   string                  `xml:"sharePolicy,attr,omitempty"`
	DefaultMode   string                  `xml:"defaultMode,attr,omitempty"`
	Display       string                  `xml:"display,attr,omitempty"`
	XAuth         string                  `xml:"xauth,attr,omitempty"`
	FullScreen    string                  `xml:"fullscreen,attr,omitempty"`
	ReplaceUser   string                  `xml:"replaceUser,attr,omitempty"`
	MultiUser     string                  `xml:"multiUser,attr,omitempty"`
	Listeners     []DomainGraphicListener `xml:"listen"`
}

type DomainGraphicListener

type DomainGraphicListener struct {
	Type    string `xml:"type,attr"`
	Address string `xml:"address,attr,omitempty"`
	Network string `xml:"network,attr,omitempty"`
	Socket  string `xml:"socket,attr,omitempty"`
}

type DomainInput

type DomainInput struct {
	XMLName xml.Name       `xml:"input"`
	Type    string         `xml:"type,attr"`
	Bus     string         `xml:"bus,attr"`
	Address *DomainAddress `xml:"address"`
}

func (*DomainInput) Marshal

func (d *DomainInput) Marshal() (string, error)

func (*DomainInput) Unmarshal

func (d *DomainInput) Unmarshal(doc string) error

type DomainInterface

type DomainInterface struct {
	XMLName     xml.Name                    `xml:"interface"`
	Type        string                      `xml:"type,attr"`
	MAC         *DomainInterfaceMAC         `xml:"mac"`
	Model       *DomainInterfaceModel       `xml:"model"`
	Source      *DomainInterfaceSource      `xml:"source"`
	Target      *DomainInterfaceTarget      `xml:"target"`
	Alias       *DomainInterfaceAlias       `xml:"alias"`
	Link        *DomainInterfaceLink        `xml:"link"`
	Boot        *DomainDeviceBoot           `xml:"boot"`
	Script      *DomainInterfaceScript      `xml:"script"`
	Driver      *DomainInterfaceDriver      `xml:"driver"`
	Virtualport *DomainInterfaceVirtualport `xml:"virtualport"`
	Address     *DomainAddress              `xml:"address"`
}

func (*DomainInterface) Marshal

func (d *DomainInterface) Marshal() (string, error)

func (*DomainInterface) Unmarshal

func (d *DomainInterface) Unmarshal(doc string) error

type DomainInterfaceAlias

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

type DomainInterfaceDriver

type DomainInterfaceDriver struct {
	Name   string `xml:"name,attr"`
	Queues uint   `xml:"queues,attr,omitempty"`
}
type DomainInterfaceLink struct {
	State string `xml:"state,attr"`
}

type DomainInterfaceMAC

type DomainInterfaceMAC struct {
	Address string `xml:"address,attr"`
}

type DomainInterfaceModel

type DomainInterfaceModel struct {
	Type string `xml:"type,attr"`
}

type DomainInterfaceScript

type DomainInterfaceScript struct {
	Path string `xml:"path,attr"`
}

type DomainInterfaceSource

type DomainInterfaceSource struct {
	Bridge  string `xml:"bridge,attr,omitempty"`
	Dev     string `xml:"dev,attr,omitempty"`
	Network string `xml:"network,attr,omitempty"`
	Address string `xml:"address,attr,omitempty"`
	Type    string `xml:"type,attr,omitempty"`
	Path    string `xml:"path,attr,omitempty"`
	Mode    string `xml:"mode,attr,omitempty"`
	Port    uint   `xml:"port,attr,omitempty"`
}

type DomainInterfaceTarget

type DomainInterfaceTarget struct {
	Dev string `xml:"dev,attr"`
}

type DomainInterfaceVirtualport

type DomainInterfaceVirtualport struct {
	Type string `xml:"type,attr"`
}

type DomainLoader

type DomainLoader struct {
	Path     string `xml:",chardata"`
	Readonly string `xml:"readonly,attr"`
	Secure   string `xml:"secure,attr"`
	Type     string `xml:"type,attr"`
}

type DomainMaxMemory

type DomainMaxMemory struct {
	Value uint   `xml:",chardata"`
	Unit  string `xml:"unit,attr,omitempty"`
	Slots uint   `xml:"slots,attr,omitempty"`
}

type DomainMemBalloon

type DomainMemBalloon struct {
	XMLName xml.Name       `xml:"memballoon"`
	Model   string         `xml:"model,attr"`
	Address *DomainAddress `xml:"address"`
}

func (*DomainMemBalloon) Marshal

func (d *DomainMemBalloon) Marshal() (string, error)

func (*DomainMemBalloon) Unmarshal

func (d *DomainMemBalloon) Unmarshal(doc string) error

type DomainMemory

type DomainMemory struct {
	Value uint   `xml:",chardata"`
	Unit  string `xml:"unit,attr,omitempty"`
}

type DomainNVRam

type DomainNVRam struct {
	NVRam    string `xml:",chardata"`
	Template string `xml:"template,attr"`
}

type DomainOS

type DomainOS struct {
	Type        *DomainOSType      `xml:"type"`
	Loader      *DomainLoader      `xml:"loader"`
	NVRam       *DomainNVRam       `xml:"nvram"`
	Kernel      string             `xml:"kernel,omitempty"`
	Initrd      string             `xml:"initrd,omitempty"`
	KernelArgs  string             `xml:"cmdline,omitempty"`
	BootDevices []DomainBootDevice `xml:"boot"`
	BootMenu    *DomainBootMenu    `xml:"bootmenu"`
	SMBios      *DomainSMBios      `xml:"smbios"`
	BIOS        *DomainBIOS        `xml:"bios"`
	Init        string             `xml:"init,omitempty"`
	InitArgs    []string           `xml:"initarg"`
}

type DomainOSType

type DomainOSType struct {
	Arch    string `xml:"arch,attr,omitempty"`
	Machine string `xml:"machine,attr,omitempty"`
	Type    string `xml:",chardata"`
}

type DomainResource

type DomainResource struct {
	Partition string `xml:"partition,omitempty"`
}

type DomainSMBios

type DomainSMBios struct {
	Mode string `xml:"mode,attr"`
}

type DomainSerial

type DomainSerial struct {
	XMLName xml.Name             `xml:"serial"`
	Type    string               `xml:"type,attr"`
	Source  *DomainChardevSource `xml:"source"`
	Target  *DomainSerialTarget  `xml:"target"`
	Alias   *DomainAlias         `xml:"alias"`
	Address *DomainAddress       `xml:"address"`
}

func (*DomainSerial) Marshal

func (d *DomainSerial) Marshal() (string, error)

func (*DomainSerial) Unmarshal

func (d *DomainSerial) Unmarshal(doc string) error

type DomainSerialTarget

type DomainSerialTarget struct {
	Type string `xml:"type,attr,omitempty"`
	Port *uint  `xml:"port,attr"`
}

type DomainSnapshot

type DomainSnapshot struct {
	XMLName      xml.Name              `xml:"domainsnapshot"`
	Name         string                `xml:"name,omitempty"`
	Description  string                `xml:"description,omitempty"`
	State        string                `xml:"state,omitempty"`
	CreationTime string                `xml:"creationTime,omitempty"`
	Parent       *DomainSnapshotParent `xml:"parent"`
	Memory       *DomainSnapshotMemory `xml:"memory"`
	Disks        *DomainSnapshotDisks  `xml:"disks"`
	Domain       *Domain               `xml:"domain"`
}

func (*DomainSnapshot) Marshal

func (s *DomainSnapshot) Marshal() (string, error)

func (*DomainSnapshot) Unmarshal

func (s *DomainSnapshot) Unmarshal(doc string) error

type DomainSnapshotDisk

type DomainSnapshotDisk struct {
	Name     string                    `xml:"name,attr"`
	Snapshot string                    `xml:"snapshot,attr,omitempty"`
	Driver   *DomainSnapshotDiskDriver `xml:"driver"`
	Source   *DomainSnapshotDiskSource `xml:"source"`
}

type DomainSnapshotDiskDriver

type DomainSnapshotDiskDriver struct {
	Type string `xml:"type,attr"`
}

type DomainSnapshotDiskSource

type DomainSnapshotDiskSource struct {
	File string `xml:"file,attr"`
}

type DomainSnapshotDisks

type DomainSnapshotDisks struct {
	Disks []DomainSnapshotDisk `xml:"disk"`
}

type DomainSnapshotMemory

type DomainSnapshotMemory struct {
	Snapshot string `xml:"snapshot,attr"`
}

type DomainSnapshotParent

type DomainSnapshotParent struct {
	Name string `xml:"name"`
}

type DomainSound

type DomainSound struct {
	XMLName xml.Name          `xml:"sound"`
	Model   string            `xml:"model,attr"`
	Codec   *DomainSoundCodec `xml:"codec"`
	Address *DomainAddress    `xml:"address"`
}

func (*DomainSound) Marshal

func (d *DomainSound) Marshal() (string, error)

func (*DomainSound) Unmarshal

func (d *DomainSound) Unmarshal(doc string) error

type DomainSoundCodec

type DomainSoundCodec struct {
	Type string `xml:"type,attr"`
}

type DomainSysInfo

type DomainSysInfo struct {
	Type      string               `xml:"type,attr"`
	System    []DomainSysInfoEntry `xml:"system>entry"`
	BIOS      []DomainSysInfoEntry `xml:"bios>entry"`
	BaseBoard []DomainSysInfoEntry `xml:"baseBoard>entry"`
}

type DomainSysInfoEntry

type DomainSysInfoEntry struct {
	Name  string `xml:"name,attr"`
	Value string `xml:",chardata"`
}

type DomainVCPU

type DomainVCPU struct {
	Placement string `xml:"placement,attr,omitempty"`
	CPUSet    string `xml:"cpuset,attr,omitempty"`
	Current   string `xml:"current,attr,omitempty"`
	Value     int    `xml:",chardata"`
}

type DomainVideo

type DomainVideo struct {
	XMLName xml.Name         `xml:"video"`
	Model   DomainVideoModel `xml:"model"`
	Address *DomainAddress   `xml:"address"`
}

func (*DomainVideo) Marshal

func (d *DomainVideo) Marshal() (string, error)

func (*DomainVideo) Unmarshal

func (d *DomainVideo) Unmarshal(doc string) error

type DomainVideoModel

type DomainVideoModel struct {
	Type   string `xml:"type,attr"`
	Heads  uint   `xml:"heads,attr,omitempty"`
	Ram    uint   `xml:"ram,attr,omitempty"`
	VRam   uint   `xml:"vram,attr,omitempty"`
	VGAMem uint   `xml:"vgamem,attr,omitempty"`
}

type Network

type Network struct {
	XMLName             xml.Name        `xml:"network"`
	IPv6                string          `xml:"ipv6,attr,omitempty"`
	TrustGuestRxFilters string          `xml:"trustGuestRxFilters,attr,omitempty"`
	Name                string          `xml:"name,omitempty"`
	UUID                string          `xml:"uuid,omitempty"`
	MAC                 *NetworkMAC     `xml:"mac"`
	Bridge              *NetworkBridge  `xml:"bridge"`
	Forward             *NetworkForward `xml:"forward"`
	Domain              *NetworkDomain  `xml:"domain"`
	IPs                 []NetworkIP     `xml:"ip"`
	Routes              []NetworkRoute  `xml:"route"`
}

func (*Network) Marshal

func (s *Network) Marshal() (string, error)

func (*Network) Unmarshal

func (s *Network) Unmarshal(doc string) error

type NetworkBridge

type NetworkBridge struct {
	Name            string `xml:"name,attr,omitempty"`
	STP             string `xml:"stp,attr,omitempty"`
	Delay           string `xml:"delay,attr,omitempty"`
	MACTableManager string `xml:"macTableManager,attr,omitempty"`
}

type NetworkDHCP

type NetworkDHCP struct {
	Ranges []NetworkDHCPRange `xml:"range"`
	Hosts  []NetworkDHCPHost  `xml:"host"`
}

type NetworkDHCPHost

type NetworkDHCPHost struct {
	ID   string `xml:"id,attr,omitempty"`
	MAC  string `xml:"mac,attr,omitempty"`
	Name string `xml:"name,attr,omitempty"`
	IP   string `xml:"ip,attr,omitempty"`
}

type NetworkDHCPRange

type NetworkDHCPRange struct {
	Start string `xml:"start,attr,omitempty"`
	End   string `xml:"end,attr,omitempty"`
}

type NetworkDomain

type NetworkDomain struct {
	Name      string `xml:"name,attr,omitempty"`
	LocalOnly string `xml:"localOnly,attr,omitempty"`
}

type NetworkForward

type NetworkForward struct {
	Mode string `xml:"mode,attr,omitempty"`
	Dev  string `xml:"dev,attr,omitempty"`
}

type NetworkIP

type NetworkIP struct {
	Address  string       `xml:"address,attr,omitempty"`
	Family   string       `xml:"family,attr,omitempty"`
	Netmask  string       `xml:"netmask,attr,omitempty"`
	Prefix   string       `xml:"prefix,attr,omitempty"`
	LocalPtr string       `xml:"localPtr,attr,omitempty"`
	DHCP     *NetworkDHCP `xml:"dhcp"`
}

type NetworkMAC

type NetworkMAC struct {
	Address string `xml:"address,attr,omitempty"`
}

type NetworkRoute

type NetworkRoute struct {
	Address string `xml:"address,attr,omitempty"`
	Family  string `xml:"family,attr,omitempty"`
	Prefix  string `xml:"prefix,attr,omitempty"`
	Metric  string `xml:"metric,attr,omitempty"`
	Gateway string `xml:"gateway,attr,omitempty"`
}

type Secret

type Secret struct {
	XMLName     xml.Name     `xml:"secret"`
	Ephemeral   string       `xml:"ephemeral,attr,omitempty"`
	Private     string       `xml:"private,attr,omitempty"`
	Description string       `xml:"description,omitempty"`
	UUID        string       `xml:"uuid,omitempty"`
	Usage       *SecretUsage `xml:"usage"`
}

func (*Secret) Marshal

func (s *Secret) Marshal() (string, error)

func (*Secret) Unmarshal

func (s *Secret) Unmarshal(doc string) error

type SecretUsage

type SecretUsage struct {
	Type   string `xml:"type,attr"`
	Volume string `xml:"volume,omitempty"`
	Name   string `xml:"name,omitempty"`
	Target string `xml:"target,omitempty"`
}

type StorageEncryption

type StorageEncryption struct {
	Format string                   `xml:"format,attr"`
	Secret *StorageEncryptionSecret `xml:"secret"`
	Cipher *StorageEncryptionCipher `xml:"cipher"`
	Ivgen  *StorageEncryptionIvgen  `xml:"ivgen"`
}

type StorageEncryptionCipher

type StorageEncryptionCipher struct {
	Name string `xml:"name,attr"`
	Size uint64 `xml:"size,attr"`
	Mode string `xml:"mode,attr"`
	Hash string `xml:"hash,attr"`
}

type StorageEncryptionIvgen

type StorageEncryptionIvgen struct {
	Name string `xml:"name,attr"`
	Hash string `xml:"hash,attr"`
}

type StorageEncryptionSecret

type StorageEncryptionSecret struct {
	Type string `xml:"type,attr"`
	UUID string `xml:"uuid,attr"`
}

type StoragePool

type StoragePool struct {
	XMLName    xml.Name           `xml:"pool"`
	Type       string             `xml:"type,attr"`
	Name       string             `xml:"name"`
	UUID       string             `xml:"uuid,omitempty"`
	Allocation *StoragePoolSize   `xml:"allocation,omitempty"`
	Capacity   *StoragePoolSize   `xml:"capacity,omitempty"`
	Available  *StoragePoolSize   `xml:"available,omitempty"`
	Target     *StoragePoolTarget `xml:"target"`
	Source     *StoragePoolSource `xml:"source"`
}

func (*StoragePool) Marshal

func (s *StoragePool) Marshal() (string, error)

func (*StoragePool) Unmarshal

func (s *StoragePool) Unmarshal(doc string) error

type StoragePoolSize

type StoragePoolSize struct {
	Unit  string `xml:"unit,attr,omitempty"`
	Value uint64 `xml:",chardata"`
}

type StoragePoolSource

type StoragePoolSource struct {
	Host    *StoragePoolSourceHost    `xml:"host"`
	Device  *StoragePoolSourceDevice  `xml:"device"`
	Auth    *StoragePoolSourceAuth    `xml:"auth"`
	Vendor  *StoragePoolSourceVendor  `xml:"vendor"`
	Product *StoragePoolSourceProduct `xml:"product"`
	Format  *StoragePoolSourceFormat  `xml:"format"`
	Adapter *StoragePoolSourceAdapter `xml:"adapter"`
}

type StoragePoolSourceAdapter

type StoragePoolSourceAdapter struct {
	Type       string                              `xml:"type,attr"`
	Name       string                              `xml:"name,attr,omitempty"`
	Parent     string                              `xml:"parent,attr,omitempty"`
	WWNN       string                              `xml:"wwnn,attr,omitempty"`
	WWPN       string                              `xml:"wwpn,attr,omitempty"`
	ParentAddr *StoragePoolSourceAdapterParentAddr `xml:"parentaddr"`
}

type StoragePoolSourceAdapterParentAddr

type StoragePoolSourceAdapterParentAddr struct {
	UniqueID uint64                                     `xml:"unique_id,attr"`
	Address  *StoragePoolSourceAdapterParentAddrAddress `xml:"address"`
}

type StoragePoolSourceAdapterParentAddrAddress

type StoragePoolSourceAdapterParentAddrAddress struct {
	Domain string `xml:"domain,attr"`
	Bus    string `xml:"bus,attr"`
	Slot   string `xml:"slot,attr"`
	Addr   string `xml:"addr,attr"`
}

type StoragePoolSourceAuth

type StoragePoolSourceAuth struct {
	Type     string                       `xml:"type,attr"`
	Username string                       `xml:"username,attr"`
	Secret   *StoragePoolSourceAuthSecret `xml:"secret"`
}

type StoragePoolSourceAuthSecret

type StoragePoolSourceAuthSecret struct {
	Usage string `xml:"usage,attr"`
}

type StoragePoolSourceDevice

type StoragePoolSourceDevice struct {
	Path          string `xml:"path,attr"`
	PartSeparator string `xml:"part_separator,attr,omitempty"`
}

type StoragePoolSourceFormat

type StoragePoolSourceFormat struct {
	Type string `xml:"type,attr"`
}

type StoragePoolSourceHost

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

type StoragePoolSourceProduct

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

type StoragePoolSourceVendor

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

type StoragePoolTarget

type StoragePoolTarget struct {
	Path        string                        `xml:"path,omitempty"`
	Permissions *StoragePoolTargetPermissions `xml:"permissions"`
	Timestamps  *StoragePoolTargetTimestamps  `xml:"timestamps"`
	Encryption  *StorageEncryption            `xml:"encryption"`
}

type StoragePoolTargetPermissions

type StoragePoolTargetPermissions struct {
	Owner string `xml:"owner,omitempty"`
	Group string `xml:"group,omitempty"`
	Mode  string `xml:"mode,omitempty"`
	Label string `xml:"label,omitempty"`
}

type StoragePoolTargetTimestamps

type StoragePoolTargetTimestamps struct {
	Atime string `xml:"atime"`
	Mtime string `xml:"mtime"`
	Ctime string `xml:"ctime"`
}

type StorageVolume

type StorageVolume struct {
	XMLName      xml.Name                   `xml:"volume"`
	Type         string                     `xml:"type,attr,omitempty"`
	Name         string                     `xml:"name"`
	Key          string                     `xml:"key,omitempty"`
	Allocation   *StorageVolumeSize         `xml:"allocation"`
	Capacity     *StorageVolumeSize         `xml:"capacity"`
	Physical     *StorageVolumeSize         `xml:"physical"`
	Target       *StorageVolumeTarget       `xml:"target"`
	BackingStore *StorageVolumeBackingStore `xml:"backingStore"`
}

func (*StorageVolume) Marshal

func (s *StorageVolume) Marshal() (string, error)

func (*StorageVolume) Unmarshal

func (s *StorageVolume) Unmarshal(doc string) error

type StorageVolumeBackingStore

type StorageVolumeBackingStore struct {
	Path        string                          `xml:"path"`
	Format      *StorageVolumeTargetFormat      `xml:"format"`
	Permissions *StorageVolumeTargetPermissions `xml:"permissions"`
}

type StorageVolumeSize

type StorageVolumeSize struct {
	Unit  string `xml:"unit,attr,omitempty"`
	Value uint64 `xml:",chardata"`
}

type StorageVolumeTarget

type StorageVolumeTarget struct {
	Path        string                          `xml:"path,omitempty"`
	Format      *StorageVolumeTargetFormat      `xml:"format"`
	Permissions *StorageVolumeTargetPermissions `xml:"permissions"`
	Timestamps  *StorageVolumeTargetTimestamps  `xml:"timestamps"`
	Compat      string                          `xml:"compat,omitempty"`
	NoCOW       *struct{}                       `xml:"nocow"`
	Features    []StorageVolumeTargetFeature    `xml:"features"`
	Encryption  *StorageEncryption              `xml:"encryption"`
}

type StorageVolumeTargetFeature

type StorageVolumeTargetFeature struct {
	LazyRefcounts *struct{} `xml:"lazy_refcounts"`
}

type StorageVolumeTargetFormat

type StorageVolumeTargetFormat struct {
	Type string `xml:"type,attr"`
}

type StorageVolumeTargetPermissions

type StorageVolumeTargetPermissions struct {
	Owner string `xml:"owner,omitempty"`
	Group string `xml:"group,omitempty"`
	Mode  string `xml:"mode,omitempty"`
	Label string `xml:"label,omitempty"`
}

type StorageVolumeTargetTimestamps

type StorageVolumeTargetTimestamps struct {
	Atime string `xml:"atime"`
	Mtime string `xml:"mtime"`
	Ctime string `xml:"ctime"`
}

Jump to

Keyboard shortcuts

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