summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addDroplet.go2
-rw-r--r--http.go5
-rw-r--r--resources/libvirtxml.fields114
-rw-r--r--xml.go18
4 files changed, 136 insertions, 3 deletions
diff --git a/addDroplet.go b/addDroplet.go
index 9254f05..8e877ae 100644
--- a/addDroplet.go
+++ b/addDroplet.go
@@ -192,7 +192,7 @@ func updateMemory(d *DropletT, domcfg *libvirtxml.Domain) bool {
if d.pb.Memory != m {
d.pb.Memory = m
me.changed = true
- fmt.Printf("Memory changed %d, %d %s\n", pb.HumanFormatBytes(d.pb.Memory), domcfg.Memory.Value, domcfg.Memory.Unit)
+ fmt.Printf("Memory changed %s, %d %s\n", pb.HumanFormatBytes(d.pb.Memory), domcfg.Memory.Value, domcfg.Memory.Unit)
}
return true
}
diff --git a/http.go b/http.go
index 1d201f8..ba1559a 100644
--- a/http.go
+++ b/http.go
@@ -63,6 +63,11 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
+ if tmp == "/dumplibvirtxml" {
+ dumpLibvirtxmlDomainNames()
+ return
+ }
+
if tmp == "/uptime" {
b, s := clusterHealthy()
if b {
diff --git a/resources/libvirtxml.fields b/resources/libvirtxml.fields
new file mode 100644
index 0000000..c77b0b0
--- /dev/null
+++ b/resources/libvirtxml.fields
@@ -0,0 +1,114 @@
+Fields in libvirtxml.Domain:
+Domain: XMLName
+Domain: Type
+Domain: ID
+Domain: Name
+Domain: UUID
+Domain: GenID
+Domain: Title
+Domain: Description
+Domain: Metadata
+Domain: MaximumMemory
+Domain: Memory
+Domain: CurrentMemory
+Domain: BlockIOTune
+Domain: MemoryTune
+Domain: MemoryBacking
+Domain: VCPU
+Domain: VCPUs
+Domain: IOThreads
+Domain: IOThreadIDs
+Domain: DefaultIOThread
+Domain: CPUTune
+Domain: NUMATune
+Domain: Resource
+Domain: SysInfo
+Domain: Bootloader
+Domain: BootloaderArgs
+Domain: OS
+Domain: IDMap
+Domain: Features
+Domain: CPU
+Domain: Clock
+Domain: OnPoweroff
+Domain: OnReboot
+Domain: OnCrash
+Domain: PM
+Domain: Perf
+Domain: Devices
+Domain: SecLabel
+Domain: KeyWrap
+Domain: LaunchSecurity
+Domain: QEMUCommandline
+Domain: QEMUCapabilities
+Domain: QEMUOverride
+Domain: QEMUDeprecation
+Domain: LXCNamespace
+Domain: BHyveCommandline
+Domain: VMWareDataCenterPath
+Domain: XenCommandline
+Fields in libvirtxml.DomainDeviceList:
+DomainDeviceList: Emulator
+DomainDeviceList: Disks
+DomainDeviceList: Controllers
+DomainDeviceList: Leases
+DomainDeviceList: Filesystems
+DomainDeviceList: Interfaces
+DomainDeviceList: Smartcards
+DomainDeviceList: Serials
+DomainDeviceList: Parallels
+DomainDeviceList: Consoles
+DomainDeviceList: Channels
+DomainDeviceList: Inputs
+DomainDeviceList: TPMs
+DomainDeviceList: Graphics
+DomainDeviceList: Sounds
+DomainDeviceList: Audios
+DomainDeviceList: Videos
+DomainDeviceList: Hostdevs
+DomainDeviceList: RedirDevs
+DomainDeviceList: RedirFilters
+DomainDeviceList: Hubs
+DomainDeviceList: Watchdogs
+DomainDeviceList: MemBalloon
+DomainDeviceList: RNGs
+DomainDeviceList: NVRAM
+DomainDeviceList: Panics
+DomainDeviceList: Shmems
+DomainDeviceList: Memorydevs
+DomainDeviceList: IOMMU
+DomainDeviceList: VSock
+DomainDeviceList: Crypto
+DomainDeviceList: PStore
+Fields in libvirtxml.DomainInterface:
+DomainInterface: XMLName
+DomainInterface: Managed
+DomainInterface: TrustGuestRXFilters
+DomainInterface: MAC
+DomainInterface: Source
+DomainInterface: Boot
+DomainInterface: VLan
+DomainInterface: VirtualPort
+DomainInterface: IP
+DomainInterface: Route
+DomainInterface: PortForward
+DomainInterface: Script
+DomainInterface: DownScript
+DomainInterface: BackendDomain
+DomainInterface: Target
+DomainInterface: Guest
+DomainInterface: Model
+DomainInterface: Driver
+DomainInterface: Backend
+DomainInterface: FilterRef
+DomainInterface: Tune
+DomainInterface: Teaming
+DomainInterface: Link
+DomainInterface: MTU
+DomainInterface: Bandwidth
+DomainInterface: PortOptions
+DomainInterface: Coalesce
+DomainInterface: ROM
+DomainInterface: ACPI
+DomainInterface: Alias
+DomainInterface: Address
diff --git a/xml.go b/xml.go
index d50a368..c36c527 100644
--- a/xml.go
+++ b/xml.go
@@ -444,6 +444,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
normalSpice = false
continue
}
+ // this is all moved to updateDroplet()
// this is a spice definition, just ignore it
// because port mappings and network access will be handled
// somewhere else someday
@@ -455,7 +456,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
// should ignore either way
} else {
// print out, but ignore the port number
- fmt.Printf("Spice Port = %d\n", s.Port)
+ // fmt.Printf("Spice Port = %d\n", s.Port)
}
}
}
@@ -514,13 +515,26 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
var normalVideo bool = true
if domcfg.Devices.Videos != nil {
for _, v := range domcfg.Devices.Videos {
- if (v.Model.Type == "qxl") && (v.Model.VRam == 65536) {
+ switch v.Model.Type {
+ case "qxl":
+ if v.Model.VRam == 65536 {
// standard qxl video
} else {
fmt.Printf("? Video: %+v\n", v)
fmt.Printf("? Video Model: %+v\n", v.Model)
normalVideo = false
}
+ case "virtio":
+ // this should always be standard
+ //fmt.Printf("? Video: %+v\n", v)
+ //fmt.Printf("? Video Model: %+v\n", v.Model)
+ //fmt.Printf("? Video Address: %+v\n", v.Address)
+ //fmt.Printf("? Video PCI: %+v\n", v.Address.PCI)
+ default:
+ fmt.Printf("? Video: %+v\n", v)
+ fmt.Printf("? Video Model: %+v\n", v.Model)
+ normalVideo = false
+ }
}
}
if normalVideo {