[DRE-commits] [vagrant-libvirt] 85/163: Support open vSwitch bridge device
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:57:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.26
in repository vagrant-libvirt.
commit 9958e9b915a5185dda509e71c35836b54d0371a3
Author: Eohyung Lee <liquidnuker at gmail.com>
Date: Wed Nov 19 14:22:41 2014 +0900
Support open vSwitch bridge device
---
README.md | 1 +
lib/vagrant-libvirt/action/create_network_interfaces.rb | 1 +
lib/vagrant-libvirt/templates/public_interface.xml.erb | 9 +++++----
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 14e0812..aaa089a 100644
--- a/README.md
+++ b/README.md
@@ -253,6 +253,7 @@ starts with 'libvirt__' string. Here is a list of those options:
modes are available from the [libvirt documentation](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
Default mode is 'bridge'.
* `:mac` - MAC address for the interface.
+* `:ovs` - Support to connect to an open vSwitch bridge device. Default is 'false'.
### Management Network
diff --git a/lib/vagrant-libvirt/action/create_network_interfaces.rb b/lib/vagrant-libvirt/action/create_network_interfaces.rb
index fab965b..bd12f81 100644
--- a/lib/vagrant-libvirt/action/create_network_interfaces.rb
+++ b/lib/vagrant-libvirt/action/create_network_interfaces.rb
@@ -79,6 +79,7 @@ module VagrantPlugins
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
template_name = 'public_interface'
@logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
+ @ovs = iface_configuration.fetch(:ovs, false)
end
message = "Creating network interface eth#{@iface_number}"
diff --git a/lib/vagrant-libvirt/templates/public_interface.xml.erb b/lib/vagrant-libvirt/templates/public_interface.xml.erb
index 0af02df..11c82bf 100644
--- a/lib/vagrant-libvirt/templates/public_interface.xml.erb
+++ b/lib/vagrant-libvirt/templates/public_interface.xml.erb
@@ -1,6 +1,6 @@
<interface type='<%= @type %>'>
- <% if @mac %>
- <mac address='<%= @mac %>'/>
+ <% if @mac %>
+ <mac address='<%= @mac %>'/>
<% end %>
<%if @type == 'direct'%>
<source dev='<%= @device %>' mode='<%= @mode %>'/>
@@ -8,6 +8,7 @@
<source bridge='<%=@device%>'/>
<% end %>
<model type='<%=@model_type%>'/>
+ <% if @ovs %>
+ <virtualport type='openvswitch'/>
+ <% end %>
</interface>
-
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git
More information about the Pkg-ruby-extras-commits
mailing list