Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-01 06:21:14 -05:00
parent 71fc48cbc2
commit 62bb5dbb9f
1 changed files with 5 additions and 5 deletions

View File

@ -19,22 +19,22 @@ func newStart(start string, d *pb.Droplet) error {
log.Info("start droplet here:", d.Hostname)
domcfg := &libvirtxml.Domain{}
mergeXML(domcfg, "standard.x86")
mergeXMLresource(domcfg, "standard.x86")
// ignore spice if it's not set
if d.SpicePort == 0 {
log.Info("spice port was not set. spice disabled")
} else {
mergeXML(domcfg, "spice")
mergeXMLresource(domcfg, "spice")
if err := virtigolib.SetSpicePort(d, domcfg); err != nil {
return err
}
}
mergeXML(domcfg, "qcow")
mergeXMLresource(domcfg, "qcow")
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"
pfile, err := resources.ReadFile(fullname)
if err != nil {
@ -42,5 +42,5 @@ func mergeXML(domcfg *libvirtxml.Domain, filename string) error {
return err
}
return virtigolib.AddDefaultXml(domcfg, string(pfile))
return virtigolib.MergeXml(domcfg, string(pfile))
}