incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject [28/50] [abbrv] git commit: CLOUDSTACK-316: if public network is not specified, set to guest network
Date Mon, 15 Oct 2012 20:29:47 GMT
CLOUDSTACK-316: if public network is not specified, set to guest network


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

Branch: refs/heads/junit-tests
Commit: c6bc77c297d08d2b084b8fdfe77b956ffca07005
Parents: e905f61
Author: Edison Su <sudison@gmail.com>
Authored: Thu Oct 11 16:19:53 2012 -0700
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Mon Oct 15 16:19:18 2012 -0400

----------------------------------------------------------------------
 .../kvm/discoverer/KvmServerDiscoverer.java        |   36 +++++++++-----
 1 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c6bc77c2/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
index 03746e7..9d6e5b6 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
@@ -176,9 +176,9 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
 			}
 			
 			List <PhysicalNetworkSetupInfo> netInfos = _networkMgr.getPhysicalNetworkInfo(dcId,
HypervisorType.KVM);
-			String kvmPrivateNic = _kvmPrivateNic;
-			String kvmPublicNic = _kvmPublicNic;
-			String kvmGuestNic = _kvmGuestNic;
+			String kvmPrivateNic = null;
+			String kvmPublicNic = null;
+			String kvmGuestNic = null;
 
 			for (PhysicalNetworkSetupInfo info : netInfos) {
 			    if (info.getPrivateNetworkName() != null) {
@@ -191,21 +191,31 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
 			        kvmGuestNic = info.getGuestNetworkName();
 			    }
 			}
-
-                        String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId
+ " -c " + clusterId + " -g " + guid + " -a";
 			
-			if (kvmPublicNic != null) {
-				parameters += " --pubNic=" + kvmPublicNic;
-			}
+			if (kvmPrivateNic == null && kvmPublicNic == null && kvmGuestNic == null)
{
+				kvmPrivateNic = _kvmPrivateNic;
+				kvmPublicNic = _kvmPublicNic;
+				kvmGuestNic = _kvmGuestNic;
+			} 
 			
-			if (kvmPrivateNic != null) {
-				parameters += " --prvNic=" + kvmPrivateNic;
+			if (kvmPublicNic == null) {
+				kvmPublicNic = (kvmGuestNic != null) ? kvmGuestNic : kvmPrivateNic;
+			} 
+			
+			if (kvmPrivateNic == null) {
+				kvmPrivateNic = (kvmPublicNic != null) ? kvmPublicNic : kvmGuestNic;
 			}
 			
-			if (kvmGuestNic != null) {
-			    parameters += " --guestNic=" + kvmGuestNic;
+			if (kvmGuestNic == null) {
+				kvmGuestNic = (kvmPublicNic != null) ? kvmPublicNic : kvmPrivateNic;
 			}
-		
+
+            String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c
" + clusterId + " -g " + guid + " -a";
+
+            parameters += " --pubNic=" + kvmPublicNic;
+            parameters += " --prvNic=" + kvmPrivateNic;
+            parameters += " --guestNic=" + kvmGuestNic;
+
 			SSHCmdHelper.sshExecuteCmd(sshConnection, "cloud-setup-agent " + parameters, 3);
 			
 			KvmDummyResourceBase kvmResource = new KvmDummyResourceBase();


Mime
View raw message