Implements stateless VMs

This commit is contained in:
Mikhail Klementev 2020-01-03 22:56:27 +00:00
parent e037770c38
commit 355fb314a1
No known key found for this signature in database
GPG key ID: BE44DA8C062D87DC
2 changed files with 70 additions and 16 deletions

6
xml.go
View file

@ -5,7 +5,9 @@ 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 {
func generateXML(vmName string, online bool,
vmNixPath, reginfo, img, sharedDir string) string {
qemuParams := `
<qemu:commandline>
<qemu:arg value='-device'/>
@ -24,7 +26,7 @@ func generateXML(name string, online bool, vmNixPath, reginfo, img, sharedDir st
`
}
return fmt.Sprintf(xmlTmpl, "appvm_"+name, vmNixPath, vmNixPath, vmNixPath,
return fmt.Sprintf(xmlTmpl, vmName, vmNixPath, vmNixPath, vmNixPath,
reginfo, img, sharedDir, sharedDir, sharedDir, qemuParams)
}