libvirt_ffi 0.8.0 → 0.8.1
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/.github/workflows/tests.yml +26 -0
- data/.gitignore +2 -1
- data/.rspec +1 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +7 -10
- data/README.md +2 -2
- data/Rakefile +3 -8
- data/lib/libvirt/connection.rb +75 -77
- data/lib/libvirt/ffi/host.rb +78 -39
- data/lib/libvirt/loggable.rb +58 -0
- data/lib/libvirt/util.rb +87 -64
- data/lib/libvirt/version.rb +1 -1
- data/lib/libvirt/xml/generic.rb +2 -2
- data/lib/libvirt/xml.rb +6 -5
- data/lib/libvirt.rb +16 -16
- data/libvirt.gemspec +11 -13
- metadata +6 -28
- data/.travis.yml +0 -6
- data/test_usage/support/libvirt_async.rb +0 -536
- data/test_usage/support/log_formatter.rb +0 -33
- data/test_usage/test_domain.rb +0 -43
- data/test_usage/test_event_loop.rb +0 -185
- data/test_usage/test_interface.rb +0 -47
- data/test_usage/test_libvirtd_restart.rb +0 -63
- data/test_usage/test_metadata.rb +0 -104
- data/test_usage/test_network.rb +0 -73
- data/test_usage/test_screenshot.rb +0 -197
- data/test_usage/test_storage.rb +0 -52
data/test_usage/test_storage.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'bundler/setup'
|
5
|
-
require 'libvirt'
|
6
|
-
require 'logger'
|
7
|
-
require 'active_support/all'
|
8
|
-
require 'async'
|
9
|
-
|
10
|
-
require_relative 'support/libvirt_async'
|
11
|
-
require_relative 'support/log_formatter'
|
12
|
-
|
13
|
-
require 'libvirt/xml'
|
14
|
-
|
15
|
-
Libvirt.logger = Logger.new(STDOUT, formatter: LogFormatter.new)
|
16
|
-
Libvirt.logger.level = ENV['DEBUG'] ? :debug : :info
|
17
|
-
|
18
|
-
IMPL = LibvirtAsync::Implementations.new
|
19
|
-
|
20
|
-
Async do
|
21
|
-
ASYNC_REACTOR = Async::Task.current.reactor
|
22
|
-
|
23
|
-
puts "Lib version #{Libvirt.lib_version}"
|
24
|
-
puts "Gem version #{Libvirt::VERSION}"
|
25
|
-
|
26
|
-
IMPL.start
|
27
|
-
|
28
|
-
conn = Libvirt::Connection.new('qemu+tcp://localhost:16510/system')
|
29
|
-
conn.open
|
30
|
-
|
31
|
-
puts "Connection version #{conn.version.inspect}"
|
32
|
-
puts "Connection lib_version #{conn.lib_version.inspect}"
|
33
|
-
puts "Connection hostname #{conn.hostname.inspect}"
|
34
|
-
|
35
|
-
pools = conn.list_all_storage_pools
|
36
|
-
puts "Connection storage pools qty #{pools.size}"
|
37
|
-
|
38
|
-
pools.each.with_index do |pool, i|
|
39
|
-
puts "Storage pool #{i} info", pool.info.to_h
|
40
|
-
puts "Storage pool #{i} xml", Libvirt::Xml::StoragePool.load(pool.xml_desc).to_h
|
41
|
-
end
|
42
|
-
|
43
|
-
pools.each.with_index do |pool, i|
|
44
|
-
volumes = pool.list_all_volumes
|
45
|
-
puts "Storage pool #{i} volumes qty #{volumes.size}"
|
46
|
-
|
47
|
-
volumes.each.with_index do |vol, j|
|
48
|
-
puts "Storage pool #{i} volume #{j} info", vol.info.to_h
|
49
|
-
puts "Storage pool #{i} volume #{j} xml", Libvirt::Xml::StorageVolume.load(vol.xml_desc).to_h
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|