Change in vdsm[master]: Move hsm.validatePoolSD() -> pool.validatePoolSD().

shuming at linux.vnet.ibm.com shuming at linux.vnet.ibm.com
Wed Dec 5 15:31:34 UTC 2012


Shu Ming has posted comments on this change.

Change subject: Move hsm.validatePoolSD() -> pool.validatePoolSD().
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(2 inline comments)

....................................................
File vdsm/storage/hsm.py
Line 1243:         #getExclusiveLock(vmList...)
Line 1244:         pool = self.getPool(spUUID)
Line 1245:         if sdUUID and sdUUID != sd.BLANK_UUID:
Line 1246:             pool.validatePoolSD(sdUUID)
Line 1247:             self.validateSdUUID(sdUUID)
It is better to call self.validateSdUUID(sdUUID) first and then pool.validatePoolSD(sdUUID).  If validateSdUUID fails, not need to call pool.validatePoolSD(sdUUID).
Line 1248:         pool.removeVM(vmUUID=vmUUID, sdUUID=sdUUID)
Line 1249: 
Line 1250:     @public
Line 1251:     def getVmsList(self, spUUID, sdUUID=None, options=None):


....................................................
File vdsm/storage/sp.py
Line 456:     def getMasterVersion(self):
Line 457:         return self.getMetaParam(PMDK_MASTER_VER)
Line 458: 
Line 459:     # TODO: Remove or rename this function.
Line 460:     def validatePoolSD(self, sdUUID):
I think "validate" is abused as a prefix to vdsm function names. Some functions mean to flush the cache back and be consistent, like blockSD.validate().  Some functions mean to check if a condition is true, like this function.  Do we need distinct these two "validate"?
Line 461:         if sdUUID not in self.getDomains():
Line 462:             raise se.StorageDomainNotMemberOfPool(self.spUUID, sdUUID)
Line 463:         return True
Line 464: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3ba16c8a427c9478ae81c2693d79b8bd601f1ec3
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Royce Lv <lvroyce at linux.vnet.ibm.com>
Gerrit-Reviewer: Shu Ming <shuming at linux.vnet.ibm.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list