package main
import "fmt"
// You may think that you want to rewrite to proper golang structures.
// Believe me, you shouldn't.
func generateXML(name string, online bool, vmNixPath, reginfo, img, sharedDir string) string {
qemuParams := `
`
if !online {
qemuParams = `
`
}
return fmt.Sprintf(xmlTmpl, "appvm_"+name, vmNixPath, vmNixPath, vmNixPath,
reginfo, img, sharedDir, sharedDir, sharedDir, qemuParams)
}
var xmlTmpl = `
%s
2
1
4
hvm
%s/kernel
%s/initrd
loglevel=4 init=%s/init %s
destroy
restart
destroy
%s
`