Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53FEFE5DF for ; Wed, 23 Jan 2013 07:16:11 +0000 (UTC) Received: (qmail 97303 invoked by uid 500); 23 Jan 2013 07:16:10 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 96014 invoked by uid 500); 23 Jan 2013 07:16:04 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 94768 invoked by uid 99); 23 Jan 2013 07:15:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jan 2013 07:15:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E971E8243A8; Wed, 23 Jan 2013 07:15:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hugo@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [17/45] git commit: Summary: Add initial support for OpenVswitch to the KVM hypervisor Message-Id: <20130123071557.E971E8243A8@tyr.zones.apache.org> Date: Wed, 23 Jan 2013 07:15:57 +0000 (UTC) Summary: Add initial support for OpenVswitch to the KVM hypervisor Create OvsVifDriver to deal with openvswitch specifics for plugging intefaces Create a parameter to set the bridge type to use in LibvirtComputingResource. Create several functions to get bridge information from openvswitch Add a check to detect the libvirt version and throw an exception when the version is to low ( < 0.9.11 ) Fix classpath loading in Script.findScript to deal with missing path separators at the end. Add notification to the BridgeVifDriver that lswitch broadcast type is not supported. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/68523e64 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/68523e64 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/68523e64 Branch: refs/heads/master Commit: 68523e641fa323e1303bfc7499a524b0475fa55f Parents: 3d570c7 Author: Hugo Trippaers Authored: Thu Jan 10 18:30:07 2013 +0100 Committer: Hugo Trippaers Committed: Tue Jan 15 09:18:24 2013 +0100 ---------------------------------------------------------------------- .../hypervisor/kvm/resource/OvsVifDriver.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/68523e64/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java index 52fc29e..d8b80e9 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java @@ -84,11 +84,11 @@ public class OvsVifDriver extends VifDriverBase { && !vlanId.equalsIgnoreCase("untagged")) { if(trafficLabel != null && !trafficLabel.isEmpty()) { s_logger.debug("creating a vlan dev and bridge for guest traffic per traffic label " + trafficLabel); - intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType)); - intf.setVlanTag(Integer.parseInt(vlanId)); + String brName = createVlanBr(vlanId, _pifs.get(trafficLabel)); + intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType)); } else { - intf.defBridgeNet(_pifs.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType)); - intf.setVlanTag(Integer.parseInt(vlanId)); + String brName = createVlanBr(vlanId, _pifs.get("private")); + intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType)); } } else if (nic.getBroadcastType() == Networks.BroadcastDomainType.Lswitch) { s_logger.debug("nic " + nic + " needs to be connected to LogicalSwitch " + logicalSwitchUuid); @@ -144,7 +144,7 @@ public class OvsVifDriver extends VifDriverBase { return brName; } - private void deleteExitingLinkLocalRoutTable(String linkLocalBr) { + private void deleteExitingLinkLocalRoutTable(String linkLocalBr) { Script command = new Script("/bin/bash", _timeout); command.add("-c"); command.add("ip route | grep " + NetUtils.getLinkLocalCIDR());