[DRE-commits] [vagrant-libvirt] 66/104: Added defaults for :dev and :mode. Updated documentation to explain these options.
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:55:46 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.11
in repository vagrant-libvirt.
commit 151f212d508209c143c30cf98dbc71895b5c6864
Author: Nick Downs <nickryand at gmail.com>
Date: Tue Sep 10 22:45:40 2013 -0700
Added defaults for :dev and :mode. Updated documentation to explain these options.
---
README.md | 6 ++++++
lib/vagrant-libvirt/action/create_network_interfaces.rb | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3450c47..eccd59f 100644
--- a/README.md
+++ b/README.md
@@ -216,6 +216,12 @@ starts with 'libvirt__' string. Here is a list of those options:
be forwarded (NATed or routed). Used only when creating new network. By
default, all physical interfaces are used.
+### Public Network Options
+* `:dev` - Physical device that the public interface should use. Default is 'eth0'
+* `:mode` - The mode in which the public interface should operate in. Supported
+ modes are available from the [libvirt documentation](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
+ Default mode is 'bridge'.
+
## Obtaining Domain IP Address
Libvirt doesn't provide standard way how to find out an IP address of running
diff --git a/lib/vagrant-libvirt/action/create_network_interfaces.rb b/lib/vagrant-libvirt/action/create_network_interfaces.rb
index 3fbdebe..5c68b42 100644
--- a/lib/vagrant-libvirt/action/create_network_interfaces.rb
+++ b/lib/vagrant-libvirt/action/create_network_interfaces.rb
@@ -70,8 +70,9 @@ module VagrantPlugins
# Configuration for public interfaces which use the macvtap driver
if iface_configuration[:iface_type] == :public_network
template_name = 'public_interface'
- @device = iface_configuration[:dev]
- @mode = iface_configuration[:mode]
+ @device = iface_configuration.fetch(:dev, 'eth0')
+ @mode = iface_configuration.fetch(:mode, 'bridge')
+ @logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
end
message = "Creating network interface eth#{@iface_number}"
--
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