keep processing my libvirt xml files

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-23 18:06:46 -05:00
parent a1593b0b88
commit 07da0fa0ee
4 changed files with 136 additions and 3 deletions

View File

@ -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
}

View File

@ -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 {

114
resources/libvirtxml.fields Normal file
View File

@ -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

18
xml.go
View File

@ -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 {