devmapper: Implement deferred deletion functionality

Finally here is the patch to implement deferred deletion functionality.
Deferred deleted devices are marked as "Deleted" in device meta file. 

First we try to delete the device and only if deletion fails and user has
enabled deferred deletion, device is marked for deferred deletion.

When docker starts up again, we go through list of deleted devices and
try to delete these again.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
Vivek Goyal 2015-10-06 17:37:21 -04:00
parent 4ebc358c68
commit 30047b6365

View file

@ -750,7 +750,11 @@ func DeleteDevice(poolName string, deviceID int) error {
return fmt.Errorf("Can't set message %s", err)
}
dmSawBusy = false
if err := task.run(); err != nil {
if dmSawBusy {
return ErrBusy
}
return fmt.Errorf("Error running DeleteDevice %s", err)
}
return nil