Eduardo has posted comments on this change.

Change subject: getAllVolumes returns partially deleted volumes too.
......................................................................


Patch Set 3: (3 inline comments)

....................................................
File vdsm/storage/blockSD.py
Line 175:             try:
Line 176:                 imgIsUnknown = vImg not in res[parentVol]['imgs']
Line 177:             except KeyError:
Line 178:                 log.warning("Found broken img %s, orphan volume 
%s/%s, "
Line 179:                             "parent %s", vImg, sdUUID, volName, 
parentVol)
My free interpretation of Ayal's previous comment.
Please suggest.
Line 180:             else:
Line 181:                 if imgIsUnknown:
Line 182:                     res[parentVol]['imgs'].append(vImg)
Line 183: 


Line 1006:         self.__markForDelVols(sdUUID, imgUUID, toZero, 
sd.ZEROED_IMAGE_PREFIX)
Line 1007:         zeroImgVolumes(sdUUID, imgUUID, toZero)
Line 1008:         self.rmDCImgDir(imgUUID, volsImgs)
Line 1009: 
Line 1010:     def getAllVolumesImages(self):
You understand absolutely right. 

Can be private.

Since I dislike private methods, in python nothing is really private, I don't 
want to specify a user policy here and this can easily changed I prefer this 
way, but should be by consensus.

In addition  leaving this public is the function that Ayal wants and using the 
getAllVolumes/remnants interfaces is like the old interface and everybody will 
be happy. ;)
Line 1011:         """
Line 1012:         Return all the images that depend on a volume.
Line 1013: 
Line 1014:         Return dicts:


Line 1019:         vols = {}  # The "legal" volumes: not half deleted/removed 
volumes.
Line 1020:         remnants = {}  # Volumes which are part of failed image 
deletes.
Line 1021:         allVols = getAllVolumes(self.sdUUID)
Line 1022:         for volName, ip in allVols.iteritems():
Line 1023:             images, parent = ip
Done
Line 1024:             if (volName.startswith(sd.REMOVED_IMAGE_PREFIX) or
Line 1025:                     ip.imgs[0].startswith(sd.REMOVED_IMAGE_PREFIX)):
Line 1026:                         remnants[volName] = ip
Line 1027:             else:


--
To view, visit http://gerrit.ovirt.org/12546
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib8514236a5d4793f66709e9daf546fb46047414f
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewars...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Daniel Paikov <pai...@gmail.com>
Gerrit-Reviewer: Eduardo <ewars...@redhat.com>
Gerrit-Reviewer: Gadi Ickowicz <gicko...@redhat.com>
Gerrit-Reviewer: Haim Ateya <hat...@redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykap...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to