mostly all gone

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-23 14:32:59 -05:00
parent 0b1c4f92cd
commit c8d734e290
1 changed files with 25 additions and 7 deletions

30
xml.go
View File

@ -194,9 +194,6 @@ func setRandomMacs(domcfg *libvirtxml.Domain) {
// there might be something interesting in a VM
// 'standard' here means what I think is standard
func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
// Add more parts you are interested in
fmt.Printf("CPU Model: %+v\n", domcfg.CPU)
// dump all the clock stuff if it's standard
var normalclock bool = true
if domcfg.Clock.Offset != "utc" {
@ -277,6 +274,11 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
domcfg.Memory = nil
domcfg.CurrentMemory = nil
domcfg.VCPU = nil
if domcfg.CPU.Mode == "host-model" {
domcfg.CPU = nil
} else {
fmt.Printf("? CPU Mode: %+v\n", domcfg.CPU.Mode)
}
// this will move elsewhere in the protobuf someday
if domcfg.OnPoweroff == "destroy" {
@ -455,9 +457,16 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
// this is probably for spice to have keyboard and mouse input
var normalVideo bool = true
if domcfg.Devices.Videos != nil {
fmt.Printf("? Video: %+v\n", domcfg.Devices.Videos)
for _, v := range domcfg.Devices.Videos {
if (v.Model.Type == "qxl") && (v.Model.VRam == 65536) {
// standard qxl video
} else {
fmt.Printf("? Video: %+v\n", v)
fmt.Printf("? Video Model: %+v\n", v.Model)
normalVideo = false
}
}
}
if normalVideo {
domcfg.Devices.Videos = nil
}
@ -477,12 +486,21 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
// dump out all the fields in libvirtxml.DomainDeviceList
func dumpLibvirtxmlDomain() {
var domain libvirtxml.DomainDeviceList
var domain libvirtxml.Domain
t := reflect.TypeOf(domain)
fmt.Println("Fields in libvirtxml.Domain:")
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
fmt.Println("Domain:", field.Name)
}
var device libvirtxml.DomainDeviceList
t = reflect.TypeOf(device)
fmt.Println("Fields in libvirtxml.DomainDeviceList:")
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
fmt.Println(field.Name)
fmt.Println("DomainDeviceList:", field.Name)
}
}