vagrant-libvirt 0.0.38 → 0.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/vagrant-libvirt/action/create_domain.rb +13 -2
- data/lib/vagrant-libvirt/config.rb +17 -0
- data/lib/vagrant-libvirt/templates/domain.xml.erb +9 -1
- data/lib/vagrant-libvirt/version.rb +1 -1
- data/spec/unit/templates/domain_all_settings.xml +6 -1
- data/spec/unit/templates/domain_defaults.xml +2 -1
- data/spec/unit/templates/domain_spec.rb +3 -0
- data/vagrant-libvirt.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cef6e96e357a1191f1b10a513d7a58154f6ed60
|
4
|
+
data.tar.gz: 8829ceb3cb02ff4034a7a04db4bdff058a30c500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec1a305e16d78c78cca37084ff07cf0f840ad5c502530ef255e63894f9178c48a34a9f544e125694358bbb870a5ed3e4e67d287187823400b1e8a84ac59392c9
|
7
|
+
data.tar.gz: c8226c363be4311b61d0b9d1cbcf14ff08e6776790e4a016824fb727dc6db05b39588163bd5e99b0904ee11bdbd7f2dcc738f279af25738a702cdfb9a8282728
|
data/README.md
CHANGED
@@ -1220,6 +1220,20 @@ Vagrant.configure(2) do |config|
|
|
1220
1220
|
end
|
1221
1221
|
```
|
1222
1222
|
|
1223
|
+
## Custom command line arguments
|
1224
|
+
You can also specify multiple qemuargs arguments for qemu-system
|
1225
|
+
|
1226
|
+
* `value` - Value
|
1227
|
+
|
1228
|
+
```ruby
|
1229
|
+
Vagrant.configure("2") do |config|
|
1230
|
+
config.vm.provider :libvirt do |libvirt|
|
1231
|
+
libvirt.qemuargs :value => "-device"
|
1232
|
+
libvirt.qemuargs :value => "intel-iommu"
|
1233
|
+
end
|
1234
|
+
end
|
1235
|
+
```
|
1236
|
+
|
1223
1237
|
## Box Format
|
1224
1238
|
|
1225
1239
|
You can view an example box in the
|
@@ -88,9 +88,9 @@ module VagrantPlugins
|
|
88
88
|
|
89
89
|
# PCI device passthrough
|
90
90
|
@pcis = config.pcis
|
91
|
-
|
91
|
+
|
92
92
|
# Watchdog device
|
93
|
-
@watchdog_dev = config.watchdog_dev
|
93
|
+
@watchdog_dev = config.watchdog_dev
|
94
94
|
|
95
95
|
# USB device passthrough
|
96
96
|
@usbs = config.usbs
|
@@ -102,6 +102,9 @@ module VagrantPlugins
|
|
102
102
|
# smartcard device
|
103
103
|
@smartcard_dev = config.smartcard_dev
|
104
104
|
|
105
|
+
# qemuargs
|
106
|
+
@qemuargs = config.qemuargs
|
107
|
+
|
105
108
|
# RNG device passthrough
|
106
109
|
@rng = config.rng
|
107
110
|
|
@@ -280,6 +283,14 @@ module VagrantPlugins
|
|
280
283
|
env[:ui].info(" -- smartcard device: mode=#{@smartcard_dev[:mode]}, type=#{@smartcard_dev[:type]}")
|
281
284
|
end
|
282
285
|
|
286
|
+
unless @qemuargs.empty?
|
287
|
+
env[:ui].info(' -- Command line args: ')
|
288
|
+
@qemuargs.each do |arg|
|
289
|
+
msg = " -> value=#{arg[:value]}, "
|
290
|
+
env[:ui].info(msg)
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
283
294
|
env[:ui].info(" -- Command line : #{@cmd_line}")
|
284
295
|
|
285
296
|
# Create libvirt domain.
|
@@ -141,6 +141,9 @@ module VagrantPlugins
|
|
141
141
|
# Attach mgmt network
|
142
142
|
attr_accessor :mgmt_attach
|
143
143
|
|
144
|
+
# Additional qemuargs arguments
|
145
|
+
attr_accessor :qemuargs
|
146
|
+
|
144
147
|
def initialize
|
145
148
|
@uri = UNSET_VALUE
|
146
149
|
@driver = UNSET_VALUE
|
@@ -238,6 +241,8 @@ module VagrantPlugins
|
|
238
241
|
|
239
242
|
# Attach mgmt network
|
240
243
|
@mgmt_attach = UNSET_VALUE
|
244
|
+
|
245
|
+
@qemuargs = UNSET_VALUE
|
241
246
|
end
|
242
247
|
|
243
248
|
def boot(device)
|
@@ -489,6 +494,11 @@ module VagrantPlugins
|
|
489
494
|
@disks << disk # append
|
490
495
|
end
|
491
496
|
|
497
|
+
def qemuargs(options = {})
|
498
|
+
@qemuargs = [] if @qemuargs == UNSET_VALUE
|
499
|
+
@qemuargs.push(value: options[:value])
|
500
|
+
end
|
501
|
+
|
492
502
|
# code to generate URI from a config moved out of the connect action
|
493
503
|
def _generate_uri
|
494
504
|
# builds the libvirt connection URI from the given driver config
|
@@ -651,6 +661,8 @@ module VagrantPlugins
|
|
651
661
|
|
652
662
|
# Attach mgmt network
|
653
663
|
@mgmt_attach = true if @mgmt_attach == UNSET_VALUE
|
664
|
+
|
665
|
+
@qemuargs = [] if @qemuargs == UNSET_VALUE
|
654
666
|
end
|
655
667
|
|
656
668
|
def validate(machine)
|
@@ -676,9 +688,14 @@ module VagrantPlugins
|
|
676
688
|
c = disks.dup
|
677
689
|
c += other.disks
|
678
690
|
result.disks = c
|
691
|
+
|
679
692
|
c = cdroms.dup
|
680
693
|
c += other.cdroms
|
681
694
|
result.cdroms = c
|
695
|
+
|
696
|
+
c = qemuargs.dup
|
697
|
+
c += other.qemuargs
|
698
|
+
result.qemuargs = c
|
682
699
|
end
|
683
700
|
end
|
684
701
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<domain type='<%= @domain_type %>'>
|
1
|
+
<domain type='<%= @domain_type %>' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
2
2
|
<name><%= @name %></name>
|
3
3
|
<uuid><%= @uuid %></uuid>
|
4
4
|
<memory><%= @memory_size %></memory>
|
@@ -218,4 +218,12 @@
|
|
218
218
|
</tpm>
|
219
219
|
<% end -%>
|
220
220
|
</devices>
|
221
|
+
|
222
|
+
<% unless @qemuargs.empty? %>
|
223
|
+
<qemu:commandline>
|
224
|
+
<% @qemuargs.each do |arg| %>
|
225
|
+
<qemu:arg value='<%= arg[:value] %>'/>
|
226
|
+
<% end %>
|
227
|
+
</qemu:commandline>
|
228
|
+
<% end %>
|
221
229
|
</domain>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<domain type='kvm'>
|
1
|
+
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
2
2
|
<name></name>
|
3
3
|
<uuid></uuid>
|
4
4
|
<memory></memory>
|
@@ -125,4 +125,9 @@
|
|
125
125
|
</backend>
|
126
126
|
</tpm>
|
127
127
|
</devices>
|
128
|
+
|
129
|
+
<qemu:commandline>
|
130
|
+
<qemu:arg value='-device'/>
|
131
|
+
<qemu:arg value='dummy-device'/>
|
132
|
+
</qemu:commandline>
|
128
133
|
</domain>
|
@@ -62,6 +62,9 @@ describe 'templates/domain' do
|
|
62
62
|
domain.watchdog(model: 'i6300esb', action: 'reset')
|
63
63
|
domain.smartcard(mode: 'passthrough')
|
64
64
|
domain.tpm_path = '/dev/tpm0'
|
65
|
+
|
66
|
+
domain.qemuargs(value: '-device')
|
67
|
+
domain.qemuargs(value: 'dummy-device')
|
65
68
|
end
|
66
69
|
let(:test_file) { 'domain_all_settings.xml' }
|
67
70
|
it 'renders template' do
|
data/vagrant-libvirt.gemspec
CHANGED
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.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-04-
|
13
|
+
date: 2017-04-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-core
|
@@ -82,6 +82,20 @@ dependencies:
|
|
82
82
|
- - "~>"
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: 1.6.0
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: fog-core
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 1.43.0
|
92
|
+
type: :runtime
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 1.43.0
|
85
99
|
- !ruby/object:Gem::Dependency
|
86
100
|
name: rake
|
87
101
|
requirement: !ruby/object:Gem::Requirement
|