f-32: disk: add disk in qemu start

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-05-24 15:56:45 +02:00
commit 89899005d9
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 72 additions and 20 deletions

View file

@ -87,8 +87,11 @@ func vmFromDB(name string, entries map[string]string) (VM, error) {
vm.Interfaces = []VMInterface{{Subnet: subnet, IP: ip, Primary: true}}
}
if path := entries[prefix+"volume_path"]; path != "" {
vm.Storage = []VMStorage{{Path: path}}
diskPrefix := prefix + "disk/"
for key, path := range entries {
if dev := strings.TrimPrefix(key, diskPrefix); dev != key {
vm.Storage = append(vm.Storage, VMStorage{Path: path, Dev: dev})
}
}
return vm, nil