You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/06/12 12:26:10 UTC
[3/3] git commit: updated refs/heads/4.4 to 40d3503
CLOUDSTACK-6812: Do not allow edit of storage.overprovision.factor for non supported types
(cherry picked from commit f14f36170e94c0184ade28a50226b17d25ecf57c)
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/40d35037
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/40d35037
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/40d35037
Branch: refs/heads/4.4
Commit: 40d35037601f8299e438a8df5e165312b02b62e0
Parents: 9771e79
Author: Saksham Srivastava <sa...@citrix.com>
Authored: Mon Jun 9 18:02:48 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Thu Jun 12 12:25:55 2014 +0200
----------------------------------------------------------------------
.../com/cloud/configuration/ConfigurationManagerImpl.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/40d35037/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 1549e12..d2f5af3 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -38,8 +38,8 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import com.cloud.storage.StorageManager;
-import org.apache.log4j.Logger;
+import org.apache.log4j.Logger;
import org.apache.cloudstack.acl.SecurityChecker;
import org.apache.cloudstack.affinity.AffinityGroup;
import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -178,6 +178,7 @@ import com.cloud.service.ServiceOfferingVO;
import com.cloud.service.dao.ServiceOfferingDao;
import com.cloud.service.dao.ServiceOfferingDetailsDao;
import com.cloud.storage.DiskOfferingVO;
+import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.test.IPRangeConfig;
import com.cloud.user.Account;
@@ -471,6 +472,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
if (pool == null) {
throw new InvalidParameterValueException("unable to find storage pool by id " + resourceId);
}
+ if(name.equals(CapacityManager.StorageOverprovisioningFactor.key())) {
+ if(pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.VMFS) {
+ throw new InvalidParameterValueException("Unable to update storage pool with id " + resourceId + ". Overprovision not supported for " + pool.getPoolType());
+ }
+ }
_storagePoolDetailsDao.addDetail(resourceId, name, value, true);
break;