Skip to content

Commit

Permalink
reclaim storageVolume when CreateStorageVol fail
Browse files Browse the repository at this point in the history
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
  • Loading branch information
yanxuean committed Jul 16, 2018
1 parent 7724a0a commit d8e94a4
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 d8e94a4

Please sign in to comment.