Delete volumes online without restarting volume server

This commit is contained in:
brstgt
2017-01-20 13:02:37 +01:00
parent 492f93416d
commit e074a54a20
5 changed files with 65 additions and 34 deletions

View File

@@ -338,3 +338,13 @@ func (s *Store) UnmountVolume(i VolumeId) error {
return fmt.Errorf("Volume %d not found on disk", i)
}
func (s *Store) DeleteVolume(i VolumeId) error {
for _, location := range s.Locations {
if error := location.deleteVolumeById(i); error == nil {
s.updateMaster()
return nil
}
}
return fmt.Errorf("Volume %d not found on disk", i)
}