Browse Source

devmapper: implement OnRemove

Solomon Hykes 11 năm trước cách đây
mục cha
commit
d23b9e8734
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      devmapper/plugin.go

+ 7 - 0
devmapper/plugin.go

@@ -73,6 +73,13 @@ func (b *DMBackend) OnCreate(img Image, layer archive.Archive) error {
 	return nil
 }
 
+func (b *DMBackend) OnRemove(img Image) error {
+	id := img.ID()
+	if err := b.DeviceSet.RemoveDevice(id); err != nil {
+		return fmt.Errorf("Unable to remove device for %v: %v", id, err)
+	}
+	return nil
+}
 
 func (b *DMBackend) mountpoint(id string) string {
 	if b.home == "" {