xmlinput

package
v0.0.0-...-3a64f8a Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConTypeBridged        ConnectionMode = "bridged"
	ConTypeOVS                           = "ovs"
	ConTypeDirect                        = "direct"
	ConTypePassthrough                   = "passthrough"
	ConTypeSRIOV                         = "sriov"
	ConTypeVirtualNetwork                = "virtnetwork"
	ConTypeError                         = "error"
)
View Source
const UnlimitedAlloc = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Allow

type Allow struct {
	Vendor      string `xml:"vendor,attr"`
	Model       string `xml:"model,attr"`
	Priority    bool   `xml:"priority,attr"`
	Disjunction bool   `xml:"disjunction,attr"`
}

type Appearance

type Appearance struct {
	Type   ConnectionMode `xml:"mode_type,attr"`
	Appear string         `xml:"appear,attr"`
}

type CPU

type CPU struct {
	Configure bool `xml:"cpu>configure"`
	Min       int  `xml:"cpu>min"`
	Max       int  `xml:"cpu>max"`
	Default   int  `xml:"cpu>default_value"`
}

type ConnectionMode

type ConnectionMode string

type Deny

type Deny struct {
	Vendor string `xml:"vendor,attr"`
	Model  string `xml:"model,attr"`
}

type Disk

type Disk struct {
	Min     int `xml:"min_mb"`
	Max     int `xml:"max_mb"`
	Default int `xml:"default_value_mb"`
}

type Disks

type Disks struct {
	Configure bool    `xml:"disks>configure"`
	Configs   []*Disk `xml:"disks>disk"`
}

type GuestNic

type GuestNic struct {
	PCI *PciAddress `xml:"guest_nics>pci"`
}

type HostNics

type HostNics struct {
	Allowed []*Allow `xml:"host_nics>allow"`
	Denied  []*Deny  `xml:"host_nics>deny"`
}

type Mode

type Mode struct {
	Type       ConnectionMode `xml:"type,attr"`
	VnicDriver string         `xml:"vnic_driver,attr"`
	Tmplt      *Template      `xml:"template"`
}

type NUMA

type NUMA struct {
	AutoConfig         bool `xml:"numa>auto_config"`
	WarnOnUnpinnedCPUs bool `xml:"numa>warn_on_unpinned_cpus"`
	UiEditNUMAConfig   bool `xml:"numa>ui_edit_config"`
}

type Network

type Network struct {
	Name            string        `xml:"name,attr"`
	Optional        bool          `xml:"optional,attr"`
	UiResetCounter  bool          `xml:"ui_reset_counter"`
	NicsDisjunction bool          `xml:"host_nics_disjunction"`
	Modes           []*Mode       `xml:"mode"`
	UiModeBinding   []*Appearance `xml:"ui_mode_selection>appearance"`
}

type Networks

type Networks struct {
	Configure bool       `xml:"networks>configure"`
	Configs   []*Network `xml:"networks>network"`
}

type PciAddress

type PciAddress struct {
	Domain    string `xml:"domain"`
	Bus       string `xml:"bus"`
	FirstSlot int    `xml:"first_slot"`
	Function  string `xml:"function"`
}

type RAM

type RAM struct {
	Configure bool `xml:"ram>configure"`
	Min       int  `xml:"ram>min_mb"`
	Max       int  `xml:"ram>max_mb"`
	Default   int  `xml:"ram>default_value_mb"`
}

type Template

type Template struct {
	FileName string `xml:"file_name,attr"`
	Dir      string `xml:"dir,attr"`
}

type XMLInputData

type XMLInputData struct {
	CPU
	NUMA
	RAM
	Disks
	Networks
	HostNics
	GuestNic
}

func ParseXMLInput

func ParseXMLInput(config string) (*XMLInputData, error)

ParseXMLInputFile is responsible for parsing a given configuration file representing appropriate input data to a srtuctured form

func ParseXMLInputBuf

func ParseXMLInputBuf(data []byte) (*XMLInputData, error)

ParseXMLInputBuf is responsible for parsing a given stream of bytes representing appropriate input data to a srtuctured form

Jump to

Keyboard shortcuts

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