Nir Soffer has posted comments on this change.
Change subject: block: use the contextmanager for getVolumeMetadataSlot
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/25988/3/tests/volumeTests.py
File tests/volumeTests.py:
Line 97: self.assertEqual(mdSlot, self.EXPECTED_METADATA_SLOT)
Line 98:
Line 99: def testMetaSlotLock(self):
Line 100: with self.blksd.getVolumeMetadataSlot(None, 1):
Line 101: lktaken = self.blksd._lvTagMetaSlotLock.acquire(False)
This will break if we rename the private lock or move it to other class. We want to test
that only one thread can enter this context, not that is locks some specific lock.
http://gerrit.ovirt.org/#/c/25988/3/vdsm/storage/imageRepository/formatCo...
File vdsm/storage/imageRepository/formatConverter.py:
Line 181: metaContent = vol.getMetadata()
Line 182:
Line 183: with domain.getVolumeMetadataSlot(
Line 184: vol.volUUID, blockVolume.VOLUME_MDNUMBLKS) \
Line 185: as newMetaSlot:
I think this would be little more clear as:
newMetaSlot = domain.getVolumeMetadataSlot(
vol.volUUID, blockVolume.VOLUME_MDNUMBLKS)
with newMetaSlot:
...
Line 186: if newMetaSlot > metaMaxSlot:
Line 187: raise se.NoSpaceLeftOnDomain(domain.sdUUID)
Line 188:
Line 189: log.debug("Copying metadata for volume %s to the new slot
%s",
--
To view, visit
http://gerrit.ovirt.org/25988
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id1496238ea4f9a1902f816b20959ce3379e87871
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes