diff options
Diffstat (limited to 'addDroplet.go')
| -rw-r--r-- | addDroplet.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/addDroplet.go b/addDroplet.go index fe25ab8..9254f05 100644 --- a/addDroplet.go +++ b/addDroplet.go @@ -115,6 +115,26 @@ func updateDroplet(d *DropletT, domcfg *libvirtxml.Domain) bool { me.changed = true } + // update spice port + if domcfg.Devices.Graphics != nil { + for _, g := range domcfg.Devices.Graphics { + if g.Spice == nil { + continue + } + 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 + d.pb.SpicePort = int64(s.Port) + fmt.Printf("Spice Port set to = %d\n", s.Port) + me.changed = true + } + } + } + // check type if domcfg.Type != "kvm" { fmt.Printf("not kvm. Virt type == %s\n", domcfg.Type) @@ -139,6 +159,10 @@ func updateMemory(d *DropletT, domcfg *libvirtxml.Domain) bool { return false } + if domcfg.Memory == nil { + return true + } + // check memory if domcfg.Memory.Unit == "KiB" { var m int64 @@ -185,6 +209,11 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) bool { var macs []string // Iterate over the network interfaces and print the MAC addresses for _, iface := range domcfg.Devices.Interfaces { + // fmt.Printf("iface: %+v\n", iface) + // fmt.Printf("MAC: %+v\n", iface.MAC) + // fmt.Printf("Source: %+v\n", iface.Source) + // fmt.Printf("Bridge: %+v\n", iface.Source.Bridge) + // fmt.Printf("Model: %+v\n", iface.Model) if iface.MAC != nil { // iface.MAC.Address = "aa:bb:aa:bb:aa:ff" // fmt.Printf("MAC Address: %+v\n", iface.MAC) |
