diff --git a/appvm.go b/appvm.go
index ada561c..4559aa2 100644
--- a/appvm.go
+++ b/appvm.go
@@ -30,74 +30,6 @@ import (
kingpin "gopkg.in/alecthomas/kingpin.v2"
)
-var xmlTmpl = `
-
- %s
- 2
- 1
- 4
-
- hvm
- %s/kernel
- %s/initrd
- loglevel=4 init=%s/init %s
-
-
-
-
-
- destroy
- restart
- destroy
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-`
-
func evalNix(expr string) (s string) {
command := exec.Command("nix", "eval", "--raw", expr)
bytes, _ := command.Output()
@@ -135,12 +67,6 @@ func getAppVMExpressionPath(name string) string {
}
-func generateXML(name, vmNixPath, reginfo, img, sharedDir string) string {
- // TODO: Define XML in go
- return fmt.Sprintf(xmlTmpl, "appvm_"+name, vmNixPath, vmNixPath, vmNixPath,
- reginfo, img, sharedDir, sharedDir, sharedDir)
-}
-
func list(l *libvirt.Libvirt) {
domains, err := l.Domains()
if err != nil {
diff --git a/xml.go b/xml.go
new file mode 100644
index 0000000..d6d6fbf
--- /dev/null
+++ b/xml.go
@@ -0,0 +1,80 @@
+package main
+
+import "fmt"
+
+// You may think that you want to rewrite to proper golang structures.
+// Believe me, you shouldn't.
+
+func generateXML(name, vmNixPath, reginfo, img, sharedDir string) string {
+ // TODO: Define XML in go
+ return fmt.Sprintf(xmlTmpl, "appvm_"+name, vmNixPath, vmNixPath, vmNixPath,
+ reginfo, img, sharedDir, sharedDir, sharedDir)
+}
+
+var xmlTmpl = `
+
+ %s
+ 2
+ 1
+ 4
+
+ hvm
+ %s/kernel
+ %s/initrd
+ loglevel=4 init=%s/init %s
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`