vagrant-libvirt 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +4 -1
- data/lib/vagrant-libvirt/action/forward_ports.rb +5 -2
- data/lib/vagrant-libvirt/cap/mount_p9.rb +4 -4
- data/lib/vagrant-libvirt/cap/synced_folder.rb +4 -5
- data/lib/vagrant-libvirt/config.rb +3 -0
- data/lib/vagrant-libvirt/templates/interface.xml.erb +1 -1
- data/lib/vagrant-libvirt/version.rb +1 -1
- data/vagrant-libvirt.gemspec +8 -8
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fdf8fd6ca4373ada92ce1485825e511b1fdd31c
|
4
|
+
data.tar.gz: ec35f9ff56aedd836339cde2f3a1d6e387ef03d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2d803e5384f118a5380c18536ebd190a397aacdb4e3cacbd09365100210b681737bdbd7a4be8ac085d724f10777a42963bd5023e0b57919e4e43ca47780eea
|
7
|
+
data.tar.gz: a5243fd03b92a76e0a921ed93a061bd5b0161568a60905f074d5c37a5f6a8706db98d94d0273b91162817c1cf98ec609f5d3ec331605891b67a98f64c089763d
|
data/README.md
CHANGED
@@ -141,6 +141,7 @@ end
|
|
141
141
|
### Domain Specific Options
|
142
142
|
|
143
143
|
* `disk_bus` - The type of disk device to emulate. Defaults to virtio if not set. Possible values are documented in libvirt's [description for _target_](http://libvirt.org/formatdomain.html#elementsDisks).
|
144
|
+
* `nic_model_type` - parameter specifies the model of the network adapter when you create a domain value by default virtio KVM believe possible values, see the documentation for libvirt
|
144
145
|
* `memory` - Amount of memory in MBytes. Defaults to 512 if not set.
|
145
146
|
* `cpus` - Number of virtual cpus. Defaults to 1 if not set.
|
146
147
|
* `nested` - [Enable nested virtualization](https://github.com/torvalds/linux/blob/master/Documentation/virtual/kvm/nested-vmx.txt). Default is false.
|
@@ -238,6 +239,7 @@ starts with 'libvirt__' string. Here is a list of those options:
|
|
238
239
|
be forwarded (NATed or routed). Used only when creating new network. By
|
239
240
|
default, all physical interfaces are used.
|
240
241
|
* `:mac` - MAC address for the interface.
|
242
|
+
* `model_type` - parameter specifies the model of the network adapter when you create a domain value by default virtio KVM believe possible values, see the documentation for libvirt
|
241
243
|
|
242
244
|
### Public Network Options
|
243
245
|
* `:dev` - Physical device that the public interface should use. Default is 'eth0'.
|
@@ -309,6 +311,12 @@ vagrant-libvirt supports Forwarded Ports via ssh port forwarding. For each
|
|
309
311
|
`forwarded_port` directive you specify in your Vagrantfile, vagrant-libvirt
|
310
312
|
will maintain an active ssh process for the lifetime of the VM.
|
311
313
|
|
314
|
+
vagrant-libvirt supports an additional `forwarded_port` option
|
315
|
+
`gateway_ports` which defaults to `false`, but can be set to `true` if
|
316
|
+
you want the forwarded port to be accessible from outside the Vagrant
|
317
|
+
host. In this case you should also set the `host_ip` option to `'*'`
|
318
|
+
since it defaults to `'localhost'`.
|
319
|
+
|
312
320
|
## Synced Folders
|
313
321
|
|
314
322
|
vagrant-libvirt supports bidirectional synced folders via nfs or 9p and
|
@@ -17,6 +17,8 @@ module VagrantPlugins
|
|
17
17
|
def initialize(app, env)
|
18
18
|
@logger = Log4r::Logger.new('vagrant_libvirt::action::create_network_interfaces')
|
19
19
|
@management_network_name = env[:machine].provider_config.management_network_name
|
20
|
+
config = env[:machine].provider_config
|
21
|
+
@nic_model_type = config.nic_model_type
|
20
22
|
@app = app
|
21
23
|
end
|
22
24
|
|
@@ -66,6 +68,7 @@ module VagrantPlugins
|
|
66
68
|
@iface_number = slot_number
|
67
69
|
@network_name = iface_configuration[:network_name]
|
68
70
|
@mac = iface_configuration.fetch(:mac, false)
|
71
|
+
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
69
72
|
template_name = 'interface'
|
70
73
|
|
71
74
|
# Configuration for public interfaces which use the macvtap driver
|
@@ -73,7 +76,7 @@ module VagrantPlugins
|
|
73
76
|
@device = iface_configuration.fetch(:dev, 'eth0')
|
74
77
|
@type = iface_configuration.fetch(:type, 'direct')
|
75
78
|
@mode = iface_configuration.fetch(:mode, 'bridge')
|
76
|
-
@model_type = iface_configuration.fetch(:model_type,
|
79
|
+
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
77
80
|
template_name = 'public_interface'
|
78
81
|
@logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
|
79
82
|
end
|
@@ -53,7 +53,8 @@ module VagrantPlugins
|
|
53
53
|
fp[:host_ip] || 'localhost',
|
54
54
|
fp[:host],
|
55
55
|
fp[:guest_ip] || @env[:machine].provider.ssh_info[:host],
|
56
|
-
fp[:guest]
|
56
|
+
fp[:guest],
|
57
|
+
fp[:gateway_ports] || false
|
57
58
|
)
|
58
59
|
store_ssh_pid(fp[:host], ssh_pid)
|
59
60
|
end
|
@@ -78,13 +79,15 @@ module VagrantPlugins
|
|
78
79
|
mappings.values
|
79
80
|
end
|
80
81
|
|
81
|
-
def redirect_port(machine, host_ip, host_port, guest_ip, guest_port
|
82
|
+
def redirect_port(machine, host_ip, host_port, guest_ip, guest_port,
|
83
|
+
gateway_ports)
|
82
84
|
ssh_info = machine.ssh_info
|
83
85
|
params = %W(
|
84
86
|
"-L #{host_ip}:#{host_port}:#{guest_ip}:#{guest_port}"
|
85
87
|
-N
|
86
88
|
#{ssh_info[:host]}
|
87
89
|
).join(' ')
|
90
|
+
params += ' -g' if gateway_ports
|
88
91
|
|
89
92
|
options = (%W(
|
90
93
|
User=#{ssh_info[:username]}
|
@@ -6,7 +6,7 @@ module VagrantPlugins
|
|
6
6
|
class MountP9
|
7
7
|
extend Vagrant::Util::Retryable
|
8
8
|
|
9
|
-
def self.mount_p9_shared_folder(machine, folders
|
9
|
+
def self.mount_p9_shared_folder(machine, folders)
|
10
10
|
folders.each do |name, opts|
|
11
11
|
# Expand the guest path so we can handle things like "~/vagrant"
|
12
12
|
expanded_guest_path = machine.guest.capability(
|
@@ -19,9 +19,9 @@ module VagrantPlugins
|
|
19
19
|
mount_tag = name.dup
|
20
20
|
|
21
21
|
mount_opts="-o trans=virtio"
|
22
|
-
mount_opts += ",access=#{
|
23
|
-
mount_opts += ",version=#{
|
24
|
-
mount_opts += ",#{opts[:
|
22
|
+
mount_opts += ",access=#{opts[:owner]}" if opts[:owner]
|
23
|
+
mount_opts += ",version=#{opts[:version]}" if opts[:version]
|
24
|
+
mount_opts += ",#{opts[:mount_opts]}" if opts[:mount_opts]
|
25
25
|
|
26
26
|
mount_command = "mount -t 9p #{mount_opts} '#{mount_tag}' #{expanded_guest_path}"
|
27
27
|
retryable(:on => Vagrant::Errors::LinuxMountFailed,
|
@@ -44,7 +44,7 @@ module VagrantPlugins
|
|
44
44
|
# loop through folders
|
45
45
|
folders.each do |id, folder_opts|
|
46
46
|
folder_opts.merge!({ :accessmode => "passthrough",
|
47
|
-
|
47
|
+
:readonly => nil }) { |_k, ov, _nv| ov }
|
48
48
|
machine.ui.info "================\nMachine id: #{machine.id}\nShould be mounting folders\n #{id}, opts: #{folder_opts}"
|
49
49
|
|
50
50
|
xml = to_xml('filesystem', folder_opts )
|
@@ -67,13 +67,12 @@ module VagrantPlugins
|
|
67
67
|
mount_folders = {}
|
68
68
|
folders.each do |id, opts|
|
69
69
|
mount_folders[id] = opts.dup if opts[:guestpath]
|
70
|
+
# merge common options if not given
|
71
|
+
mount_folders[id].merge!(:version => '9p2000.L') { |_k, ov, _nv| ov }
|
70
72
|
end
|
71
|
-
common_opts = {
|
72
|
-
:version => '9p2000.L',
|
73
|
-
}
|
74
73
|
# Mount the actual folder
|
75
74
|
machine.guest.capability(
|
76
|
-
:mount_p9_shared_folder, mount_folders
|
75
|
+
:mount_p9_shared_folder, mount_folders)
|
77
76
|
end
|
78
77
|
|
79
78
|
def cleanup(machine, _opts)
|
@@ -55,6 +55,7 @@ module VagrantPlugins
|
|
55
55
|
attr_accessor :cpus
|
56
56
|
attr_accessor :cpu_mode
|
57
57
|
attr_accessor :disk_bus
|
58
|
+
attr_accessor :nic_model_type
|
58
59
|
attr_accessor :nested
|
59
60
|
attr_accessor :volume_cache
|
60
61
|
attr_accessor :kernel
|
@@ -82,6 +83,7 @@ module VagrantPlugins
|
|
82
83
|
@cpus = UNSET_VALUE
|
83
84
|
@cpu_mode = UNSET_VALUE
|
84
85
|
@disk_bus = UNSET_VALUE
|
86
|
+
@nic_model_type = UNSET_VALUE
|
85
87
|
@nested = UNSET_VALUE
|
86
88
|
@volume_cache = UNSET_VALUE
|
87
89
|
@kernel = UNSET_VALUE
|
@@ -198,6 +200,7 @@ module VagrantPlugins
|
|
198
200
|
@cpus = 1 if @cpus == UNSET_VALUE
|
199
201
|
@cpu_mode = 'host-model' if @cpu_mode == UNSET_VALUE
|
200
202
|
@disk_bus = 'virtio' if @disk_bus == UNSET_VALUE
|
203
|
+
@nic_model_type = 'virtio' if @nic_model_type == UNSET_VALUE
|
201
204
|
@nested = false if @nested == UNSET_VALUE
|
202
205
|
@volume_cache = 'default' if @volume_cache == UNSET_VALUE
|
203
206
|
@kernel = nil if @kernel == UNSET_VALUE
|
data/vagrant-libvirt.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ['Lukas Stanek','Dima Vasilets','Brian Pitts']
|
6
6
|
gem.email = ['ls@elostech.cz','pronix.service@gmail.com','brian@polibyte.com']
|
7
7
|
gem.license = 'MIT'
|
8
|
-
gem.description = %q{Vagrant provider for libvirt.}
|
8
|
+
gem.description = %q{Vagrant provider for libvirt. support a lot options}
|
9
9
|
gem.summary = %q{Vagrant provider for libvirt.}
|
10
10
|
gem.homepage = 'https://github.com/pradels/vagrant-libvirt'
|
11
11
|
|
@@ -16,14 +16,14 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ['lib']
|
17
17
|
gem.version = VagrantPlugins::ProviderLibvirt::VERSION
|
18
18
|
|
19
|
-
gem.add_development_dependency
|
20
|
-
gem.add_development_dependency
|
21
|
-
gem.add_development_dependency
|
19
|
+
gem.add_development_dependency 'rspec-core', '2.12.2'
|
20
|
+
gem.add_development_dependency 'rspec-expectations', '2.12.1'
|
21
|
+
gem.add_development_dependency 'rspec-mocks', '2.12.1'
|
22
22
|
|
23
|
-
gem.add_runtime_dependency 'fog', '
|
24
|
-
gem.add_runtime_dependency 'ruby-libvirt', '
|
25
|
-
gem.add_runtime_dependency 'nokogiri', '
|
23
|
+
gem.add_runtime_dependency 'fog', '1.15'
|
24
|
+
gem.add_runtime_dependency 'ruby-libvirt', '0.4.0'
|
25
|
+
gem.add_runtime_dependency 'nokogiri', '1.6'
|
26
26
|
|
27
|
-
gem.add_development_dependency 'rake'
|
27
|
+
gem.add_development_dependency 'rake', '10.1.0'
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
@@ -10,107 +10,107 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-09-
|
13
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-core
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 2.12.2
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 2.12.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rspec-expectations
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: 2.12.1
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.12.1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec-mocks
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 2.12.1
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 2.12.1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: fog
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '1.15'
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '1.15'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: ruby-libvirt
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: 0.4.0
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - '='
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: 0.4.0
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: nokogiri
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '1.6'
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - '='
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '1.6'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: rake
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
105
|
+
version: 10.1.0
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - '='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
113
|
-
description: Vagrant provider for libvirt.
|
112
|
+
version: 10.1.0
|
113
|
+
description: Vagrant provider for libvirt. support a lot options
|
114
114
|
email:
|
115
115
|
- ls@elostech.cz
|
116
116
|
- pronix.service@gmail.com
|