Nir Soffer has uploaded a new change for review. Change subject: virt: Fix limit when calculating next volume size ......................................................................
virt: Fix limit when calculating next volume size Drive.getNextVolumeSize limit was wrong, since Drive.truesize is using bytes and the result in in megabytes. We use safer naming convention now to avoid future confusion. Change-Id: I4098dfc07184085e613f17b2c48d32e47888106c Signed-off-by: Nir Soffer <nsof...@redhat.com> --- M tests/vmStorageTests.py M vdsm/virt/vmdevices/storage.py 2 files changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/37726/1 diff --git a/tests/vmStorageTests.py b/tests/vmStorageTests.py index 925d52d..d661401 100644 --- a/tests/vmStorageTests.py +++ b/tests/vmStorageTests.py @@ -19,7 +19,6 @@ # from monkeypatch import MonkeyPatch -from testValidation import brokentest from testlib import VdsmTestCase from testlib import XMLTestCase from testlib import permutations, expandPermutations @@ -252,7 +251,6 @@ size_mb = apparentsize_mb + drive.volExtensionChunk self.assertEqual(drive.getNextVolumeSize(drive.apparentsize), size_mb) - @brokentest() def test_truesize_limit(self): drive = self.chunked_drive(8191, 8192) self.assertEqual(drive.getNextVolumeSize(drive.apparentsize), 8192) diff --git a/vdsm/virt/vmdevices/storage.py b/vdsm/virt/vmdevices/storage.py index 7ef7f19..800128d 100644 --- a/vdsm/virt/vmdevices/storage.py +++ b/vdsm/virt/vmdevices/storage.py @@ -139,9 +139,9 @@ to be extended. For the leaf volume curSize == self.apparentsize. For internal volumes it is discovered by calling irs.getVolumeSize(). """ - nextSize = (self.volExtensionChunk + - ((curSize + constants.MEGAB - 1) / constants.MEGAB)) - return min(nextSize, self.truesize) + curSizeMB = (curSize + constants.MEGAB - 1) / constants.MEGAB + nextSizeMB = curSizeMB + self.volExtensionChunk + return min(nextSizeMB, self.truesize / constants.MEGAB) @property def chunked(self): -- To view, visit http://gerrit.ovirt.org/37726 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4098dfc07184085e613f17b2c48d32e47888106c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <nsof...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches