devmapper: Use a common delete function for all device deletion operation

Right now setupBaseImage() uses deleteDevice() to delete uninitialized
base image while rest of the code uses DeleteDevice(). Change it and
use a common function everywhere for the sake of uniformity.

I can't see what harm can be done by doing little extra locking done
by DeleteDevice().

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
Vivek Goyal 2014-12-03 13:06:43 -05:00 committed by root
parent f078bcd8e5
commit 359a38b26a

View file

@ -516,7 +516,7 @@ func (devices *DeviceSet) setupBaseImage() error {
if oldInfo != nil && !oldInfo.Initialized {
log.Debugf("Removing uninitialized base image")
if err := devices.deleteDevice(oldInfo); err != nil {
if err := devices.DeleteDevice(""); err != nil {
return err
}
}