summaryrefslogtreecommitdiff
path: root/xml.go
diff options
context:
space:
mode:
Diffstat (limited to 'xml.go')
-rw-r--r--xml.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/xml.go b/xml.go
index 04c3076..1f0da87 100644
--- a/xml.go
+++ b/xml.go
@@ -71,6 +71,23 @@ func addDefaults(d *libvirtxml.Domain, filename string) {
}
}
+func (d *DropletT) readXml(filename string) error {
+ log.Info("parse xml file:", filename)
+
+ pfile, err := os.ReadFile(filename)
+ if err != nil {
+ log.Println("ERROR:", err)
+ return ErrorNoFile
+ }
+
+ err = d.xml.Unmarshal(string(pfile))
+ if err != nil {
+ log.Info("Marshal failed on file", filename)
+ return ErrorParseXML
+ }
+ return nil
+}
+
func setSimpleDisk(domcfg *libvirtxml.Domain, filename string) {
// Clear out the existing disks (if any)
domcfg.Devices.Disks = nil