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