summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-26 21:05:16 -0500
committerJeff Carr <[email protected]>2024-10-26 21:05:16 -0500
commita314af7f8bfdbbd4234f2d0800a5b95ebfd207fa (patch)
treedc9c294148086b47b2b4a43513a7138d21e90950
parent65b61769117db371c4ec8fc0094d67b8c1075c1b (diff)
cleanup
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--http.go2
-rw-r--r--hypervisior.go5
-rw-r--r--main.go5
3 files changed, 7 insertions, 5 deletions
diff --git a/http.go b/http.go
index 741f949..1b9d0c9 100644
--- a/http.go
+++ b/http.go
@@ -53,7 +53,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
if tmp == "/vms" {
- s := poolHypervisor(hv)
+ s := pollHypervisor(hv)
fmt.Fprint(w, s)
return
}
diff --git a/hypervisior.go b/hypervisior.go
index cc96a94..2085e98 100644
--- a/hypervisior.go
+++ b/hypervisior.go
@@ -22,7 +22,8 @@ import (
"github.com/digitalocean/go-qemu/qemu"
)
-func poolHypervisor(hv *hypervisor.Hypervisor) string {
+// get the list of domains from libvirt
+func pollHypervisor(hv *hypervisor.Hypervisor) string {
var out string
// fmt.Printf("\n**********Domains**********\n")
domains, err := hv.Domains()
@@ -76,6 +77,7 @@ func poolHypervisor(hv *hypervisor.Hypervisor) string {
return out
}
+/*
func displayBlockDevices(domain *qemu.Domain) {
// var []blks string
blockDevices, err := domain.BlockDevices()
@@ -105,3 +107,4 @@ func displayPCIDevices(domain *qemu.Domain) {
fmt.Printf("[%10s] [%20s]\n", pciDevice.QdevID, pciDevice.ClassInfo.Desc)
}
}
+*/
diff --git a/main.go b/main.go
index ae7069c..9bba77b 100644
--- a/main.go
+++ b/main.go
@@ -27,12 +27,11 @@ import (
)
var Version string
+var hv *hypervisor.Hypervisor
//go:embed resources/*
var resources embed.FS
-var hv *hypervisor.Hypervisor
-
func main() {
if os.Getenv("VIRTIGO_HOME") == "" {
homeDir, _ := os.UserHomeDir()
@@ -59,7 +58,7 @@ func main() {
driver := hypervisor.NewRPCDriver(newConn)
hv = hypervisor.New(driver)
- poolHypervisor(hv)
+ pollHypervisor(hv)
startHTTP()
}