summaryrefslogtreecommitdiff
path: root/xml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-23 14:20:59 -0500
committerJeff Carr <[email protected]>2024-10-23 14:20:59 -0500
commit0b1c4f92cdc35c75d3622002a25bffcc9055ef94 (patch)
tree956cf4f374f8675f4845bbfe9b7bca21c3b0f35b /xml.go
parent6de8f66794384d847fcda0d3bf5ee1004ed5b646 (diff)
down to the last standard DomainDeviceList thing
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'xml.go')
-rw-r--r--xml.go52
1 files changed, 46 insertions, 6 deletions
diff --git a/xml.go b/xml.go
index e1a2aa5..85d2c66 100644
--- a/xml.go
+++ b/xml.go
@@ -427,14 +427,42 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
domcfg.Devices.Channels = nil
}
- var domain libvirtxml.DomainDeviceList
- t := reflect.TypeOf(domain)
+ // this is probably for spice to have keyboard and mouse input
+ normalSpice = true
+ if domcfg.Devices.RedirDevs != nil {
+ for _, c := range domcfg.Devices.RedirDevs {
+ s := c.Source
+ if s != nil {
+ if s.SpiceVMC != nil {
+ // this is the normal USB redirection (I guess)
+ } else {
+ normalSpice = false
+ }
+ } else {
+ normalSpice = false
+ }
+ // fmt.Printf("? RedirDevs: %+v\n", c)
+ // fmt.Printf("? RedirDevs Source: %+v\n", s)
+ // fmt.Printf("? RedirDevs SpiceVMC: %d\n", *s.SpiceVMC)
+ // fmt.Printf("? RedirDevs Address: %+v\n", c.Address)
+ // fmt.Printf("? RedirDevs USB: %+v\n", c.Address.USB)
+ }
+ }
+ if normalSpice {
+ domcfg.Devices.RedirDevs = nil
+ }
- fmt.Println("Fields in libvirtxml.DomainDeviceList:")
- for i := 0; i < t.NumField(); i++ {
- field := t.Field(i)
- fmt.Println(field.Name)
+ // 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)
+ normalVideo = false
}
+ if normalVideo {
+ domcfg.Devices.Videos = nil
+ }
+
+ // dumpLibvirtxmlDomain()
updatedXML, err := xml.MarshalIndent(domcfg, "", " ")
if err != nil {
@@ -446,3 +474,15 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
fmt.Println(string(updatedXML))
os.Exit(-1)
}
+
+// dump out all the fields in libvirtxml.DomainDeviceList
+func dumpLibvirtxmlDomain() {
+ var domain libvirtxml.DomainDeviceList
+ t := reflect.TypeOf(domain)
+
+ fmt.Println("Fields in libvirtxml.DomainDeviceList:")
+ for i := 0; i < t.NumField(); i++ {
+ field := t.Field(i)
+ fmt.Println(field.Name)
+ }
+}