Skip to content

Commit 142f3b3

Browse files
author
Sheng Yang
committed
PVLAN: Remove bridge parameter in PvlanSetupCommand
Bridge is hypervisor dependent, shouldn't appear in PvlanSetupCommand.
1 parent 0588545 commit 142f3b3

4 files changed

Lines changed: 8 additions & 14 deletions

File tree

‎api/src/com/cloud/agent/api/PvlanSetupCommand.java‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public enum Type {
2626
VM
2727
}
2828
private String op;
29-
private String bridge;
3029
private String primary;
3130
private String isolated;
3231
private String vmMac;
@@ -37,27 +36,26 @@ public enum Type {
3736

3837
protected PvlanSetupCommand() {}
3938

40-
protected PvlanSetupCommand(Type type, String op, String bridge, URI uri)
39+
protected PvlanSetupCommand(Type type, String op, URI uri)
4140
{
4241
this.type = type;
4342
this.op = op;
44-
this.bridge = bridge;
4543
this.primary = NetUtils.getPrimaryPvlanFromUri(uri);
4644
this.isolated = NetUtils.getIsolatedPvlanFromUri(uri);
4745
}
4846

49-
static public PvlanSetupCommand createDhcpSetup(String op, String bridge, URI uri, String dhcpName, String dhcpMac, String dhcpIp)
47+
static public PvlanSetupCommand createDhcpSetup(String op, URI uri, String dhcpName, String dhcpMac, String dhcpIp)
5048
{
51-
PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, bridge, uri);
49+
PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, uri);
5250
cmd.setDhcpName(dhcpName);
5351
cmd.setDhcpMac(dhcpMac);
5452
cmd.setDhcpIp(dhcpIp);
5553
return cmd;
5654
}
5755

58-
static public PvlanSetupCommand createVmSetup(String op, String bridge, URI uri, String vmMac)
56+
static public PvlanSetupCommand createVmSetup(String op, URI uri, String vmMac)
5957
{
60-
PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, bridge, uri);
58+
PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, uri);
6159
cmd.setVmMac(vmMac);
6260
return cmd;
6361
}
@@ -71,10 +69,6 @@ public String getOp() {
7169
return op;
7270
}
7371

74-
public String getBridge() {
75-
return bridge;
76-
}
77-
7872
public String getPrimary() {
7973
return primary;
8074
}

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,12 +1474,12 @@ private Answer execute(PvlanSetupCommand cmd) {
14741474
String primaryPvlan = cmd.getPrimary();
14751475
String isolatedPvlan = cmd.getIsolated();
14761476
String op = cmd.getOp();
1477-
String bridge = cmd.getBridge();
14781477
String dhcpName = cmd.getDhcpName();
14791478
String dhcpMac = cmd.getDhcpMac();
14801479
String dhcpIp = cmd.getDhcpIp();
14811480
String vmMac = cmd.getVmMac();
14821481

1482+
String bridge = "xenbr0";
14831483
String result = null;
14841484
if (cmd.getType() == PvlanSetupCommand.Type.DHCP) {
14851485
result = callHostPlugin(conn, "ovs-pvlan", "setup-pvlan-dhcp", "op", op, "bridge", bridge,

‎server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ private boolean setupDhcpForPvlan(boolean add, DomainRouterVO router, Nic nic) {
22192219
if (!add) {
22202220
op = "delete";
22212221
}
2222-
PvlanSetupCommand cmd = PvlanSetupCommand.createDhcpSetup(op, "xenbr0", nic.getBroadcastUri(), router.getInstanceName(), nic.getMacAddress(), nic.getIp4Address());
2222+
PvlanSetupCommand cmd = PvlanSetupCommand.createDhcpSetup(op, nic.getBroadcastUri(), router.getInstanceName(), nic.getMacAddress(), nic.getIp4Address());
22232223
Commands cmds = new Commands(cmd);
22242224
// In fact we send command to the host of router, we're not programming router but the host
22252225
try {

‎server/src/com/cloud/vm/UserVmManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2761,7 +2761,7 @@ private boolean setupVmForPvlan(boolean add, Long hostId, NicVO nic) {
27612761
// "delete" would remove all the rules(if using ovs) related to this vm
27622762
op = "delete";
27632763
}
2764-
PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, "xenbr0", nic.getBroadcastUri(), nic.getMacAddress());
2764+
PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, nic.getBroadcastUri(), nic.getMacAddress());
27652765
Answer answer = null;
27662766
try {
27672767
answer = _agentMgr.send(hostId, cmd);

0 commit comments

Comments
 (0)