summaryrefslogtreecommitdiff
path: root/xml.go
diff options
context:
space:
mode:
Diffstat (limited to 'xml.go')
-rw-r--r--xml.go56
1 files changed, 36 insertions, 20 deletions
diff --git a/xml.go b/xml.go
index 182fcc3..03aad82 100644
--- a/xml.go
+++ b/xml.go
@@ -354,13 +354,14 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
}
// this will move elsewhere in the protobuf someday
- if domcfg.OnPoweroff == "destroy" {
+ // ignore all these for now
+ if domcfg.OnPoweroff != "" { // normally "destroy"
domcfg.OnPoweroff = ""
}
- if domcfg.OnCrash == "destroy" {
+ if domcfg.OnCrash != "" { // normally "restart", often "destroy"
domcfg.OnCrash = ""
}
- if domcfg.OnReboot == "restart" {
+ if domcfg.OnReboot != "" { // normally "restart"
domcfg.OnReboot = ""
}
// same with PM. move to protobuf
@@ -480,32 +481,47 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
var normalSpice bool = true
if domcfg.Devices.Graphics != nil {
for i, g := range domcfg.Devices.Graphics {
- if g.Spice == nil {
- // figure out what to do with non-spice stuff
- fmt.Printf("Graphics: %d %+v\n", i, g)
- normalSpice = false
+ if g.VNC != nil {
+ // ignore vnc settings
+ // fmt.Printf("Ignore Graphics VNC settings: %d %+v\n", i, g)
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
- // fmt.Printf("Graphics: %d %+v\n", i, g)
- var s *libvirtxml.DomainGraphicSpice
- s = g.Spice
- // fmt.Printf("Spice: %d %+v %s\n", i, s, s.AutoPort)
- if s.AutoPort == "yes" {
- // should ignore either way
- } else {
- // print out, but ignore the port number
- // fmt.Printf("Spice Port = %d\n", s.Port)
+ if g.Spice != nil {
+ // 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
+ // fmt.Printf("Graphics: %d %+v\n", i, g)
+ var s *libvirtxml.DomainGraphicSpice
+ s = g.Spice
+ // fmt.Printf("Spice: %d %+v %s\n", i, s, s.AutoPort)
+ if s.AutoPort == "yes" {
+ // should ignore either way
+ } else {
+ // print out, but ignore the port number
+ // fmt.Printf("Spice Port = %d\n", s.Port)
+ }
+ continue
}
+ // figure out what to do with non-spice stuff
+ fmt.Printf("Unknown Graphics: %d %+v\n", i, g)
+ normalSpice = false
}
}
if normalSpice {
domcfg.Devices.Graphics = nil
}
+ // blank out emulator. should be in dom0
+ switch domcfg.Devices.Emulator {
+ case "":
+ domcfg.Devices.Emulator = ""
+ case "/usr/bin/kvm":
+ domcfg.Devices.Emulator = ""
+ default:
+ fmt.Printf("Unknown Emulator: %s\n", domcfg.Devices.Emulator)
+ }
+
// ignore Channels == SpiceVMC
normalSpice = true
if domcfg.Devices.Channels != nil {