compute/cmd/qemu/qemu.go

33 lines
510 B
Go

package main
import (
"log"
"os"
"deevirt.fr/compute/cmd/qemu/metrics"
"libvirt.org/go/libvirt"
)
func main() {
err := libvirt.EventRegisterDefaultImpl()
if err != nil {
log.Fatalf("Échec d'EventRegisterDefaultImpl: %v", err)
os.Exit(0)
}
conn, err := libvirt.NewConnect("qemu:///system")
if err != nil {
log.Println("Connexion Error")
}
defer conn.Close()
conn.SetKeepAlive(5, 3)
go metrics.Server(conn)
//go app.NewDomainsMonitor(conn)
for {
libvirt.EventRunDefaultImpl()
}
}