2024-10-11 22:39:19 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
/*
|
|
|
|
this parses the command line arguements
|
|
|
|
this enables command line options from other packages like 'gui' and 'log'
|
|
|
|
*/
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/dev/alexflint/arg"
|
|
|
|
)
|
|
|
|
|
|
|
|
var argv args
|
|
|
|
|
|
|
|
type args struct {
|
2024-11-01 10:23:32 -05:00
|
|
|
Port int `arg:"--port" default:"2520" help:"port to run on"`
|
2024-10-11 22:39:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (args) Version() string {
|
|
|
|
return "virtigod " + Version
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
arg.MustParse(&argv)
|
|
|
|
}
|
2024-11-01 02:53:12 -05:00
|
|
|
|
|
|
|
func (a args) Description() string {
|
|
|
|
return `
|
|
|
|
this daemon talks to virtigo talks to libvirt and/or qemu
|
|
|
|
|
|
|
|
This sends data back to virtigo. It helps read out the libvirtxml
|
|
|
|
and convert it to protobuf.
|
|
|
|
The name is odd, it's virtigo-D not virti-god.
|
|
|
|
|
|
|
|
You can query the status directly:
|
|
|
|
|
|
|
|
# the list of running vms:
|
|
|
|
curl --silent http://localhost:2520/vms
|
|
|
|
|
2024-11-01 04:10:14 -05:00
|
|
|
# information about libvirt domain for vm 'coriolis':
|
|
|
|
curl --silent http://localhost:2520/dumpdomain?domain=coriolis
|
2024-11-01 02:53:12 -05:00
|
|
|
`
|
|
|
|
}
|