Nir Soffer has posted comments on this change.
Change subject: blockSD: Ensure active volumes are refreshed before use. ......................................................................
Patch Set 7: Code-Review+1
(2 comments)
Needs docstring fix and shorter warning may be also nice. +1 since I do not want to delay this.
.................................................... File vdsm/storage/blockSD.py Line 1059: Line 1060: def activateVolumes(self, imgUUID, volUUIDs): Line 1061: """ Line 1062: Activate all the volumes belonging to the image. Refresh any active Line 1063: volumes that belong to the image as long as they are not special. The docstring should have a one line title such as:
Activates or refresh all volumes belonging to the image.
Then you can explain why we should check which volumes are active and why it is important to refresh them, mentioning the bug number. Line 1064: Line 1065: imgUUID: the image to be activated. Line 1066: allVols: getAllVolumes result. Line 1067:
Line 1072: lvm.activateLVs(self.sdUUID, volUUIDs) Line 1073: Line 1074: if toRefresh: Line 1075: log.warning("The following volumes are already active and will be" Line 1076: " refreshed before use : %s", toRefresh) We are refreshing now, so "will be refreshed before use" is not the best warning. I would shorten this warning to:
"Refreshing active lvs: %s" Line 1077: lvm.refreshLVs(self.sdUUID, toRefresh) Line 1078: Line 1079: vgDir = os.path.join("/dev", self.sdUUID) Line 1080: return self.createImageLinks(vgDir, imgUUID, volUUIDs)