'Walk back up the clone chain and delete references.
Deletes references i.e. deleted parent volumes and snapshots.'

def _delete_clone_parent_refs(self, client, parent_name, parent_snap):

    parent_rbd = self.rbd.Image(client.ioctx, parent_name)
    parent_has_snaps = False
    try:
        (_pool, g_parent, g_parent_snap) = self._get_clone_info(parent_rbd, parent_name, parent_snap)
        LOG.debug('deleting    parent    snapshot    %s', parent_snap)
        parent_rbd.unprotect_snap(parent_snap)
        parent_rbd.remove_snap(parent_snap)
        parent_has_snaps = bool(list(parent_rbd.list_snaps()))
    finally:
        parent_rbd.close()
    if ((not parent_has_snaps) and parent_name.endswith('.deleted')):
        LOG.debug('deleting    parent    %s', parent_name)
        self.RBDProxy().remove(client.ioctx, parent_name)
        if g_parent:
            self._delete_clone_parent_refs(client, g_parent, g_parent_snap)
