Change in vdsm[master]: StorageDomainManifest: Manifest objects produce VolumeMetada...

nsoffer at redhat.com nsoffer at redhat.com
Fri Dec 4 20:23:14 UTC 2015


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 <alitke at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/44040
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
---
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 <alitke at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list