Nir Soffer has submitted this change and it was merged.

Change subject: StorageDomainManifest: Manifest objects produce VolumeMetadata 
objects
......................................................................


StorageDomainManifest: Manifest objects produce VolumeMetadata objects

StorageDomainManifest objects must be safe to use when working in SDM
and SPM modes.  Therefore, methods of these objects may not return
class instances which are only safe to use in SPM mode.

As we refactor vdsm storage to prepare for SDM we have two sets of
storage objects: the original (SPM) classes and the new (SDM) classes.

SPM classes:
 - BlockStorageDomain
 - FileStorageDomain
 - Image
 - BlockVolume
 - FileVolume

SDM classes:
 - BlockStorageDomainManifest
 - FileStorageDomainManifest
 - ImageManifest
 - BlockVolumeMetadata
 - FileVolumeMetadata

By changing getVolumeClass to return the proper type for each
StorageDomain and StorageDomainManifest class we can ensure that the
proper instance will be returned by produceVolume:

BlockStorageDomain         --produces--> BlockVolume
BlockStorageDomainManifest --produces--> BlockVolumeMetadata
FileStorageDomain          --produces--> FileVolume
FileStorageDomainManifest  --produces--> FileVolumeMetadata

So this change will not change the behavior of old code using the SPM
classes but it will correct the behavior for new SDM code which
instantiates StorageDomainManifest objects directly.

Updated the sdm_indirection_tests since getVolumeClass is no longer
redirected to the Manifest classes.

Change-Id: Iacb2723c8ce2108b3e5ac2f35be2f59f083095e0
Signed-off-by: Adam Litke <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/44040
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <[email protected]>
---
M tests/sdm_indirection_tests.py
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/sd.py
4 files changed, 20 insertions(+), 16 deletions(-)

Approvals:
  Adam Litke: Verified
  Nir Soffer: Looks good to me, approved
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/44040
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iacb2723c8ce2108b3e5ac2f35be2f59f083095e0
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Ala Hino <[email protected]>
Gerrit-Reviewer: Freddy Rolland <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: gerrit-hooks <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to