Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F33EC104D4 for ; Tue, 26 Nov 2013 13:42:55 +0000 (UTC) Received: (qmail 58906 invoked by uid 500); 26 Nov 2013 13:42:55 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 58730 invoked by uid 500); 26 Nov 2013 13:42:55 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 57835 invoked by uid 99); 26 Nov 2013 13:42:53 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 13:42:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 145889182BA; Tue, 26 Nov 2013 13:42:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: weizhou@apache.org To: commits@cloudstack.apache.org Date: Tue, 26 Nov 2013 13:42:53 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/4.3 to 895e581 Updated Branches: refs/heads/4.3 8970c9515 -> 895e581e7 CLOUDSTACK-5272: return unlimit if max.account.* or max.project.* is set to negative (cherry picked from commit 888ddd724aabbd22d675fe2bba873971888e1a8a) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3deb7dd6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3deb7dd6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3deb7dd6 Branch: refs/heads/4.3 Commit: 3deb7dd6f5dd6c8df42a8ada425300018b656e97 Parents: 8970c95 Author: Wei Zhou Authored: Tue Nov 26 14:05:18 2013 +0100 Committer: Wei Zhou Committed: Tue Nov 26 14:26:01 2013 +0100 ---------------------------------------------------------------------- .../src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3deb7dd6/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java index 7417754..269f04f 100755 --- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java +++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java @@ -284,6 +284,9 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim value = accountResourceLimitMap.get(type); } if (value != null) { + if (value < 0) { // return unlimit if value is set to negative + return max; + } // convert the value from GiB to bytes in case of primary or secondary storage. if (type == ResourceType.primary_storage || type == ResourceType.secondary_storage) { value = value * ResourceType.bytesToGiB; @@ -318,6 +321,9 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim value = accountResourceLimitMap.get(type); } if (value != null) { + if (value < 0) { // return unlimit if value is set to negative + return max; + } if (type == ResourceType.primary_storage || type == ResourceType.secondary_storage) { value = value * ResourceType.bytesToGiB; }