cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject [48/52] [abbrv] git commit: updated refs/heads/pvlan to 3c3d677
Date Thu, 02 May 2013 21:56:23 GMT
PVLAN: Remove bridge parameter in PvlanSetupCommand

Bridge is hypervisor dependent, shouldn't appear in PvlanSetupCommand.



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

Branch: refs/heads/pvlan
Commit: 142f3b30f44f279b34ce845ffaec853ef68be36d
Parents: 0588545
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Wed May 1 13:23:08 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed May 1 13:23:08 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/PvlanSetupCommand.java |   16 ++++----------
 .../xen/resource/CitrixResourceBase.java           |    2 +-
 .../router/VirtualNetworkApplianceManagerImpl.java |    2 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java     |    2 +-
 4 files changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/142f3b30/api/src/com/cloud/agent/api/PvlanSetupCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/PvlanSetupCommand.java b/api/src/com/cloud/agent/api/PvlanSetupCommand.java
index e5d4da0..0426219 100644
--- a/api/src/com/cloud/agent/api/PvlanSetupCommand.java
+++ b/api/src/com/cloud/agent/api/PvlanSetupCommand.java
@@ -26,7 +26,6 @@ public class PvlanSetupCommand extends Command {
 		VM
 	}
 	private String op;
-	private String bridge;
 	private String primary;
 	private String isolated;
 	private String vmMac;
@@ -37,27 +36,26 @@ public class PvlanSetupCommand extends Command {
 
 	protected PvlanSetupCommand() {}
 	
-	protected PvlanSetupCommand(Type type, String op, String bridge, URI uri)
+	protected PvlanSetupCommand(Type type, String op, URI uri)
 	{
 		this.type = type;
 		this.op = op;
-		this.bridge = bridge;
 		this.primary = NetUtils.getPrimaryPvlanFromUri(uri);
 		this.isolated = NetUtils.getIsolatedPvlanFromUri(uri);
 	}
 	
-	static public PvlanSetupCommand createDhcpSetup(String op, String bridge, URI uri, String
dhcpName, String dhcpMac, String dhcpIp)
+	static public PvlanSetupCommand createDhcpSetup(String op, URI uri, String dhcpName, String
dhcpMac, String dhcpIp)
 	{
-		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, bridge, uri);
+		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, uri);
 		cmd.setDhcpName(dhcpName);
 		cmd.setDhcpMac(dhcpMac);
 		cmd.setDhcpIp(dhcpIp);
 		return cmd;
 	}
 	
-	static public PvlanSetupCommand createVmSetup(String op, String bridge, URI uri, String
vmMac)
+	static public PvlanSetupCommand createVmSetup(String op, URI uri, String vmMac)
 	{
-		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, bridge, uri);
+		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, uri);
 		cmd.setVmMac(vmMac);
 		return cmd;
 	}
@@ -71,10 +69,6 @@ public class PvlanSetupCommand extends Command {
 		return op;
 	}
 
-	public String getBridge() {
-		return bridge;
-	}
-
 	public String getPrimary() {
 		return primary;
 	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/142f3b30/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 933f4d3..d25938f 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
@@ -1474,12 +1474,12 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
     	String primaryPvlan = cmd.getPrimary();
     	String isolatedPvlan = cmd.getIsolated();
     	String op = cmd.getOp();
-    	String bridge = cmd.getBridge();
     	String dhcpName = cmd.getDhcpName();
     	String dhcpMac = cmd.getDhcpMac();
     	String dhcpIp = cmd.getDhcpIp();
     	String vmMac = cmd.getVmMac();
     	
+    	String bridge = "xenbr0";
     	String result = null;
     	if (cmd.getType() == PvlanSetupCommand.Type.DHCP) {
     		result = callHostPlugin(conn, "ovs-pvlan", "setup-pvlan-dhcp", "op", op, "bridge",
bridge,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/142f3b30/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 d22c7fc..59a9f05 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2219,7 +2219,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
     	if (!add) {
     		op = "delete";
     	}
-    	PvlanSetupCommand cmd = PvlanSetupCommand.createDhcpSetup(op, "xenbr0", nic.getBroadcastUri(),
router.getInstanceName(), nic.getMacAddress(), nic.getIp4Address());
+    	PvlanSetupCommand cmd = PvlanSetupCommand.createDhcpSetup(op, nic.getBroadcastUri(),
router.getInstanceName(), nic.getMacAddress(), nic.getIp4Address());
     	Commands cmds = new Commands(cmd);
     	// In fact we send command to the host of router, we're not programming router but the
host
     	try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/142f3b30/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 7a9fc47..6ea2952 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2761,7 +2761,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         	// "delete" would remove all the rules(if using ovs) related to this vm
         	op = "delete";
         }
-    	PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, "xenbr0", nic.getBroadcastUri(),
nic.getMacAddress());
+    	PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, nic.getBroadcastUri(), nic.getMacAddress());
         Answer answer = null;
         try {
             answer = _agentMgr.send(hostId, cmd);


Mime
View raw message