storage/lvm: make the "hack" work with CallbackPool instances

CallbackPool instances are no ThinPool instances, but behave
identically, if their backend driver is a ThinPool instance.
This commit is contained in:
3hhh 2020-07-15 18:16:54 +02:00
parent 409ea88a66
commit 42d62bb47e
No known key found for this signature in database
GPG Key ID: EB03A691DB2F0833
2 changed files with 2 additions and 3 deletions

View File

@ -509,7 +509,7 @@ class ThinVolume(qubes.storage.Volume):
# HACK: neat trick to speed up testing if you have same physical thin # HACK: neat trick to speed up testing if you have same physical thin
# pool assigned to two qubes-pools i.e: qubes_dom0 and test-lvm # pool assigned to two qubes-pools i.e: qubes_dom0 and test-lvm
# pylint: disable=line-too-long # pylint: disable=line-too-long
if isinstance(src_volume.pool, ThinPool) and \ if hasattr(src_volume.pool, 'thin_pool') and \
src_volume.pool.thin_pool == self.pool.thin_pool: # NOQA src_volume.pool.thin_pool == self.pool.thin_pool: # NOQA
yield from self._commit(src_volume.path[len('/dev/'):], keep=True) yield from self._commit(src_volume.path[len('/dev/'):], keep=True)
else: else:

View File

@ -792,8 +792,7 @@ class TC_00_ThinPool(ThinPoolBase):
# also should be different than source volume (clone, not the same LV) # also should be different than source volume (clone, not the same LV)
self.assertNotEqual(uuid_after, source_uuid) self.assertNotEqual(uuid_after, source_uuid)
if VOLUME_CLASS == ThinVolume: self.assertEqual(self._get_lv_origin_uuid(volume.path), source_uuid)
self.assertEqual(self._get_lv_origin_uuid(volume.path), source_uuid)
expected_revisions = { expected_revisions = {
'1521065906-back': '2018-03-14T22:18:26', '1521065906-back': '2018-03-14T22:18:26',