summaryrefslogtreecommitdiff
path: root/start.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-26 04:36:38 -0500
committerJeff Carr <[email protected]>2024-10-26 04:36:38 -0500
commit11f0cd97b596c2b08936edc2a99c5dac38df7637 (patch)
treeac1dee8250d816485eba392899ebe9e3994fd228 /start.go
parentfd3e14bcc6676b6f2e770a764351f82bee32738f (diff)
using lib/virtigoxml and it seems to actually work
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'start.go')
-rw-r--r--start.go62
1 files changed, 2 insertions, 60 deletions
diff --git a/start.go b/start.go
index a0ce9bd..2645d61 100644
--- a/start.go
+++ b/start.go
@@ -4,7 +4,6 @@ package main
import (
"os"
- "path/filepath"
"go.wit.com/lib/virtigoxml"
"go.wit.com/log"
@@ -24,6 +23,7 @@ func newStart(start string) {
newAddXml(domcfg, "standard.x86")
// addDefaultXml(domcfg, "memory")
// addDefaultXml(domcfg, "network")
+ newAddXml(domcfg, "spice")
newAddXml(domcfg, "qcow")
virtigoxml.StartDropletXml(d, domcfg, start)
@@ -41,65 +41,6 @@ func newAddXml(domcfg *libvirtxml.Domain, filename string) error {
}
/*
-// generate the XML for 'virsh create'
-func startDropletXml(start string) {
-
-
- domcfg.Type = "kvm"
- domcfg.Name = d.Hostname
- domcfg.UUID = d.Uuid
-
- var i uint
- i = uint(d.Memory / (1024 * 1024))
-
- // var tmp string
- // tmp = domcfg.VCPU
- domcfg.VCPU = new(libvirtxml.DomainVCPU)
- domcfg.VCPU.Value = uint(d.Cpus)
-
- domcfg.Memory = new(libvirtxml.DomainMemory)
- domcfg.Memory.Value = i
- domcfg.Memory.Unit = "MiB"
-
- fmt.Printf("Virt Memory %d %s\n", domcfg.Memory.Value, domcfg.Memory.Unit)
-
- // addEthernet(domcfg, "04:44:33:11:22:11", "worldbr")
- // addEthernet(domcfg, "04:44:33:33:44:55", "greenbr")
-
- var count int = 0
- for _, n := range d.Networks {
- log.Info("add network", d.Hostname, "mac addr", n.Mac, "interface", n.Name)
- if n.Name != "worldbr" {
- log.Info("OVERRIDE BRIDGE WITH 'worldbr'")
- }
- addEthernetBridge(domcfg, n.Mac, "worldbr")
- // addEthernetTap(domcfg, n.Mac)
- count += 1
- }
- if count == 1 {
- // this is normal
- } else {
- log.Info("WRONG NUMBER OF ETHERNET INTERFACES:", count)
- }
-
- // add a check here to make these unique
- // setRandomMacs(domcfg)
-
- for _, disk := range d.Disks {
- fullname := findDisk(disk.Filename)
- if fullname == "" {
- log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename)
- os.Exit(-1)
- } else {
- // qcow := "/home/nfs/" + d.Hostname + ".qcow2"
- setSimpleDisk(domcfg, fullname)
- }
- }
-
- writeoutXml(domcfg, d.Hostname)
- os.Exit(-1)
-}
-*/
func findDisk(filename string) string {
for _, dirname := range me.cluster.Dirs {
@@ -119,3 +60,4 @@ func findDisk(filename string) string {
}
return ""
}
+*/