cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [3/4] git commit: updated refs/heads/4.2 to de448ec
Date Thu, 07 Nov 2013 10:09:36 GMT
remove network limitation of nics on systemvms


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0227e001
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0227e001
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0227e001

Branch: refs/heads/4.2
Commit: 0227e0013ad90bb66a29e0852d9a114951b8f6fc
Parents: 09e7ab9
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Thu Nov 7 11:07:48 2013 +0100
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Thu Nov 7 11:07:48 2013 +0100

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkModelImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0227e001/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index 7665f15..9b8c34e 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -941,16 +941,21 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel
{
         // from the network offering
         boolean isUserVmsDefaultNetwork = false;
         boolean isDomRGuestOrPublicNetwork = false;
+        boolean isSystemVmNetwork = false;
         if (vm != null) {
             Nic nic = _nicDao.findByNtwkIdAndInstanceId(networkId, vmId);
             if (vm.getType() == Type.User && nic != null && nic.isDefaultNic())
{
                 isUserVmsDefaultNetwork = true;
             } else if (vm.getType() == Type.DomainRouter && ntwkOff != null &&
(ntwkOff.getTrafficType() == TrafficType.Public || ntwkOff.getTrafficType() == TrafficType.Guest))
{
                 isDomRGuestOrPublicNetwork = true;
+            } else if (vm.getType() == Type.ConsoleProxy || vm.getType() == Type.SecondaryStorageVm)
{
+                isSystemVmNetwork = true;
             }
         }
         if (isUserVmsDefaultNetwork || isDomRGuestOrPublicNetwork) {
             return _configMgr.getServiceOfferingNetworkRate(vm.getServiceOfferingId(), network.getDataCenterId());
+        } else if (isSystemVmNetwork) {
+            return -1;
         } else {
             return _configMgr.getNetworkOfferingNetworkRate(ntwkOff.getId(), network.getDataCenterId());
         }


Mime
View raw message