f-32: disk: add disk in qemu start
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
85c8c4e590
commit
89899005d9
4 changed files with 72 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue