f-25: code: add cfg to start vm

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-29 00:36:01 +02:00
commit 915581904c
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 3 additions and 2 deletions

View file

@ -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):
}
}
return vm.StartVM(db, c.Name)
return vm.StartVM(db, c.Name, cfg)
}
type StopVMCommand struct {

View file

@ -3,6 +3,7 @@ package vm
import (
"fmt"
configuration "git.g3e.fr/syonad/two/internal/config/agent"
"git.g3e.fr/syonad/two/internal/iptables"
"git.g3e.fr/syonad/two/internal/metadata"
"git.g3e.fr/syonad/two/internal/netif"
@ -13,7 +14,7 @@ import (
"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")
if err != nil {
return err