f-25: code: add cfg to start vm
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
4bef0f9d5f
commit
915581904c
2 changed files with 3 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ func (c StartVMCommand) Execute(db *badger.DB, cfg *configuration.Config) error
|
||||||
case <-time.After(time.Duration(cfg.Dispatcher.PollSeconds) * time.Second):
|
case <-time.After(time.Duration(cfg.Dispatcher.PollSeconds) * time.Second):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return vm.StartVM(db, c.Name)
|
return vm.StartVM(db, c.Name, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
type StopVMCommand struct {
|
type StopVMCommand struct {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package vm
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
configuration "git.g3e.fr/syonad/two/internal/config/agent"
|
||||||
"git.g3e.fr/syonad/two/internal/iptables"
|
"git.g3e.fr/syonad/two/internal/iptables"
|
||||||
"git.g3e.fr/syonad/two/internal/metadata"
|
"git.g3e.fr/syonad/two/internal/metadata"
|
||||||
"git.g3e.fr/syonad/two/internal/netif"
|
"git.g3e.fr/syonad/two/internal/netif"
|
||||||
|
|
@ -13,7 +14,7 @@ import (
|
||||||
"github.com/dgraph-io/badger/v4"
|
"github.com/dgraph-io/badger/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
func StartVM(db *badger.DB, name string) error {
|
func StartVM(db *badger.DB, name string, cfg *configuration.Config) error {
|
||||||
state, err := kv.GetFromDB(db, "vm/"+name+"/state")
|
state, err := kv.GetFromDB(db, "vm/"+name+"/state")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue