Change in vdsm[master]: volume: unify cow format check on creation

Federico Simoncelli fsimonce at redhat.com
Mon May 26 17:19:53 UTC 2014


Federico Simoncelli has uploaded a new change for review.

Change subject: volume: unify cow format check on creation
......................................................................

volume: unify cow format check on creation

Change-Id: I78401df47278cdae34d824379acd0f2d088fa7b1
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/fileVolume.py
M vdsm/storage/volume.py
3 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/28126/1

diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index fba64a4..299766a 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -127,10 +127,6 @@
         if preallocate == volume.SPARSE_VOL and volFormat == volume.RAW_FORMAT:
             raise se.IncorrectFormat(srcVolUUID)
 
-        # Snapshot should be COW volume
-        if srcVolUUID != volume.BLANK_UUID and volFormat != volume.COW_FORMAT:
-            raise se.IncorrectFormat(srcVolUUID)
-
     @classmethod
     def createVolumeMetadataRollback(cls, taskObj, sdUUID, offs):
         cls.log.info("Metadata rollback for sdUUID=%s offs=%s", sdUUID, offs)
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 3e84f17..62be9df 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -100,10 +100,6 @@
         volume.Volume.validateCreateVolumeParams(volFormat, preallocate,
                                                  srcVolUUID)
 
-        # Snapshot should be COW volume
-        if srcVolUUID != volume.BLANK_UUID and volFormat != volume.COW_FORMAT:
-            raise se.IncorrectFormat(srcVolUUID)
-
     @classmethod
     def createVolumeMetadataRollback(cls, taskObj, volPath):
         cls.log.info("createVolumeMetadataRollback: volPath=%s" % (volPath))
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index b31c653..d46b13c 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -369,6 +369,10 @@
         if preallocate not in VOL_TYPE:
             raise se.IncorrectType(type2name(preallocate))
 
+        # Volumes with a parent must be cow
+        if srcVolUUID != volume.BLANK_UUID and volFormat != volume.COW_FORMAT:
+            raise se.IncorrectFormat(srcVolUUID)
+
     @classmethod
     def create(cls, repoPath, sdUUID, imgUUID, size, volFormat, preallocate,
                diskType, volUUID, desc, srcImgUUID, srcVolUUID):


-- 
To view, visit http://gerrit.ovirt.org/28126
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78401df47278cdae34d824379acd0f2d088fa7b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list