mkvm/main.go

34 lines
632 B
Go

package main
import (
"sync"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"libvirt.org/go/libvirtxml"
"mkvm/config"
)
var (
wg sync.WaitGroup
nicSource = libvirtxml.DomainInterfaceSource{}
rootCmd = cobra.Command{
Use: "mkvm",
Short: "create virtual machine(s) via libvirt",
Args: cobra.MinimumNArgs(1),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
logrus.SetLevel(logrus.DebugLevel)
if err := config.Load(); err != nil {
logrus.WithError(err).Fatal("error loading config")
}
},
}
)
func main() {
if err := rootCmd.Execute(); err != nil {
panic(err)
}
}