parent
71fc48cbc2
commit
62bb5dbb9f
10
start.go
10
start.go
|
@ -19,22 +19,22 @@ func newStart(start string, d *pb.Droplet) error {
|
||||||
log.Info("start droplet here:", d.Hostname)
|
log.Info("start droplet here:", d.Hostname)
|
||||||
domcfg := &libvirtxml.Domain{}
|
domcfg := &libvirtxml.Domain{}
|
||||||
|
|
||||||
mergeXML(domcfg, "standard.x86")
|
mergeXMLresource(domcfg, "standard.x86")
|
||||||
// ignore spice if it's not set
|
// ignore spice if it's not set
|
||||||
if d.SpicePort == 0 {
|
if d.SpicePort == 0 {
|
||||||
log.Info("spice port was not set. spice disabled")
|
log.Info("spice port was not set. spice disabled")
|
||||||
} else {
|
} else {
|
||||||
mergeXML(domcfg, "spice")
|
mergeXMLresource(domcfg, "spice")
|
||||||
if err := virtigolib.SetSpicePort(d, domcfg); err != nil {
|
if err := virtigolib.SetSpicePort(d, domcfg); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mergeXML(domcfg, "qcow")
|
mergeXMLresource(domcfg, "qcow")
|
||||||
|
|
||||||
return virtigolib.GenerateDropletXml(me.dirs, d, domcfg, start)
|
return virtigolib.GenerateDropletXml(me.dirs, d, domcfg, start)
|
||||||
}
|
}
|
||||||
|
|
||||||
func mergeXML(domcfg *libvirtxml.Domain, filename string) error {
|
func mergeXMLresource(domcfg *libvirtxml.Domain, filename string) error {
|
||||||
fullname := "resources/xml/" + filename + ".xml"
|
fullname := "resources/xml/" + filename + ".xml"
|
||||||
pfile, err := resources.ReadFile(fullname)
|
pfile, err := resources.ReadFile(fullname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -42,5 +42,5 @@ func mergeXML(domcfg *libvirtxml.Domain, filename string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return virtigolib.AddDefaultXml(domcfg, string(pfile))
|
return virtigolib.MergeXml(domcfg, string(pfile))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue