vagrant-kvm 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/CHANGELOG.md +0 -7
- data/DEVELOPMENT.md +69 -0
- data/INSTALL.md +1 -1
- data/README.md +61 -47
- data/bin/package.sh +83 -0
- data/install.rb +7 -0
- data/lib/vagrant-kvm/action.rb +23 -31
- data/lib/vagrant-kvm/action/customize.rb +44 -0
- data/lib/vagrant-kvm/action/import.rb +52 -23
- data/lib/vagrant-kvm/action/init_storage_pool.rb +5 -4
- data/lib/vagrant-kvm/action/network.rb +127 -30
- data/lib/vagrant-kvm/action/{prepare_gui.rb → prepare_kvmconfig.rb} +4 -1
- data/lib/vagrant-kvm/action/prepare_nfs_settings.rb +16 -23
- data/lib/vagrant-kvm/action/set_name.rb +27 -3
- data/lib/vagrant-kvm/action/share_folders.rb +4 -5
- data/lib/vagrant-kvm/cap/mount_p9.rb +40 -0
- data/lib/vagrant-kvm/config.rb +73 -1
- data/lib/vagrant-kvm/driver/driver.rb +303 -117
- data/lib/vagrant-kvm/errors.rb +4 -4
- data/lib/vagrant-kvm/plugin.rb +12 -2
- data/lib/vagrant-kvm/provider.rb +2 -19
- data/lib/vagrant-kvm/synced_folder.rb +57 -0
- data/lib/vagrant-kvm/util/network_definition.rb +30 -3
- data/lib/vagrant-kvm/util/vm_definition.rb +110 -11
- data/lib/vagrant-kvm/version.rb +1 -1
- data/locales/en.yml +5 -3
- data/locales/ja.yml +11 -4
- data/spec/vagrant-kvm/config_spec.rb +6 -0
- data/spec/vagrant-kvm/driver/driver_spec.rb +4 -3
- data/spec/vagrant-kvm/util/vm_definition_spec.rb +4 -8
- data/templates/libvirt_domain.erb +29 -3
- data/vagrant-kvm.gemspec +3 -3
- metadata +21 -9
- data/lib/vagrant-kvm/action/prune_nfs_exports.rb +0 -20
@@ -20,7 +20,10 @@ describe VagrantPlugins::ProviderKvm::Util::VmDefinition do
|
|
20
20
|
vnc_autoport: false,
|
21
21
|
vnc_password: 'abc123'
|
22
22
|
|
23
|
-
subject.should include("<graphics
|
23
|
+
subject.should include("<graphics")
|
24
|
+
subject.should include("type='vnc'")
|
25
|
+
subject.should include("port='1234'")
|
26
|
+
subject.should include("autoport='false'")
|
24
27
|
|
25
28
|
new_definition = VagrantPlugins::ProviderKvm::Util::VmDefinition.new(subject)
|
26
29
|
new_definition.get(:gui).should be_true
|
@@ -45,13 +48,6 @@ describe VagrantPlugins::ProviderKvm::Util::VmDefinition do
|
|
45
48
|
should_set(:network_model, "ne2k_pci")
|
46
49
|
end
|
47
50
|
|
48
|
-
it "doesn't set the network driver if network_mode=:default" do
|
49
|
-
should_set(:network_model, :default) do |xml|
|
50
|
-
doc = REXML::Document.new(xml)
|
51
|
-
doc.elements["//devices/interface/model"].should be_nil
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
51
|
it "sets the video type" do
|
56
52
|
should_default(:video_model, "cirrus")
|
57
53
|
should_set(:video_model, "vga")
|
@@ -3,6 +3,13 @@
|
|
3
3
|
<% if uuid %>
|
4
4
|
<uuid><%= uuid %></uuid>
|
5
5
|
<% end %>
|
6
|
+
<% if secmodel == 'selinux' %>
|
7
|
+
<seclabel type='dynamic' model='selinux'/>
|
8
|
+
<% elsif secmodel == 'apparmor' %>
|
9
|
+
<seclabel type='dynamic' model='apparmor'/>
|
10
|
+
<% elsif secmodel == 'dac' %>
|
11
|
+
<seclabel type='dynamic' model='dac'/>
|
12
|
+
<% end %>
|
6
13
|
<memory unit='<%= memory_unit %>'><%= memory_size %></memory>
|
7
14
|
<currentMemory unit='<%= memory_unit %>'><%= memory_size %></currentMemory>
|
8
15
|
<vcpu placement='static'><%= cpus %></vcpu>
|
@@ -52,10 +59,9 @@
|
|
52
59
|
</controller>
|
53
60
|
<interface type='network'>
|
54
61
|
<mac address='<%= mac %>'/>
|
55
|
-
<source network='
|
56
|
-
<% unless network_model == :default %>
|
62
|
+
<source network='<%= network %>'/>
|
57
63
|
<model type='<%= network_model %>'/>
|
58
|
-
|
64
|
+
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' />
|
59
65
|
</interface>
|
60
66
|
<serial type='pty'>
|
61
67
|
<target port='0'/>
|
@@ -65,9 +71,11 @@
|
|
65
71
|
</console>
|
66
72
|
<input type='mouse' bus='ps2'/>
|
67
73
|
<input type='tablet' bus='usb'/>
|
74
|
+
<% if sound %>
|
68
75
|
<sound model='ich6'>
|
69
76
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
70
77
|
</sound>
|
78
|
+
<% end %>
|
71
79
|
<% if gui %>
|
72
80
|
<graphics type='vnc' port='<%= vnc_port || -1 %>' autoport='<%= vnc_autoport %>' listen='0.0.0.0' passwd='<%= vnc_password %>'>
|
73
81
|
<listen type='address' address='0.0.0.0'/>
|
@@ -80,5 +88,23 @@
|
|
80
88
|
<memballoon model='virtio'>
|
81
89
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
82
90
|
</memballoon>
|
91
|
+
<% if p9 %>
|
92
|
+
<% p9.each_with_index do |p, index| %>
|
93
|
+
<%- # slot should be in 1..31 -%>
|
94
|
+
<% break if index > 30 %>
|
95
|
+
<filesystem type='mount' accessmode='<%= p[:accessmode] %>'>
|
96
|
+
<source dir='<%= p[:hostpath] %>'/>
|
97
|
+
<target dir='<%= p[:mount_tag] %>'/>
|
98
|
+
<%- # WARN: bus 0x01 is reserved in vm_definition.rb:inject_nics() -%>
|
99
|
+
<address type='pci' domain='0x0000' bus='0x02' slot='<%= "0x%02x"%(1 + index) %>' function='0x0' />
|
100
|
+
</filesystem>
|
101
|
+
<% end %>
|
102
|
+
<% end %>
|
103
|
+
<% if virtio_rng %>
|
104
|
+
<rng model='virtio'>
|
105
|
+
<rate period="2000" bytes="1234"/>
|
106
|
+
<backend model='random'>/dev/random</backend>
|
107
|
+
</rng>
|
108
|
+
<% end %>
|
83
109
|
</devices>
|
84
110
|
</domain>
|
data/vagrant-kvm.gemspec
CHANGED
@@ -7,15 +7,15 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Alex Drahon", "Hiroshi Miura"]
|
9
9
|
s.email = "adrahon@gmail.com"
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://github.com/adrahon/vagrant-kvm"
|
11
11
|
s.summary = "Enables Vagrant to use KVM instead of VirtualBox."
|
12
|
-
s.description = "
|
12
|
+
s.description = "A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant to control and provision KVM/QEMU VM."
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
15
|
s.required_rubygems_version = ">= 1.3.6"
|
16
16
|
s.requirements << 'KVM/QEMU, v1.1.0 or greater'
|
17
17
|
|
18
|
-
s.add_runtime_dependency "ruby-libvirt", "~> 0.
|
18
|
+
s.add_runtime_dependency "ruby-libvirt", "~> 0.5", ">= 0.5.2"
|
19
19
|
|
20
20
|
s.add_development_dependency "pry"
|
21
21
|
s.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-kvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Drahon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-libvirt
|
@@ -17,14 +17,20 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: '0.5'
|
21
|
+
- - '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.5.2
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
28
|
- - ~>
|
26
29
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
30
|
+
version: '0.5'
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.2
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: pry
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,9 +101,11 @@ dependencies:
|
|
95
101
|
- - ~>
|
96
102
|
- !ruby/object:Gem::Version
|
97
103
|
version: 2.12.1
|
98
|
-
description:
|
104
|
+
description: A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant
|
105
|
+
to control and provision KVM/QEMU VM.
|
99
106
|
email: adrahon@gmail.com
|
100
|
-
executables:
|
107
|
+
executables:
|
108
|
+
- package.sh
|
101
109
|
extensions: []
|
102
110
|
extra_rdoc_files: []
|
103
111
|
files:
|
@@ -121,12 +129,14 @@ files:
|
|
121
129
|
- templates/libvirt_network.erb
|
122
130
|
- templates/package_Vagrantfile.erb
|
123
131
|
- templates/libvirt_domain.erb
|
132
|
+
- bin/package.sh
|
124
133
|
- example_box/metadata.json
|
125
134
|
- example_box/box.xml
|
126
135
|
- example_box/README.md
|
127
136
|
- CHANGELOG.md
|
128
137
|
- locales/en.yml
|
129
138
|
- locales/ja.yml
|
139
|
+
- lib/vagrant-kvm/cap/mount_p9.rb
|
130
140
|
- lib/vagrant-kvm/version.rb
|
131
141
|
- lib/vagrant-kvm/util/disk_info.rb
|
132
142
|
- lib/vagrant-kvm/util/commands.rb
|
@@ -137,7 +147,6 @@ files:
|
|
137
147
|
- lib/vagrant-kvm/plugin.rb
|
138
148
|
- lib/vagrant-kvm/action.rb
|
139
149
|
- lib/vagrant-kvm/action/resume_network.rb
|
140
|
-
- lib/vagrant-kvm/action/prepare_gui.rb
|
141
150
|
- lib/vagrant-kvm/action/package.rb
|
142
151
|
- lib/vagrant-kvm/action/prepare_nfs_valid_ids.rb
|
143
152
|
- lib/vagrant-kvm/action/match_mac_address.rb
|
@@ -153,7 +162,6 @@ files:
|
|
153
162
|
- lib/vagrant-kvm/action/init_storage_pool.rb
|
154
163
|
- lib/vagrant-kvm/action/message_not_running.rb
|
155
164
|
- lib/vagrant-kvm/action/is_paused.rb
|
156
|
-
- lib/vagrant-kvm/action/prune_nfs_exports.rb
|
157
165
|
- lib/vagrant-kvm/action/created.rb
|
158
166
|
- lib/vagrant-kvm/action/network.rb
|
159
167
|
- lib/vagrant-kvm/action/setup_package_files.rb
|
@@ -165,25 +173,29 @@ files:
|
|
165
173
|
- lib/vagrant-kvm/action/export.rb
|
166
174
|
- lib/vagrant-kvm/action/destroy_confirm.rb
|
167
175
|
- lib/vagrant-kvm/action/forward_ports.rb
|
176
|
+
- lib/vagrant-kvm/action/prepare_kvmconfig.rb
|
168
177
|
- lib/vagrant-kvm/action/check_running.rb
|
169
178
|
- lib/vagrant-kvm/action/check_kvm.rb
|
170
179
|
- lib/vagrant-kvm/action/is_saved.rb
|
171
180
|
- lib/vagrant-kvm/action/is_running.rb
|
172
181
|
- lib/vagrant-kvm/action/message_not_created.rb
|
173
182
|
- lib/vagrant-kvm/action/boot.rb
|
183
|
+
- lib/vagrant-kvm/action/customize.rb
|
174
184
|
- lib/vagrant-kvm/config.rb
|
175
185
|
- lib/vagrant-kvm/util.rb
|
176
186
|
- lib/vagrant-kvm/provider.rb
|
187
|
+
- lib/vagrant-kvm/synced_folder.rb
|
177
188
|
- lib/vagrant-kvm/errors.rb
|
178
189
|
- lib/vagrant-kvm/driver/driver.rb
|
179
190
|
- lib/vagrant-kvm.rb
|
180
191
|
- LICENSE
|
181
192
|
- Rakefile
|
182
193
|
- README.md
|
194
|
+
- install.rb
|
183
195
|
- .travis.yml
|
184
196
|
- .rspec
|
185
197
|
- .gitignore
|
186
|
-
homepage:
|
198
|
+
homepage: https://github.com/adrahon/vagrant-kvm
|
187
199
|
licenses:
|
188
200
|
- MIT
|
189
201
|
metadata: {}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module VagrantPlugins
|
2
|
-
module ProviderKvm
|
3
|
-
module Action
|
4
|
-
class PruneNFSExports
|
5
|
-
def initialize(app, env)
|
6
|
-
@app = app
|
7
|
-
end
|
8
|
-
|
9
|
-
def call(env)
|
10
|
-
if env[:host]
|
11
|
-
uuid = env[:machine].provider.driver.uuid
|
12
|
-
env[:host].nfs_prune(uuid)
|
13
|
-
end
|
14
|
-
|
15
|
-
@app.call(env)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|