Skip to content

Commit

Permalink
Merge pull request #718 from yanxuean/reclaim-storage-volume
Browse files Browse the repository at this point in the history
reclaim storageVolume when CreateStorageVol fail
  • Loading branch information
ivan4th authored Jul 30, 2018
2 parents 806ee62 + d8e94a4 commit 8f3707a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/libvirttools/libvirt_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (pool *libvirtStoragePool) CreateStorageVol(def *libvirtxml.StorageVolume)
// Here we work around this problem by refreshing the pool
// which invokes acquiring volume info.
if err := pool.p.Refresh(0); err != nil {
v.Delete(0)
return nil, fmt.Errorf("failed to refresh the storage pool: %v", err)
}
return &libvirtStorageVolume{Mutex: pool.Mutex, name: def.Name, v: v}, nil
Expand Down

0 comments on commit 8f3707a

Please sign in to comment.