add codes
This commit is contained in:
@@ -90,13 +90,13 @@ func handleCreateVM(cfg config.Config, svc Services) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
// Resolve disk paths for dir pools
|
||||
for i := range spec.Disks {
|
||||
if spec.Disks[i].Path == "" && spec.Disks[i].Pool != "" {
|
||||
if path, err := storage.ResolveVolume(toPoolConfigs(cfg.StoragePools), spec.Disks[i].Pool, spec.Disks[i].Name+".qcow2"); err == nil {
|
||||
spec.Disks[i].Path = path
|
||||
}
|
||||
for i := range spec.Disks {
|
||||
if spec.Disks[i].Path == "" && spec.Disks[i].Pool != "" {
|
||||
if path, err := storage.ResolveVolume(toPoolConfigs(cfg.StoragePools), spec.Disks[i].Pool, spec.Disks[i].Name+".qcow2"); err == nil {
|
||||
spec.Disks[i].Path = path
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := svc.Store.SaveVM(spec); err != nil {
|
||||
writeJSON(w, http.StatusInternalServerError, map[string]string{"error": err.Error()})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user