parent
0b1c4f92cd
commit
c8d734e290
30
xml.go
30
xml.go
|
@ -194,9 +194,6 @@ func setRandomMacs(domcfg *libvirtxml.Domain) {
|
||||||
// there might be something interesting in a VM
|
// there might be something interesting in a VM
|
||||||
// 'standard' here means what I think is standard
|
// 'standard' here means what I think is standard
|
||||||
func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
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
|
// dump all the clock stuff if it's standard
|
||||||
var normalclock bool = true
|
var normalclock bool = true
|
||||||
if domcfg.Clock.Offset != "utc" {
|
if domcfg.Clock.Offset != "utc" {
|
||||||
|
@ -277,6 +274,11 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
domcfg.Memory = nil
|
domcfg.Memory = nil
|
||||||
domcfg.CurrentMemory = nil
|
domcfg.CurrentMemory = nil
|
||||||
domcfg.VCPU = 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
|
// this will move elsewhere in the protobuf someday
|
||||||
if domcfg.OnPoweroff == "destroy" {
|
if domcfg.OnPoweroff == "destroy" {
|
||||||
|
@ -455,9 +457,16 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
// this is probably for spice to have keyboard and mouse input
|
// this is probably for spice to have keyboard and mouse input
|
||||||
var normalVideo bool = true
|
var normalVideo bool = true
|
||||||
if domcfg.Devices.Videos != nil {
|
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
|
normalVideo = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if normalVideo {
|
if normalVideo {
|
||||||
domcfg.Devices.Videos = nil
|
domcfg.Devices.Videos = nil
|
||||||
}
|
}
|
||||||
|
@ -477,12 +486,21 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
|
|
||||||
// dump out all the fields in libvirtxml.DomainDeviceList
|
// dump out all the fields in libvirtxml.DomainDeviceList
|
||||||
func dumpLibvirtxmlDomain() {
|
func dumpLibvirtxmlDomain() {
|
||||||
var domain libvirtxml.DomainDeviceList
|
var domain libvirtxml.Domain
|
||||||
t := reflect.TypeOf(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:")
|
fmt.Println("Fields in libvirtxml.DomainDeviceList:")
|
||||||
for i := 0; i < t.NumField(); i++ {
|
for i := 0; i < t.NumField(); i++ {
|
||||||
field := t.Field(i)
|
field := t.Field(i)
|
||||||
fmt.Println(field.Name)
|
fmt.Println("DomainDeviceList:", field.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue