vagrant-kvm 0.1.0

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.
Files changed (52) hide show
  1. data/.gitignore +14 -0
  2. data/CHANGELOG.md +3 -0
  3. data/Gemfile +10 -0
  4. data/LICENSE +8 -0
  5. data/README.md +90 -0
  6. data/Rakefile +15 -0
  7. data/example_box/README.md +18 -0
  8. data/example_box/box.xml +78 -0
  9. data/example_box/metadata.json +3 -0
  10. data/lib/vagrant-kvm.rb +20 -0
  11. data/lib/vagrant-kvm/action.rb +268 -0
  12. data/lib/vagrant-kvm/action/boot.rb +22 -0
  13. data/lib/vagrant-kvm/action/check_box.rb +36 -0
  14. data/lib/vagrant-kvm/action/check_created.rb +21 -0
  15. data/lib/vagrant-kvm/action/check_kvm.rb +23 -0
  16. data/lib/vagrant-kvm/action/check_running.rb +21 -0
  17. data/lib/vagrant-kvm/action/created.rb +20 -0
  18. data/lib/vagrant-kvm/action/destroy.rb +19 -0
  19. data/lib/vagrant-kvm/action/destroy_confirm.rb +17 -0
  20. data/lib/vagrant-kvm/action/export.rb +57 -0
  21. data/lib/vagrant-kvm/action/forced_halt.rb +21 -0
  22. data/lib/vagrant-kvm/action/import.rb +54 -0
  23. data/lib/vagrant-kvm/action/init_storage_pool.rb +19 -0
  24. data/lib/vagrant-kvm/action/is_paused.rb +20 -0
  25. data/lib/vagrant-kvm/action/is_running.rb +20 -0
  26. data/lib/vagrant-kvm/action/is_saved.rb +20 -0
  27. data/lib/vagrant-kvm/action/match_mac_address.rb +21 -0
  28. data/lib/vagrant-kvm/action/message_not_created.rb +16 -0
  29. data/lib/vagrant-kvm/action/message_will_not_destroy.rb +17 -0
  30. data/lib/vagrant-kvm/action/network.rb +69 -0
  31. data/lib/vagrant-kvm/action/package.rb +20 -0
  32. data/lib/vagrant-kvm/action/package_vagrantfile.rb +31 -0
  33. data/lib/vagrant-kvm/action/prepare_nfs_settings.rb +61 -0
  34. data/lib/vagrant-kvm/action/prune_nfs_exports.rb +20 -0
  35. data/lib/vagrant-kvm/action/resume.rb +25 -0
  36. data/lib/vagrant-kvm/action/setup_package_files.rb +51 -0
  37. data/lib/vagrant-kvm/action/share_folders.rb +76 -0
  38. data/lib/vagrant-kvm/action/suspend.rb +20 -0
  39. data/lib/vagrant-kvm/config.rb +31 -0
  40. data/lib/vagrant-kvm/driver/driver.rb +271 -0
  41. data/lib/vagrant-kvm/errors.rb +11 -0
  42. data/lib/vagrant-kvm/plugin.rb +73 -0
  43. data/lib/vagrant-kvm/provider.rb +104 -0
  44. data/lib/vagrant-kvm/util.rb +12 -0
  45. data/lib/vagrant-kvm/util/kvm_template_renderer.rb +20 -0
  46. data/lib/vagrant-kvm/util/network_definition.rb +106 -0
  47. data/lib/vagrant-kvm/util/vm_definition.rb +192 -0
  48. data/lib/vagrant-kvm/version.rb +5 -0
  49. data/locales/en.yml +4 -0
  50. data/templates/libvirt_domain.erb +64 -0
  51. data/vagrant-kvm.gemspec +58 -0
  52. metadata +191 -0
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module ProviderKvm
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ en:
2
+ vagrant_kvm:
3
+ test_message: |-
4
+ This is a test message.
@@ -0,0 +1,64 @@
1
+ <domain type='kvm'>
2
+ <name><%= name %></name>
3
+ <% if uuid %>
4
+ <uuid><%= uuid %></uuid>
5
+ <% end %>
6
+ <memory unit='KiB'><%= memory %></memory>
7
+ <currentMemory unit='KiB'><%= memory%></currentMemory>
8
+ <vcpu placement='static'><%= cpus %></vcpu>
9
+ <os>
10
+ <type arch='<%= arch %>' machine='pc-1.2'>hvm</type>
11
+ <boot dev='hd'/>
12
+ </os>
13
+ <features>
14
+ <acpi/>
15
+ <apic/>
16
+ <pae/>
17
+ </features>
18
+ <clock offset='utc'/>
19
+ <on_poweroff>destroy</on_poweroff>
20
+ <on_reboot>restart</on_reboot>
21
+ <on_crash>restart</on_crash>
22
+ <devices>
23
+ <emulator>/usr/bin/qemu-kvm</emulator>
24
+ <disk type='file' device='disk'>
25
+ <driver name='qemu' type='raw'/>
26
+ <source file='<%= disk %>'/>
27
+ <target dev='vda' bus='virtio'/>
28
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
29
+ </disk>
30
+ <controller type='usb' index='0'>
31
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
32
+ </controller>
33
+ <controller type='virtio-serial' index='0'>
34
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
35
+ </controller>
36
+ <interface type='network'>
37
+ <mac address='<%= mac %>'/>
38
+ <source network='vagrant'/>
39
+ <model type='virtio'/>
40
+ </interface>
41
+ <serial type='pty'>
42
+ <target port='0'/>
43
+ </serial>
44
+ <console type='pty'>
45
+ <target type='serial' port='0'/>
46
+ </console>
47
+ <channel type='spicevmc'>
48
+ <target type='virtio' name='com.redhat.spice.0'/>
49
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
50
+ </channel>
51
+ <input type='mouse' bus='ps2'/>
52
+ <graphics type='spice' autoport='yes'/>
53
+ <sound model='ich6'>
54
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
55
+ </sound>
56
+ <video>
57
+ <model type='cirrus' vram='9216' heads='1'/>
58
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
59
+ </video>
60
+ <memballoon model='virtio'>
61
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
62
+ </memballoon>
63
+ </devices>
64
+ </domain>
@@ -0,0 +1,58 @@
1
+ $:.unshift File.expand_path("../lib", __FILE__)
2
+ require "vagrant-kvm/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "vagrant-kvm"
6
+ s.version = VagrantPlugins::ProviderKvm::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = "Alex Drahon"
9
+ s.email = "adrahon@gmail.com"
10
+ s.homepage = "http://www.vagrantup.com"
11
+ s.summary = "Enables Vagrant to use KVM instead of VirtualBox."
12
+ s.description = "Enables Vagrant to use KVM instead of VirtualBox."
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+
16
+ s.add_runtime_dependency "nokogiri", "~> 1.5.6"
17
+ s.add_runtime_dependency "ruby-libvirt", "~> 0.4.0"
18
+
19
+ s.add_development_dependency "rake"
20
+ s.add_development_dependency "rspec-core", "~> 2.12.2"
21
+ s.add_development_dependency "rspec-expectations", "~> 2.12.1"
22
+ s.add_development_dependency "rspec-mocks", "~> 2.12.1"
23
+
24
+ # The following block of code determines the files that should be included
25
+ # in the gem. It does this by reading all the files in the directory where
26
+ # this gemspec is, and parsing out the ignored files from the gitignore.
27
+ # Note that the entire gitignore(5) syntax is not supported, specifically
28
+ # the "!" syntax, but it should mostly work correctly.
29
+ root_path = File.dirname(__FILE__)
30
+ all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
31
+ all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
32
+ gitignore_path = File.join(root_path, ".gitignore")
33
+ gitignore = File.readlines(gitignore_path)
34
+ gitignore.map! { |line| line.chomp.strip }
35
+ gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
36
+
37
+ unignored_files = all_files.reject do |file|
38
+ # Ignore any directories, the gemspec only cares about files
39
+ next true if File.directory?(file)
40
+
41
+ # Ignore any paths that match anything in the gitignore. We do
42
+ # two tests here:
43
+ #
44
+ # - First, test to see if the entire path matches the gitignore.
45
+ # - Second, match if the basename does, this makes it so that things
46
+ # like '.DS_Store' will match sub-directories too (same behavior
47
+ # as git).
48
+ #
49
+ gitignore.any? do |ignore|
50
+ File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
51
+ File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
52
+ end
53
+ end
54
+
55
+ s.files = unignored_files
56
+ s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
57
+ s.require_path = 'lib'
58
+ end
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-kvm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alex Drahon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nokogiri
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.5.6
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.5.6
30
+ - !ruby/object:Gem::Dependency
31
+ name: ruby-libvirt
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.4.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec-core
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 2.12.2
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.12.2
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-expectations
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.12.1
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.12.1
94
+ - !ruby/object:Gem::Dependency
95
+ name: rspec-mocks
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 2.12.1
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 2.12.1
110
+ description: Enables Vagrant to use KVM instead of VirtualBox.
111
+ email: adrahon@gmail.com
112
+ executables: []
113
+ extensions: []
114
+ extra_rdoc_files: []
115
+ files:
116
+ - vagrant-kvm.gemspec
117
+ - Gemfile
118
+ - templates/libvirt_domain.erb
119
+ - example_box/metadata.json
120
+ - example_box/box.xml
121
+ - example_box/README.md
122
+ - CHANGELOG.md
123
+ - locales/en.yml
124
+ - lib/vagrant-kvm/version.rb
125
+ - lib/vagrant-kvm/util/kvm_template_renderer.rb
126
+ - lib/vagrant-kvm/util/vm_definition.rb
127
+ - lib/vagrant-kvm/util/network_definition.rb
128
+ - lib/vagrant-kvm/plugin.rb
129
+ - lib/vagrant-kvm/action.rb
130
+ - lib/vagrant-kvm/action/package.rb
131
+ - lib/vagrant-kvm/action/match_mac_address.rb
132
+ - lib/vagrant-kvm/action/check_box.rb
133
+ - lib/vagrant-kvm/action/prepare_nfs_settings.rb
134
+ - lib/vagrant-kvm/action/package_vagrantfile.rb
135
+ - lib/vagrant-kvm/action/resume.rb
136
+ - lib/vagrant-kvm/action/forced_halt.rb
137
+ - lib/vagrant-kvm/action/suspend.rb
138
+ - lib/vagrant-kvm/action/check_created.rb
139
+ - lib/vagrant-kvm/action/share_folders.rb
140
+ - lib/vagrant-kvm/action/init_storage_pool.rb
141
+ - lib/vagrant-kvm/action/is_paused.rb
142
+ - lib/vagrant-kvm/action/prune_nfs_exports.rb
143
+ - lib/vagrant-kvm/action/created.rb
144
+ - lib/vagrant-kvm/action/network.rb
145
+ - lib/vagrant-kvm/action/setup_package_files.rb
146
+ - lib/vagrant-kvm/action/message_will_not_destroy.rb
147
+ - lib/vagrant-kvm/action/destroy.rb
148
+ - lib/vagrant-kvm/action/import.rb
149
+ - lib/vagrant-kvm/action/export.rb
150
+ - lib/vagrant-kvm/action/destroy_confirm.rb
151
+ - lib/vagrant-kvm/action/check_running.rb
152
+ - lib/vagrant-kvm/action/check_kvm.rb
153
+ - lib/vagrant-kvm/action/is_saved.rb
154
+ - lib/vagrant-kvm/action/is_running.rb
155
+ - lib/vagrant-kvm/action/message_not_created.rb
156
+ - lib/vagrant-kvm/action/boot.rb
157
+ - lib/vagrant-kvm/config.rb
158
+ - lib/vagrant-kvm/util.rb
159
+ - lib/vagrant-kvm/provider.rb
160
+ - lib/vagrant-kvm/errors.rb
161
+ - lib/vagrant-kvm/driver/driver.rb
162
+ - lib/vagrant-kvm.rb
163
+ - LICENSE
164
+ - Rakefile
165
+ - README.md
166
+ - .gitignore
167
+ homepage: http://www.vagrantup.com
168
+ licenses: []
169
+ post_install_message:
170
+ rdoc_options: []
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ none: false
175
+ requirements:
176
+ - - ! '>='
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ! '>='
183
+ - !ruby/object:Gem::Version
184
+ version: 1.3.6
185
+ requirements: []
186
+ rubyforge_project:
187
+ rubygems_version: 1.8.25
188
+ signing_key:
189
+ specification_version: 3
190
+ summary: Enables Vagrant to use KVM instead of VirtualBox.
191
+ test_files: []