vagrant-libvirt 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/vagrant-libvirt/action/create_domain.rb +24 -18
- data/lib/vagrant-libvirt/config.rb +10 -2
- data/lib/vagrant-libvirt/plugin.rb +3 -3
- data/lib/vagrant-libvirt/templates/domain.xml.erb +6 -4
- data/lib/vagrant-libvirt/templates/private_network.xml.erb +2 -2
- data/lib/vagrant-libvirt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 163bfaa2d6099827892e25c54b696ae99be739a4
|
4
|
+
data.tar.gz: fa6669dc8ad9ffbfa81bd36d04ed07b886a77964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9c79db505309da293ae7919bf843ef4650b620a45cffa1a3dd81952d13569b7a2d2dbcc77d771fdc5d50fdf557364316518254c905b276cc5f098faa66c0d6
|
7
|
+
data.tar.gz: 8db3d0bea7fc78083c403b78ff1b7b20bb22cefdd90ef31ce3fe4757082e16c2a144a237b4fa13a563ff804ce5f85192084252baa1278aa461b4a41b3df14cac
|
data/README.md
CHANGED
@@ -152,8 +152,9 @@ end
|
|
152
152
|
* `random_hostname` - To create a domain name with extra information on the end to prevent hostname conflicts.
|
153
153
|
* `cmd_line` - Arguments passed on to the guest kernel initramfs or initrd to use. Equivalent to qemu `-append`.
|
154
154
|
* `graphics_type` - Sets the protocol used to expose the guest display. Defaults to `vnc`. Possible values are "sdl", "curses", "none", "gtk", or "vnc".
|
155
|
-
* `graphics_port` - Sets the port for the display protocol to bind to. Defaults to 5900.
|
155
|
+
* `graphics_port` - Sets the port for the display protocol to bind to. Defaults to 5900.
|
156
156
|
* `graphics_ip` - Sets the IP for the display protocol to bind to. Defaults to "127.0.0.0.1".
|
157
|
+
* `graphics_passwd` - Sets the password for the display protocol. Working for vnc and spice. by default working without passsword.
|
157
158
|
* `video_type` - Sets the graphics card type exposed to the guest. Defaults to "cirrus". Possible values are "cirrus", "std", "vmware", "qxl", "tcx", "cg3", or "none".
|
158
159
|
* `video_vram` - Used by some graphics card types to vary the amount of RAM dedicated to video. Defaults to 9216.
|
159
160
|
|
@@ -8,7 +8,7 @@ module VagrantPlugins
|
|
8
8
|
include VagrantPlugins::ProviderLibvirt::Util::ErbTemplate
|
9
9
|
|
10
10
|
def initialize(app, env)
|
11
|
-
@logger = Log4r::Logger.new(
|
11
|
+
@logger = Log4r::Logger.new('vagrant_libvirt::action::create_domain')
|
12
12
|
@app = app
|
13
13
|
end
|
14
14
|
|
@@ -39,6 +39,11 @@ module VagrantPlugins
|
|
39
39
|
@graphics_autoport = config.graphics_autoport
|
40
40
|
@graphics_port = config.graphics_port
|
41
41
|
@graphics_ip = config.graphics_ip
|
42
|
+
@graphics_passwd = if config.graphics_passwd.to_s.empty?
|
43
|
+
''
|
44
|
+
else
|
45
|
+
"passwd='#{config.graphics_passwd.to_s}'"
|
46
|
+
end
|
42
47
|
@video_type = config.video_type
|
43
48
|
@video_vram = config.video_vram
|
44
49
|
|
@@ -54,7 +59,7 @@ module VagrantPlugins
|
|
54
59
|
# Get path to domain image.
|
55
60
|
domain_volume = ProviderLibvirt::Util::Collection.find_matching(
|
56
61
|
env[:libvirt_compute].volumes.all, "#{@name}.img")
|
57
|
-
raise Errors::DomainVolumeExists if domain_volume
|
62
|
+
raise Errors::DomainVolumeExists if domain_volume.nil?
|
58
63
|
@domain_volume_path = domain_volume.path
|
59
64
|
|
60
65
|
# the default storage prefix is typically: /var/lib/libvirt/images/
|
@@ -84,22 +89,23 @@ module VagrantPlugins
|
|
84
89
|
end
|
85
90
|
|
86
91
|
# Output the settings we're going to use to the user
|
87
|
-
env[:ui].info(I18n.t(
|
88
|
-
env[:ui].info(" -- Name:
|
89
|
-
env[:ui].info(" -- Domain type:
|
90
|
-
env[:ui].info(" -- Cpus:
|
91
|
-
env[:ui].info(" -- Memory:
|
92
|
-
env[:ui].info(" -- Base box:
|
93
|
-
env[:ui].info(" -- Storage pool:
|
94
|
-
env[:ui].info(" -- Image:
|
95
|
-
env[:ui].info(" -- Volume Cache:
|
96
|
-
env[:ui].info(" -- Kernel:
|
97
|
-
env[:ui].info(" -- Initrd:
|
98
|
-
env[:ui].info(" -- Graphics Type:
|
99
|
-
env[:ui].info(" -- Graphics Port:
|
100
|
-
env[:ui].info(" -- Graphics IP:
|
101
|
-
env[:ui].info(" --
|
102
|
-
env[:ui].info(" -- Video
|
92
|
+
env[:ui].info(I18n.t('vagrant_libvirt.creating_domain'))
|
93
|
+
env[:ui].info(" -- Name: #{@name}")
|
94
|
+
env[:ui].info(" -- Domain type: #{@domain_type}")
|
95
|
+
env[:ui].info(" -- Cpus: #{@cpus}")
|
96
|
+
env[:ui].info(" -- Memory: #{@memory_size/1024}M")
|
97
|
+
env[:ui].info(" -- Base box: #{env[:machine].box.name}")
|
98
|
+
env[:ui].info(" -- Storage pool: #{@storage_pool_name}")
|
99
|
+
env[:ui].info(" -- Image: #{@domain_volume_path}")
|
100
|
+
env[:ui].info(" -- Volume Cache: #{@domain_volume_cache}")
|
101
|
+
env[:ui].info(" -- Kernel: #{@kernel}")
|
102
|
+
env[:ui].info(" -- Initrd: #{@initrd}")
|
103
|
+
env[:ui].info(" -- Graphics Type: #{@graphics_type}")
|
104
|
+
env[:ui].info(" -- Graphics Port: #{@graphics_port}")
|
105
|
+
env[:ui].info(" -- Graphics IP: #{@graphics_ip}")
|
106
|
+
env[:ui].info(" -- Graphics Password: #{@graphics_passwd.empty? ? 'Not defined': 'Defined'}")
|
107
|
+
env[:ui].info(" -- Video Type: #{@video_type}")
|
108
|
+
env[:ui].info(" -- Video VRAM: #{@video_vram}")
|
103
109
|
|
104
110
|
if @disks.length > 0
|
105
111
|
env[:ui].info(" -- Disks: #{_disks_print(@disks)}")
|
@@ -23,7 +23,7 @@ module VagrantPlugins
|
|
23
23
|
attr_accessor :host
|
24
24
|
|
25
25
|
# If use ssh tunnel to connect to Libvirt.
|
26
|
-
attr_accessor :connect_via_ssh
|
26
|
+
attr_accessor :connect_via_ssh
|
27
27
|
# Path towards the libvirt socket
|
28
28
|
attr_accessor :socket
|
29
29
|
|
@@ -65,6 +65,7 @@ module VagrantPlugins
|
|
65
65
|
attr_accessor :graphics_type
|
66
66
|
attr_accessor :graphics_autoport
|
67
67
|
attr_accessor :graphics_port
|
68
|
+
attr_accessor :graphics_passwd
|
68
69
|
attr_accessor :graphics_ip
|
69
70
|
attr_accessor :video_type
|
70
71
|
attr_accessor :video_vram
|
@@ -101,6 +102,7 @@ module VagrantPlugins
|
|
101
102
|
@graphics_autoport = UNSET_VALUE
|
102
103
|
@graphics_port = UNSET_VALUE
|
103
104
|
@graphics_ip = UNSET_VALUE
|
105
|
+
@graphics_passwd = UNSET_VALUE
|
104
106
|
@video_type = UNSET_VALUE
|
105
107
|
@video_vram = UNSET_VALUE
|
106
108
|
|
@@ -132,6 +134,8 @@ module VagrantPlugins
|
|
132
134
|
}.merge(options)
|
133
135
|
|
134
136
|
#puts "storage(#{storage_type} --- #{options.to_s})"
|
137
|
+
require 'pry'
|
138
|
+
binding.pry
|
135
139
|
@disks = [] if @disks == UNSET_VALUE
|
136
140
|
|
137
141
|
disk = {
|
@@ -205,7 +209,7 @@ module VagrantPlugins
|
|
205
209
|
@random_hostname = false if @random_hostname == UNSET_VALUE
|
206
210
|
@management_network_name = 'vagrant-libvirt' if @management_network_name == UNSET_VALUE
|
207
211
|
@management_network_address = '192.168.121.0/24' if @management_network_address == UNSET_VALUE
|
208
|
-
@management_network_mode = 'nat' if @
|
212
|
+
@management_network_mode = 'nat' if @management_network_mode == UNSET_VALUE
|
209
213
|
|
210
214
|
# generate a URI if none is supplied
|
211
215
|
@uri = _generate_uri() if @uri == UNSET_VALUE
|
@@ -224,6 +228,10 @@ module VagrantPlugins
|
|
224
228
|
@graphics_type = 'vnc' if @graphics_type == UNSET_VALUE
|
225
229
|
@graphics_autoport = 'yes' if @graphics_port == UNSET_VALUE
|
226
230
|
@graphics_autoport = 'no' if @graphics_port != UNSET_VALUE
|
231
|
+
if (@graphics_type != 'vnc' && @graphics_port != 'spice') ||
|
232
|
+
@graphics_passwd == UNSET_VALUE
|
233
|
+
@graphics_passwd = nil
|
234
|
+
end
|
227
235
|
@graphics_port = 5900 if @graphics_port == UNSET_VALUE
|
228
236
|
@graphics_ip = '127.0.0.1' if @graphics_ip == UNSET_VALUE
|
229
237
|
@video_type = 'cirrus' if @video_type == UNSET_VALUE
|
@@ -31,9 +31,9 @@ module VagrantPlugins
|
|
31
31
|
require_relative 'provider'
|
32
32
|
Provider
|
33
33
|
end
|
34
|
-
|
35
|
-
guest_capability(
|
36
|
-
require_relative
|
34
|
+
|
35
|
+
guest_capability('linux', 'mount_p9_shared_folder') do
|
36
|
+
require_relative 'cap/mount_p9'
|
37
37
|
Cap::MountP9
|
38
38
|
end
|
39
39
|
|
@@ -51,9 +51,11 @@
|
|
51
51
|
<target port='0'/>
|
52
52
|
</console>
|
53
53
|
<input type='mouse' bus='ps2'/>
|
54
|
-
|
55
|
-
<
|
56
|
-
|
57
|
-
|
54
|
+
<%# Video device -%>
|
55
|
+
<graphics type='<%= @graphics_type %>' port='<%= @graphics_port %>' autoport='<%= @graphics_autoport %>' listen='<%= @graphics_ip %>' keymap='en-us' <%= @graphics_passwd%> />
|
56
|
+
<video>
|
57
|
+
<model type='<%= @video_type %>' vram='<%= @video_vram %>' heads='1'/>
|
58
|
+
</video>
|
59
|
+
<%#End Video -%>
|
58
60
|
</devices>
|
59
61
|
</domain>
|
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
<% if @network_forward_mode != 'none' %>
|
6
6
|
<% if @network_forward_device %>
|
7
|
-
|
7
|
+
<forward mode="<%= @network_forward_mode %>" dev="<%= @network_forward_device %>" />
|
8
8
|
<% else %>
|
9
|
-
|
9
|
+
<forward mode="<%= @network_forward_mode %>" />
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
12
12
|
|
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.23
|
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: 2014-
|
13
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec-core
|