cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [33/50] [abbrv] git commit: Elimiate mystery guestIp in IpAddressTO
Date Thu, 13 Sep 2012 18:43:49 GMT
Elimiate mystery guestIp in IpAddressTO

Nobody can explain why it's there...

Also fix wrong return result of several empty network element callbacks


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

Branch: refs/heads/javelin
Commit: fe8a2992a210abf10efb3b3ac3c860c434acfa9e
Parents: 17b2af2
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Fri Sep 7 14:27:09 2012 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed Sep 12 15:42:48 2012 -0700

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/to/IpAddressTO.java    |    8 +-------
 .../virtualnetwork/VirtualRoutingResource.java     |    4 ++--
 .../kvm/resource/LibvirtComputingResource.java     |    3 +--
 .../hypervisor/vmware/resource/VmwareResource.java |    4 ++--
 .../xen/resource/CitrixResourceBase.java           |    4 ++--
 .../element/F5ExternalLoadBalancerElement.java     |    2 +-
 .../element/JuniperSRXExternalFirewallElement.java |    4 ++--
 .../cloud/network/element/NetscalerElement.java    |    2 +-
 .../network/ExternalFirewallDeviceManagerImpl.java |    2 +-
 .../ExternalLoadBalancerDeviceManagerImpl.java     |    2 +-
 .../router/VirtualNetworkApplianceManagerImpl.java |    4 +---
 .../VpcVirtualNetworkApplianceManagerImpl.java     |    4 ++--
 12 files changed, 17 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/api/src/com/cloud/agent/api/to/IpAddressTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/IpAddressTO.java b/api/src/com/cloud/agent/api/to/IpAddressTO.java
index f8a837a..82c7d99 100644
--- a/api/src/com/cloud/agent/api/to/IpAddressTO.java
+++ b/api/src/com/cloud/agent/api/to/IpAddressTO.java
@@ -30,13 +30,12 @@ public class IpAddressTO {
     private String vlanGateway;
     private String vlanNetmask;
     private String vifMacAddress;
-    private String guestIp;
     private Integer networkRate;
     private TrafficType trafficType;
     private String networkName;
 
     public IpAddressTO(long accountId, String ipAddress, boolean add, boolean firstIP, boolean
sourceNat, String vlanId,
-            String vlanGateway, String vlanNetmask, String vifMacAddress, String guestIp,
Integer networkRate, boolean isOneToOneNat) {
+            String vlanGateway, String vlanNetmask, String vifMacAddress, Integer networkRate,
boolean isOneToOneNat) {
         this.accountId = accountId;
         this.publicIp = ipAddress;
         this.add = add;
@@ -46,7 +45,6 @@ public class IpAddressTO {
         this.vlanGateway = vlanGateway;
         this.vlanNetmask = vlanNetmask;
         this.vifMacAddress = vifMacAddress;
-        this.guestIp = guestIp;
         this.networkRate = networkRate;
         this.oneToOneNat = isOneToOneNat;
     }
@@ -58,10 +56,6 @@ public class IpAddressTO {
         return accountId;
     }
 
-    public String getGuestIp(){
-        return guestIp;
-    }
-
     public String getPublicIp() {
         return publicIp;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index f48e3f2..2bb1145 100755
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -404,7 +404,7 @@ public class VirtualRoutingResource implements Manager {
         for (IpAddressTO ip : ips) {
             result = assignPublicIpAddress(routerName, routerIp, ip.getPublicIp(), ip.isAdd(),

                      ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(),
ip.getVlanNetmask(),
-                     ip.getVifMacAddress(), ip.getGuestIp(), 2);
+                     ip.getVifMacAddress(), 2);
             if (result != null) {
                 results[i++] = IpAssocAnswer.errorResult;
             } else {
@@ -812,7 +812,7 @@ public class VirtualRoutingResource implements Manager {
             final String privateIpAddress, final String publicIpAddress,
             final boolean add, final boolean firstIP, final boolean sourceNat,
             final String vlanId, final String vlanGateway,
-            final String vlanNetmask, final String vifMacAddress, String guestIp, int nicNum){
+            final String vlanNetmask, final String vifMacAddress, int nicNum){
 
         String args = "";
         if (add) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 53e6da7..ff2b950 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1534,8 +1534,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
                 result = _virtRouterResource.assignPublicIpAddress(routerName,
                         routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(),
                         ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(),
-                        ip.getVlanNetmask(), ip.getVifMacAddress(),
-                        ip.getGuestIp(), nicNum);
+                        ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum);
 
                 if (result != null) {
                     results[i++] = IpAssocAnswer.errorResult;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index fb75512..1fa14fa 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1365,7 +1365,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
     }
 
     protected void assignPublicIpAddress(VirtualMachineMO vmMo, final String vmName, final
String privateIpAddress, final String publicIpAddress, final boolean add, final boolean firstIP,
-            final boolean sourceNat, final String vlanId, final String vlanGateway, final
String vlanNetmask, final String vifMacAddress, String guestIp) throws Exception {
+            final boolean sourceNat, final String vlanId, final String vlanGateway, final
String vlanNetmask, final String vifMacAddress) throws Exception {
 
         String publicNeworkName = HypervisorHostHelper.getPublicNetworkNamePrefix(vlanId);
         Pair<Integer, VirtualDevice> publicNicInfo = vmMo.getNicDeviceIndex(publicNeworkName);
@@ -1570,7 +1570,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
 
             for (IpAddressTO ip : ips) {
                 assignPublicIpAddress(vmMo, routerName, controlIp, ip.getPublicIp(), ip.isAdd(),
ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),
-                        ip.getVifMacAddress(), ip.getGuestIp());
+                        ip.getVifMacAddress());
                 results[i++] = ip.getPublicIp() + " - success";
             }
         } catch (Throwable e) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index b71b47c..5c4db2b 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -1849,7 +1849,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
 
     protected void assignPublicIpAddress(Connection conn, String vmName, String privateIpAddress,
String publicIpAddress, boolean add, boolean firstIP,
-            boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String
vifMacAddress, String guestIp, Integer networkRate, TrafficType trafficType, String name)
throws InternalErrorException {
+            boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String
vifMacAddress, Integer networkRate, TrafficType trafficType, String name) throws InternalErrorException
{
 
         try {
             VM router = getVM(conn, vmName);
@@ -2028,7 +2028,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             for (IpAddressTO ip : ips) {
 
                 assignPublicIpAddress(conn, routerName, routerIp, ip.getPublicIp(), ip.isAdd(),
ip.isFirstIP(), ip.isSourceNat(), ip.getVlanId(),
-                        ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(),
ip.getGuestIp(), ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName());
+                        ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(),
ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName());
                 results[i++] = ip.getPublicIp() + " - success";
             }
         } catch (InternalErrorException e) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
index 6cfe333..13967e3 100644
--- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
+++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
@@ -464,7 +464,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan
     @Override
     public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress,
Set<Service> service) throws ResourceUnavailableException {
         // return true, as IP will be associated as part of LB rule configuration
-        return false;
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
index 4580685..cd4a074 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
@@ -543,7 +543,7 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan
 
     @Override
     public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress,
Set<Service> service) throws ResourceUnavailableException {
-        // TODO Auto-generated method stub
-        return false;
+        // return true, as IP will be associated as part of static NAT/port forwarding rule
configuration
+        return true;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
index e60ee19..77aa447 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
@@ -617,7 +617,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl
impl
     @Override
     public boolean applyIps(Network network, List<? extends PublicIpAddress> ipAddress,
Set<Service> service) throws ResourceUnavailableException {
         // return true, as IP will be associated as part of LB rule configuration
-        return false;
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
index 56097cd..1629dd5 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
@@ -413,7 +413,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase
impl
         // Get network rate
         Integer networkRate = _networkMgr.getNetworkRate(network.getId(), null);
 
-        IpAddressTO ip = new IpAddressTO(account.getAccountId(), sourceNatIpAddress, add,
false, !sharedSourceNat, publicVlanTag, null, null, null, null, networkRate, false);
+        IpAddressTO ip = new IpAddressTO(account.getAccountId(), sourceNatIpAddress, add,
false, !sharedSourceNat, publicVlanTag, null, null, null, networkRate, false);
         IpAddressTO[] ips = new IpAddressTO[1];
         ips[0] = ip;
         IpAssocCommand cmd = new IpAssocCommand(ips);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index 8ee3fe2..3837677 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -946,7 +946,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
             selfIp = selfipNic.getIp4Address();
         }
 
-        IpAddressTO ip = new IpAddressTO(guestConfig.getAccountId(), null, add, false, true,
String.valueOf(guestVlanTag), selfIp, guestVlanNetmask, null, null, networkRate, false);
+        IpAddressTO ip = new IpAddressTO(guestConfig.getAccountId(), null, add, false, true,
String.valueOf(guestVlanTag), selfIp, guestVlanNetmask, null, networkRate, false);
         IpAddressTO[] ips = new IpAddressTO[1];
         ips[0] = ip;
         IpAssocCommand cmd = new IpAssocCommand(ips);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 6618fdf..943c85f 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2654,10 +2654,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
                 String vlanNetmask = ipAddr.getNetmask();
                 String vifMacAddress = ipAddr.getMacAddress();
 
-                String vmGuestAddress = null;
-
                 IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(),
add, firstIP, 
-                        sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, vmGuestAddress,
networkRate, ipAddr.isOneToOneNat());
+                        sourceNat, vlanId, vlanGateway, vlanNetmask, vifMacAddress, networkRate,
ipAddr.isOneToOneNat());
 
                 ip.setTrafficType(network.getTrafficType());
                 ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fe8a2992/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 61846cb..3139998 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -497,7 +497,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                 
                 IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(),
add, false, 
                         ipAddr.isSourceNat(), ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(),
macAddress,
-                        null, networkRate, ipAddr.isOneToOneNat());
+                        networkRate, ipAddr.isOneToOneNat());
 
                 ip.setTrafficType(network.getTrafficType());
                 ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));
@@ -1172,7 +1172,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                 Network network = _networkMgr.getNetwork(ipAddr.getNetworkId());
                 IpAddressTO ip = new IpAddressTO(Account.ACCOUNT_ID_SYSTEM, ipAddr.getIpAddress(),
add, false, 
                         false, ipAddr.getVlanTag(), ipAddr.getGateway(), ipAddr.getNetmask(),
ipAddr.getMacAddress(),
-                        null, null, false);
+                        null, false);
 
                 ip.setTrafficType(network.getTrafficType());
                 ip.setNetworkName(_networkMgr.getNetworkTag(router.getHypervisorType(), network));


Mime
View raw message