libvirt 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +36 -0
- data/README.md +83 -0
- data/Rakefile +20 -0
- data/docs/user_guide.md +259 -0
- data/examples/README.md +10 -0
- data/examples/create_domain.rb +46 -0
- data/examples/print_domain_info.rb +46 -0
- data/examples/print_hypervisor_info.rb +40 -0
- data/lib/ffi/libvirt/domain_info.rb +12 -0
- data/lib/ffi/libvirt/error.rb +25 -0
- data/lib/ffi/libvirt/error_functions.rb +21 -0
- data/lib/ffi/libvirt/error_types.rb +125 -0
- data/lib/ffi/libvirt/functions.rb +363 -0
- data/lib/ffi/libvirt/node_info.rb +27 -0
- data/lib/ffi/libvirt/storage_pool_info.rb +11 -0
- data/lib/ffi/libvirt/storage_volume_info.rb +14 -0
- data/lib/ffi/libvirt/types.rb +61 -0
- data/lib/ffi/libvirt/util.rb +19 -0
- data/lib/ffi/libvirt/version.rb +46 -0
- data/lib/ffi/libvirt.rb +29 -0
- data/lib/libvirt/collection/abstract_collection.rb +49 -0
- data/lib/libvirt/collection/domain_collection.rb +98 -0
- data/lib/libvirt/collection/interface_collection.rb +16 -0
- data/lib/libvirt/collection/network_collection.rb +58 -0
- data/lib/libvirt/collection/node_device_collection.rb +29 -0
- data/lib/libvirt/collection/nwfilter_collection.rb +15 -0
- data/lib/libvirt/collection/storage_pool_collection.rb +58 -0
- data/lib/libvirt/collection/storage_volume_collection.rb +57 -0
- data/lib/libvirt/collection.rb +12 -0
- data/lib/libvirt/connection.rb +225 -0
- data/lib/libvirt/domain.rb +241 -0
- data/lib/libvirt/error.rb +91 -0
- data/lib/libvirt/exception.rb +19 -0
- data/lib/libvirt/network.rb +118 -0
- data/lib/libvirt/node.rb +118 -0
- data/lib/libvirt/node_device.rb +75 -0
- data/lib/libvirt/spec/device/disk.rb +58 -0
- data/lib/libvirt/spec/device/emulator.rb +23 -0
- data/lib/libvirt/spec/device.rb +8 -0
- data/lib/libvirt/spec/domain/os_booting.rb +69 -0
- data/lib/libvirt/spec/domain.rb +71 -0
- data/lib/libvirt/spec.rb +12 -0
- data/lib/libvirt/storage_pool.rb +164 -0
- data/lib/libvirt/storage_volume.rb +109 -0
- data/lib/libvirt/version.rb +3 -0
- data/lib/libvirt.rb +53 -0
- data/libvirt.gemspec +27 -0
- data/test/libvirt/collection/abstract_collection_test.rb +14 -0
- data/test/libvirt/collection/domain_collection_test.rb +122 -0
- data/test/libvirt/collection/interface_collection_test.rb +9 -0
- data/test/libvirt/collection/network_collection_test.rb +41 -0
- data/test/libvirt/collection/node_device_collection_test.rb +24 -0
- data/test/libvirt/collection/nwfilter_collection_test.rb +7 -0
- data/test/libvirt/collection/storage_pool_collection_test.rb +41 -0
- data/test/libvirt/collection/storage_volume_collection_test.rb +86 -0
- data/test/libvirt/connection_test.rb +133 -0
- data/test/libvirt/domain_test.rb +221 -0
- data/test/libvirt/error_test.rb +93 -0
- data/test/libvirt/libvirt_test.rb +16 -0
- data/test/libvirt/network_test.rb +76 -0
- data/test/libvirt/node_device_test.rb +16 -0
- data/test/libvirt/node_test.rb +24 -0
- data/test/libvirt/spec/devices/disk_test.rb +107 -0
- data/test/libvirt/spec/devices/emulator_test.rb +20 -0
- data/test/libvirt/spec/domain_test.rb +17 -0
- data/test/libvirt/storage_pool_test.rb +133 -0
- data/test/libvirt/storage_volume_test.rb +63 -0
- data/test/support/xml_assertions.rb +29 -0
- data/test/test_helper.rb +23 -0
- metadata +219 -0
@@ -0,0 +1,125 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# The types for virterror, which is a separate header file than
|
4
|
+
# libvirt.h, so we're separating it in the FFI code to make it
|
5
|
+
# easier to maintain.
|
6
|
+
|
7
|
+
# Pointers to various libvirt structs
|
8
|
+
typedef :pointer, :virErrorPtr
|
9
|
+
|
10
|
+
# Callbacks
|
11
|
+
callback :virErrorFunc, [:void_pointer, :virErrorPtr], :void
|
12
|
+
|
13
|
+
# Enums
|
14
|
+
enum :virErrorLevel, [:none, :warning, :error]
|
15
|
+
enum :virErrorDomain, [:none,
|
16
|
+
:xen,
|
17
|
+
:xend,
|
18
|
+
:xenstore,
|
19
|
+
:sexpr,
|
20
|
+
:xml,
|
21
|
+
:dom,
|
22
|
+
:rpc,
|
23
|
+
:proxy,
|
24
|
+
:conf,
|
25
|
+
:qemu,
|
26
|
+
:net,
|
27
|
+
:test,
|
28
|
+
:remote,
|
29
|
+
:openvz,
|
30
|
+
:xenxm,
|
31
|
+
:stats_linux,
|
32
|
+
:lxc,
|
33
|
+
:storage,
|
34
|
+
:network,
|
35
|
+
:domain,
|
36
|
+
:uml,
|
37
|
+
:nodedev,
|
38
|
+
:xen_inotify,
|
39
|
+
:security,
|
40
|
+
:vbox,
|
41
|
+
:interface,
|
42
|
+
:one,
|
43
|
+
:esx,
|
44
|
+
:phyp,
|
45
|
+
:secret,
|
46
|
+
:cpu,
|
47
|
+
:xenapi,
|
48
|
+
:nwfilter,
|
49
|
+
:hook,
|
50
|
+
:domain_snapshot]
|
51
|
+
|
52
|
+
enum :virErrorNumber, [:ok,
|
53
|
+
:internal_error,
|
54
|
+
:no_memory,
|
55
|
+
:no_support,
|
56
|
+
:unknown_host,
|
57
|
+
:no_connect,
|
58
|
+
:invalid_conn,
|
59
|
+
:invalid_domain,
|
60
|
+
:invalid_arg,
|
61
|
+
:operation_failed,
|
62
|
+
:get_failed,
|
63
|
+
:post_failed,
|
64
|
+
:http_error,
|
65
|
+
:sexpr_serial,
|
66
|
+
:no_xen,
|
67
|
+
:xen_call,
|
68
|
+
:os_type,
|
69
|
+
:no_kernel,
|
70
|
+
:no_root,
|
71
|
+
:no_source,
|
72
|
+
:no_target,
|
73
|
+
:no_name,
|
74
|
+
:no_os,
|
75
|
+
:no_device,
|
76
|
+
:no_xenstore,
|
77
|
+
:driver_full,
|
78
|
+
:call_failed,
|
79
|
+
:xml_error,
|
80
|
+
:dom_exist,
|
81
|
+
:operation_denied,
|
82
|
+
:open_failed,
|
83
|
+
:read_failed,
|
84
|
+
:parse_failed,
|
85
|
+
:conf_syntax,
|
86
|
+
:write_failed,
|
87
|
+
:xml_detail,
|
88
|
+
:invalid_network,
|
89
|
+
:network_exist,
|
90
|
+
:system_error,
|
91
|
+
:rpc,
|
92
|
+
:gnutls_error,
|
93
|
+
:no_network,
|
94
|
+
:invalid_mac,
|
95
|
+
:auth_failed,
|
96
|
+
:invalid_storage_pool,
|
97
|
+
:invalid_storage_vol,
|
98
|
+
:no_storage,
|
99
|
+
:no_storage_pool,
|
100
|
+
:no_storage_vol,
|
101
|
+
:no_node,
|
102
|
+
:invalid_node_device,
|
103
|
+
:no_node_device,
|
104
|
+
:no_security_model,
|
105
|
+
:operation_invalid,
|
106
|
+
:no_interface,
|
107
|
+
:no_interface,
|
108
|
+
:invalid_interface,
|
109
|
+
:multiple_interfaces,
|
110
|
+
:no_nwfilter,
|
111
|
+
:invalid_nwfilter,
|
112
|
+
:no_nwfilter,
|
113
|
+
:build_firewall,
|
114
|
+
:no_secret,
|
115
|
+
:invalid_secret,
|
116
|
+
:no_secret,
|
117
|
+
:config_unsupported,
|
118
|
+
:operation_timeout,
|
119
|
+
:migrate_persist_failed,
|
120
|
+
:hook_script_failed,
|
121
|
+
:invalid_domain_snapshot,
|
122
|
+
:no_domain_snapshot]
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,363 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# Below attached functions in order of appearance in libvirt.h
|
4
|
+
# which allows this file to more easily be maintained.
|
5
|
+
|
6
|
+
attach_function :virInitialize, [], :int
|
7
|
+
|
8
|
+
libvirt_version "0.6.0" do
|
9
|
+
attach_function :virDomainMigrate, [:virDomainPtr, :virConnectPtr, :ulong, :string, :string, :ulong], :virDomainPtr
|
10
|
+
|
11
|
+
# Connection/disconnection to the Hypervisor
|
12
|
+
attach_function :virConnectOpen, [:string], :virConnectPtr
|
13
|
+
attach_function :virConnectOpenReadOnly, [:string], :virConnectPtr
|
14
|
+
attach_function :virConnectOpenAuth, [:string, :virConnectAuthPtr, :int], :virConnectPtr
|
15
|
+
attach_function :virConnectRef, [:virConnectPtr], :int
|
16
|
+
attach_function :virConnectClose, [:virConnectPtr], :int
|
17
|
+
attach_function :virConnectGetType, [:virConnectPtr], :string
|
18
|
+
attach_function :virConnectGetVersion, [:virConnectPtr, :unsigned_long_pointer], :int
|
19
|
+
attach_function :virConnectGetHostname, [:virConnectPtr], :string
|
20
|
+
attach_function :virConnectGetURI, [:virConnectPtr], :string
|
21
|
+
|
22
|
+
# Capabilities of the connection/driver
|
23
|
+
attach_function :virConnectGetMaxVcpus, [:virConnectPtr, :string], :int
|
24
|
+
attach_function :virNodeGetInfo, [:virConnectPtr, :virNodeInfoPtr], :int
|
25
|
+
attach_function :virConnectGetCapabilities, [:virConnectPtr], :string
|
26
|
+
attach_function :virNodeGetFreeMemory, [:virConnectPtr], :ulong_long
|
27
|
+
|
28
|
+
# List of running domains
|
29
|
+
attach_function :virConnectListDomains, [:virConnectPtr, :int_pointer, :int], :int
|
30
|
+
|
31
|
+
# Number of domains
|
32
|
+
attach_function :virConnectNumOfDomains, [:virConnectPtr], :int
|
33
|
+
|
34
|
+
# Get connection from domain
|
35
|
+
attach_function :virDomainGetConnect, [:virDomainPtr], :virConnectPtr
|
36
|
+
|
37
|
+
# Domain creation and destruction
|
38
|
+
attach_function :virDomainCreateXML, [:virConnectPtr, :string, :uint], :virDomainPtr
|
39
|
+
attach_function :virDomainLookupByName, [:virConnectPtr, :string], :virDomainPtr
|
40
|
+
attach_function :virDomainLookupByID, [:virConnectPtr, :int], :virDomainPtr
|
41
|
+
attach_function :virDomainLookupByUUID, [:virConnectPtr, :string], :virDomainPtr
|
42
|
+
attach_function :virDomainLookupByUUIDString, [:virConnectPtr, :string], :virDomainPtr
|
43
|
+
attach_function :virDomainShutdown, [:virDomainPtr], :int
|
44
|
+
attach_function :virDomainReboot, [:virDomainPtr, :uint], :int
|
45
|
+
attach_function :virDomainDestroy, [:virDomainPtr], :int
|
46
|
+
attach_function :virDomainRef, [:virDomainPtr], :int
|
47
|
+
attach_function :virDomainFree, [:virDomainPtr], :int
|
48
|
+
|
49
|
+
# Domain suspend/resume
|
50
|
+
attach_function :virDomainSuspend, [:virDomainPtr], :int
|
51
|
+
attach_function :virDomainResume, [:virDomainPtr], :int
|
52
|
+
|
53
|
+
# Domain save/restore
|
54
|
+
attach_function :virDomainSave, [:virDomainPtr, :string], :int
|
55
|
+
attach_function :virDomainRestore, [:virDomainPtr, :string], :int
|
56
|
+
|
57
|
+
# Domain core dump
|
58
|
+
attach_function :virDomainCoreDump, [:virDomainPtr, :string, :int], :int
|
59
|
+
|
60
|
+
# Domain runtime information
|
61
|
+
attach_function :virDomainGetInfo, [:virDomainPtr, :virDomainInfoPtr], :int
|
62
|
+
|
63
|
+
# Return scheduler type in effect
|
64
|
+
attach_function :virDomainGetSchedulerType, [:virDomainPtr, :int_pointer], :string
|
65
|
+
attach_function :virDomainGetSchedulerParameters, [:virDomainPtr, :virSchedParameterPtr, :int_pointer], :int
|
66
|
+
attach_function :virDomainSetSchedulerParameters, [:virDomainPtr, :virSchedParameterPtr, :int], :int
|
67
|
+
|
68
|
+
# Dynamic control of domains
|
69
|
+
attach_function :virDomainGetName, [:virDomainPtr], :string
|
70
|
+
attach_function :virDomainGetID, [:virDomainPtr], :uint
|
71
|
+
attach_function :virDomainGetUUID, [:virDomainPtr, :pointer], :int
|
72
|
+
attach_function :virDomainGetUUIDString, [:virDomainPtr, :pointer], :int
|
73
|
+
attach_function :virDomainGetOSType, [:virDomainPtr], :string
|
74
|
+
attach_function :virDomainGetMaxMemory, [:virDomainPtr], :ulong
|
75
|
+
attach_function :virDomainSetMaxMemory, [:virDomainPtr, :ulong], :int
|
76
|
+
attach_function :virDomainSetMemory, [:virDomainPtr, :ulong], :int
|
77
|
+
attach_function :virDomainGetMaxVcpus, [:virDomainPtr], :int
|
78
|
+
|
79
|
+
# XML domain description
|
80
|
+
attach_function :virDomainGetXMLDesc, [:virDomainPtr, :int], :string
|
81
|
+
attach_function :virDomainBlockStats, [:virDomainPtr, :string, :virDomainBlockStatsPtr, :size_t], :int
|
82
|
+
attach_function :virDomainInterfaceStats, [:virDomainPtr, :string, :virDomainInterfaceStatsPtr, :size_t], :int
|
83
|
+
attach_function :virDomainBlockPeek, [:virDomainPtr, :string, :ulong_long, :size_t, :pointer, :uint], :int
|
84
|
+
attach_function :virDomainMemoryPeek, [:virDomainPtr, :ulong_long, :size_t, :pointer, :uint], :int
|
85
|
+
|
86
|
+
# Defined but not running domains
|
87
|
+
attach_function :virDomainDefineXML, [:virConnectPtr, :string], :virDomainPtr
|
88
|
+
attach_function :virDomainUndefine, [:virDomainPtr], :int
|
89
|
+
attach_function :virConnectNumOfDefinedDomains, [:virConnectPtr], :int
|
90
|
+
attach_function :virConnectListDefinedDomains, [:virConnectPtr, :pointer, :int], :int
|
91
|
+
attach_function :virDomainCreate, [:virDomainPtr], :int
|
92
|
+
attach_function :virDomainGetAutostart, [:virDomainPtr, :int_pointer], :int
|
93
|
+
attach_function :virDomainSetAutostart, [:virDomainPtr, :int], :int
|
94
|
+
attach_function :virDomainSetVcpus, [:virDomainPtr, :uint], :int
|
95
|
+
attach_function :virDomainPinVcpu, [:virDomainPtr, :uint, :string, :int], :int # TODO: Arg in is an array
|
96
|
+
attach_function :virDomainGetVcpus, [:virDomainPtr, :virVcpuInfoPtr, :int, :uchar_pointer, :int], :int
|
97
|
+
|
98
|
+
attach_function :virDomainAttachDevice, [:virDomainPtr, :string], :int
|
99
|
+
attach_function :virDomainDetachDevice, [:virDomainPtr, :string], :int
|
100
|
+
|
101
|
+
# NUMA support
|
102
|
+
attach_function :virNodeGetCellsFreeMemory, [:virConnectPtr, :ulong_long_pointer, :int, :int], :int
|
103
|
+
|
104
|
+
# Virtual Networks API
|
105
|
+
attach_function :virNetworkGetConnect, [:virNetworkPtr], :virConnectPtr
|
106
|
+
attach_function :virConnectNumOfNetworks, [:virConnectPtr], :int
|
107
|
+
attach_function :virConnectListNetworks, [:virConnectPtr, :pointer, :int], :int
|
108
|
+
attach_function :virConnectNumOfDefinedNetworks, [:virConnectPtr], :int
|
109
|
+
attach_function :virConnectListDefinedNetworks, [:virConnectPtr, :pointer, :int], :int
|
110
|
+
attach_function :virNetworkLookupByName, [:virConnectPtr, :string], :virNetworkPtr
|
111
|
+
attach_function :virNetworkLookupByUUID, [:virConnectPtr, :string], :virNetworkPtr
|
112
|
+
attach_function :virNetworkLookupByUUIDString, [:virConnectPtr, :string], :virNetworkPtr
|
113
|
+
attach_function :virNetworkCreateXML, [:virConnectPtr, :string], :virNetworkPtr
|
114
|
+
attach_function :virNetworkDefineXML, [:virConnectPtr, :string], :virNetworkPtr
|
115
|
+
attach_function :virNetworkUndefine, [:virNetworkPtr], :int
|
116
|
+
attach_function :virNetworkCreate, [:virNetworkPtr], :int
|
117
|
+
attach_function :virNetworkDestroy, [:virNetworkPtr], :int
|
118
|
+
attach_function :virNetworkRef, [:virNetworkPtr], :int
|
119
|
+
attach_function :virNetworkFree, [:virNetworkPtr], :int
|
120
|
+
attach_function :virNetworkGetName, [:virNetworkPtr], :string
|
121
|
+
attach_function :virNetworkGetUUID, [:virNetworkPtr, :pointer], :int
|
122
|
+
attach_function :virNetworkGetUUIDString, [:virNetworkPtr, :pointer], :int
|
123
|
+
attach_function :virNetworkGetXMLDesc, [:virNetworkPtr, :int], :string
|
124
|
+
attach_function :virNetworkGetBridgeName, [:virNetworkPtr], :string
|
125
|
+
attach_function :virNetworkGetAutostart, [:virNetworkPtr, :int_pointer], :int
|
126
|
+
attach_function :virNetworkSetAutostart, [:virNetworkPtr, :int], :int
|
127
|
+
|
128
|
+
# Storage pool API
|
129
|
+
attach_function :virStoragePoolGetConnect, [:virStoragePoolPtr], :virConnectPtr
|
130
|
+
attach_function :virConnectNumOfStoragePools, [:virConnectPtr], :int
|
131
|
+
attach_function :virConnectListStoragePools, [:virConnectPtr, :pointer, :int], :int
|
132
|
+
attach_function :virConnectNumOfDefinedStoragePools, [:virConnectPtr], :int
|
133
|
+
attach_function :virConnectListDefinedStoragePools, [:virConnectPtr, :pointer, :int], :int
|
134
|
+
attach_function :virConnectFindStoragePoolSources, [:virConnectPtr, :string, :string, :int], :string
|
135
|
+
attach_function :virStoragePoolLookupByName, [:virConnectPtr, :string], :virStoragePoolPtr
|
136
|
+
attach_function :virStoragePoolLookupByUUID, [:virConnectPtr, :string], :virStoragePoolPtr
|
137
|
+
attach_function :virStoragePoolLookupByUUIDString, [:virConnectPtr, :string], :virStoragePoolPtr
|
138
|
+
attach_function :virStoragePoolLookupByVolume, [:virStorageVolPtr], :virStoragePoolPtr
|
139
|
+
attach_function :virStoragePoolCreateXML, [:virConnectPtr, :string, :uint], :virStoragePoolPtr
|
140
|
+
attach_function :virStoragePoolDefineXML, [:virConnectPtr, :string, :uint], :virStoragePoolPtr
|
141
|
+
attach_function :virStoragePoolBuild, [:virStoragePoolPtr, :uint], :int
|
142
|
+
attach_function :virStoragePoolUndefine, [:virStoragePoolPtr], :int
|
143
|
+
attach_function :virStoragePoolCreate, [:virStoragePoolPtr, :uint], :int
|
144
|
+
attach_function :virStoragePoolDestroy, [:virStoragePoolPtr], :int
|
145
|
+
attach_function :virStoragePoolDelete, [:virStoragePoolPtr, :virStoragePoolDeleteFlags], :int
|
146
|
+
attach_function :virStoragePoolRef, [:virStoragePoolPtr], :int
|
147
|
+
attach_function :virStoragePoolFree, [:virStoragePoolPtr], :int
|
148
|
+
attach_function :virStoragePoolRefresh, [:virStoragePoolPtr, :uint], :int
|
149
|
+
attach_function :virStoragePoolGetName, [:virStoragePoolPtr], :string
|
150
|
+
attach_function :virStoragePoolGetUUID, [:virStoragePoolPtr, :string], :int
|
151
|
+
attach_function :virStoragePoolGetUUIDString, [:virStoragePoolPtr, :pointer], :int
|
152
|
+
attach_function :virStoragePoolGetInfo, [:virStoragePoolPtr, :virStoragePoolInfoPtr], :int
|
153
|
+
attach_function :virStoragePoolGetXMLDesc, [:virStoragePoolPtr, :uint], :string
|
154
|
+
attach_function :virStoragePoolGetAutostart, [:virStoragePoolPtr, :int_pointer], :int
|
155
|
+
attach_function :virStoragePoolSetAutostart, [:virStoragePoolPtr, :int], :int
|
156
|
+
attach_function :virStoragePoolNumOfVolumes, [:virStoragePoolPtr], :int
|
157
|
+
attach_function :virStoragePoolListVolumes, [:virStoragePoolPtr, :pointer, :int], :int
|
158
|
+
attach_function :virStorageVolGetConnect, [:virStorageVolPtr], :virConnectPtr
|
159
|
+
attach_function :virStorageVolLookupByName, [:virStoragePoolPtr, :string], :virStorageVolPtr
|
160
|
+
attach_function :virStorageVolLookupByKey, [:virConnectPtr, :string], :virStorageVolPtr
|
161
|
+
attach_function :virStorageVolLookupByPath, [:virConnectPtr, :string], :virStorageVolPtr
|
162
|
+
attach_function :virStorageVolGetName, [:virStorageVolPtr], :string
|
163
|
+
attach_function :virStorageVolGetKey, [:virStorageVolPtr], :string
|
164
|
+
attach_function :virStorageVolCreateXML, [:virStoragePoolPtr, :string, :uint], :virStorageVolPtr
|
165
|
+
attach_function :virStorageVolDelete, [:virStorageVolPtr, :uint], :int
|
166
|
+
attach_function :virStorageVolRef, [:virStorageVolPtr], :int
|
167
|
+
attach_function :virStorageVolFree, [:virStorageVolPtr], :int
|
168
|
+
attach_function :virStorageVolGetInfo, [:virStorageVolPtr, :virStorageVolInfoPtr], :int
|
169
|
+
attach_function :virStorageVolGetXMLDesc, [:virStorageVolPtr, :uint], :string
|
170
|
+
attach_function :virStorageVolGetPath, [:virStorageVolPtr], :string
|
171
|
+
|
172
|
+
# Deprecated
|
173
|
+
attach_function :virDomainCreateLinux, [:virConnectPtr, :string, :uint], :virDomainPtr
|
174
|
+
|
175
|
+
# Host device enumeration
|
176
|
+
attach_function :virNodeNumOfDevices, [:virConnectPtr, :string, :uint], :int
|
177
|
+
attach_function :virNodeListDevices, [:virConnectPtr, :string, :pointer, :int, :uint], :int
|
178
|
+
attach_function :virNodeDeviceLookupByName, [:virConnectPtr, :string], :virNodeDevicePtr
|
179
|
+
attach_function :virNodeDeviceGetName, [:virNodeDevicePtr], :string
|
180
|
+
attach_function :virNodeDeviceGetParent, [:virNodeDevicePtr], :string
|
181
|
+
attach_function :virNodeDeviceNumOfCaps, [:virNodeDevicePtr], :int
|
182
|
+
attach_function :virNodeDeviceListCaps, [:virNodeDevicePtr, :pointer, :int], :int
|
183
|
+
attach_function :virNodeDeviceGetXMLDesc, [:virNodeDevicePtr, :uint], :string
|
184
|
+
attach_function :virNodeDeviceRef, [:virNodeDevicePtr], :int
|
185
|
+
attach_function :virNodeDeviceFree, [:virNodeDevicePtr], :int
|
186
|
+
|
187
|
+
# Domain event notification
|
188
|
+
attach_function :virConnectDomainEventRegister, [:virConnectPtr, :virConnectDomainEventCallback, :void_pointer, :virFreeCallback], :int
|
189
|
+
attach_function :virConnectDomainEventDeregister, [:virConnectPtr, :virConnectDomainEventCallback], :int
|
190
|
+
|
191
|
+
# Events
|
192
|
+
attach_function :virEventRegisterImpl, [:virEventAddHandleFunc, :virEventUpdateHandleFunc, :virEventRemoveHandleFunc, :virEventAddTimeoutFunc, :virEventUpdateTimeoutFunc, :virEventRemoveTimeoutFunc], :void
|
193
|
+
end
|
194
|
+
|
195
|
+
libvirt_version "0.6.1" do
|
196
|
+
attach_function :virNodeGetSecurityModel, [:virConnectPtr, :virSecurityModelPtr], :int
|
197
|
+
attach_function :virDomainGetSecurityLabel, [:virDomainPtr, :virSecurityLabelPtr], :int
|
198
|
+
attach_function :virNodeDeviceDettach, [:virNodeDevicePtr], :int
|
199
|
+
attach_function :virNodeDeviceReAttach, [:virNodeDevicePtr], :int
|
200
|
+
attach_function :virNodeDeviceReset, [:virNodeDevicePtr], :int
|
201
|
+
end
|
202
|
+
|
203
|
+
libvirt_version "0.6.3" do
|
204
|
+
attach_function :virNodeDeviceCreateXML, [:virConnectPtr, :string, :uint], :virNodeDevicePtr
|
205
|
+
attach_function :virNodeDeviceDestroy, [:virNodeDevicePtr], :int
|
206
|
+
end
|
207
|
+
|
208
|
+
libvirt_version "0.6.4" do
|
209
|
+
attach_function :virConnectDomainXMLFromNative, [:virConnectPtr, :string, :string, :uint], :string
|
210
|
+
attach_function :virConnectDomainXMLToNative, [:virConnectPtr, :string, :string, :uint], :string
|
211
|
+
|
212
|
+
# Physical host interface configuration API
|
213
|
+
attach_function :virInterfaceGetConnect, [:virInterfacePtr], :virConnectPtr
|
214
|
+
attach_function :virConnectNumOfInterfaces, [:virConnectPtr], :int
|
215
|
+
attach_function :virConnectListInterfaces, [:virConnectPtr, :pointer, :int], :int # TODO: String pointer
|
216
|
+
attach_function :virInterfaceLookupByName, [:virConnectPtr, :string], :virInterfacePtr
|
217
|
+
attach_function :virInterfaceLookupByMACString, [:virConnectPtr, :string], :virInterfacePtr
|
218
|
+
attach_function :virInterfaceGetName, [:virInterfacePtr], :string
|
219
|
+
attach_function :virInterfaceGetMACString, [:virInterfacePtr], :string
|
220
|
+
attach_function :virInterfaceGetXMLDesc, [:virInterfacePtr, :uint], :string
|
221
|
+
attach_function :virInterfaceDefineXML, [:virConnectPtr, :string, :int], :virInterfacePtr
|
222
|
+
attach_function :virInterfaceUndefine, [:virInterfacePtr], :int
|
223
|
+
attach_function :virInterfaceCreate, [:virInterfacePtr, :int], :int
|
224
|
+
attach_function :virInterfaceDestroy, [:virInterfacePtr, :int], :int
|
225
|
+
attach_function :virInterfaceRef, [:virInterfacePtr], :int
|
226
|
+
attach_function :virInterfaceFree, [:virInterfacePtr], :int
|
227
|
+
|
228
|
+
attach_function :virStorageVolCreateXMLFrom, [:virStoragePoolPtr, :string, :virStorageVolPtr, :uint], :virStorageVolPtr
|
229
|
+
end
|
230
|
+
|
231
|
+
libvirt_version "0.7.0" do
|
232
|
+
attach_function :virConnectNumOfDefinedInterfaces, [:virConnectPtr], :int
|
233
|
+
attach_function :virConnectListDefinedInterfaces, [:virConnectPtr, :pointer, :int], :int
|
234
|
+
end
|
235
|
+
|
236
|
+
libvirt_version "0.7.1" do
|
237
|
+
# Secret manipulation API
|
238
|
+
attach_function :virSecretGetConnect, [:virSecretPtr], :virConnectPtr
|
239
|
+
attach_function :virConnectNumOfSecrets, [:virConnectPtr], :int
|
240
|
+
attach_function :virConnectListSecrets, [:virConnectPtr, :pointer, :int], :int
|
241
|
+
attach_function :virSecretLookupByUUID, [:virConnectPtr, :string], :virSecretPtr
|
242
|
+
attach_function :virSecretLookupByUUIDString, [:virConnectPtr, :string], :virSecretPtr
|
243
|
+
attach_function :virSecretLookupByUsage, [:virConnectPtr, :int, :string], :virSecretPtr
|
244
|
+
attach_function :virSecretDefineXML, [:virConnectPtr, :string, :uint], :virSecretPtr
|
245
|
+
attach_function :virSecretGetUUID, [:virSecretPtr, :pointer], :int
|
246
|
+
attach_function :virSecretGetUUIDString, [:virSecretPtr, :pointer], :int
|
247
|
+
attach_function :virSecretGetUsageType, [:virSecretPtr], :int
|
248
|
+
attach_function :virSecretGetUsageID, [:virSecretPtr], :string
|
249
|
+
attach_function :virSecretGetXMLDesc, [:virSecretPtr, :uint], :string
|
250
|
+
attach_function :virSecretSetValue, [:virSecretPtr, :string, :size_t, :uint], :int
|
251
|
+
attach_function :virSecretGetValue, [:virSecretPtr, :size_t, :uint], :string
|
252
|
+
attach_function :virSecretUndefine, [:virSecretPtr], :int
|
253
|
+
attach_function :virSecretRef, [:virSecretPtr], :int
|
254
|
+
attach_function :virSecretFree, [:virSecretPtr], :int
|
255
|
+
end
|
256
|
+
|
257
|
+
libvirt_version "0.7.2" do
|
258
|
+
attach_function :virDomainMigrateToURI, [:virDomainPtr, :string, :ulong, :string, :ulong], :int
|
259
|
+
|
260
|
+
# Stream API
|
261
|
+
attach_function :virStreamNew, [:virConnectPtr, :uint], :virStreamPtr
|
262
|
+
attach_function :virStreamRef, [:virStreamPtr], :int
|
263
|
+
attach_function :virStreamSend, [:virStreamPtr, :string, :size_t], :int
|
264
|
+
attach_function :virStreamRecv, [:virStreamPtr, :pointer, :size_t], :int
|
265
|
+
attach_function :virStreamSendAll, [:virStreamPtr, :virStreamSourceFunc, :void_pointer], :int
|
266
|
+
attach_function :virStreamRecvAll, [:virStreamPtr, :virStreamSinkFunc, :void_pointer], :int
|
267
|
+
attach_function :virStreamEventAddCallback, [:virStreamPtr, :int, :virStreamEventCallback, :void_pointer, :virFreeCallback], :int
|
268
|
+
attach_function :virStreamEventUpdateCallback, [:virStreamPtr, :int], :int
|
269
|
+
attach_function :virStreamEventRemoveCallback, [:virStreamPtr], :int
|
270
|
+
attach_function :virStreamFinish, [:virStreamPtr], :int
|
271
|
+
attach_function :virStreamAbort, [:virStreamPtr], :int
|
272
|
+
attach_function :virStreamFree, [:virStreamPtr], :int
|
273
|
+
end
|
274
|
+
|
275
|
+
libvirt_version "0.7.3" do
|
276
|
+
attach_function :virConnectGetLibVersion, [:virConnectPtr, :unsigned_long_pointer], :int
|
277
|
+
|
278
|
+
attach_function :virDomainIsActive, [:virDomainPtr], :int
|
279
|
+
attach_function :virDomainIsPersistent, [:virDomainPtr], :int
|
280
|
+
attach_function :virNetworkIsActive, [:virNetworkPtr], :int
|
281
|
+
attach_function :virNetworkIsPersistent, [:virNetworkPtr], :int
|
282
|
+
attach_function :virStoragePoolIsActive, [:virStoragePoolPtr], :int
|
283
|
+
attach_function :virStoragePoolIsPersistent, [:virStoragePoolPtr], :int
|
284
|
+
attach_function :virInterfaceIsActive, [:virInterfacePtr], :int
|
285
|
+
attach_function :virConnectIsEncrypted, [:virConnectPtr], :int
|
286
|
+
attach_function :virConnectIsSecure, [:virConnectPtr], :int
|
287
|
+
end
|
288
|
+
|
289
|
+
libvirt_version "0.7.5" do
|
290
|
+
attach_function :virDomainMemoryStats, [:virDomainPtr, :virDomainMemoryStatsPtr, :uint, :uint], :int
|
291
|
+
attach_function :virConnectCompareCPU, [:virConnectPtr, :string, :uint], :int
|
292
|
+
end
|
293
|
+
|
294
|
+
libvirt_version "0.7.7" do
|
295
|
+
attach_function :virDomainAttachDeviceFlags, [:virDomainPtr, :string, :uint], :int
|
296
|
+
attach_function :virDomainDetachDeviceFlags, [:virDomainPtr, :string, :uint], :int
|
297
|
+
|
298
|
+
attach_function :virConnectBaselineCPU, [:virConnectPtr, :pointer, :uint, :uint], :string
|
299
|
+
|
300
|
+
# Domain jobs
|
301
|
+
attach_function :virDomainGetJobInfo, [:virDomainPtr, :virDomainJobInfoPtr], :int
|
302
|
+
attach_function :virDomainAbortJob, [:virDomainPtr], :int
|
303
|
+
end
|
304
|
+
|
305
|
+
libvirt_version "0.8.0" do
|
306
|
+
attach_function :virDomainMigrateSetMaxDowntime, [:virDomainPtr, :ulong_long, :uint], :int
|
307
|
+
|
308
|
+
# Managed domain save
|
309
|
+
attach_function :virDomainManagedSave, [:virDomainPtr, :uint], :int
|
310
|
+
attach_function :virDomainHasManagedSaveImage, [:virDomainPtr, :uint], :int
|
311
|
+
attach_function :virDomainManagedSaveRemove, [:virDomainPtr, :uint], :int
|
312
|
+
|
313
|
+
attach_function :virDomainUpdateDeviceFlags, [:virDomainPtr, :string, :uint], :int
|
314
|
+
|
315
|
+
attach_function :virStorageVolWipe, [:virStorageVolPtr, :uint], :int
|
316
|
+
|
317
|
+
# Domain snapshots
|
318
|
+
attach_function :virDomainSnapshotCreateXML, [:virDomainPtr, :string, :uint], :virDomainSnapshotPtr
|
319
|
+
attach_function :virDomainSnapshotGetXMLDesc, [:virDomainSnapshotPtr, :uint], :string
|
320
|
+
attach_function :virDomainSnapshotNum, [:virDomainPtr, :uint], :int
|
321
|
+
attach_function :virDomainSnapshotListNames, [:virDomainPtr, :pointer, :int, :uint], :int
|
322
|
+
attach_function :virDomainSnapshotLookupByName, [:virDomainPtr, :string, :uint], :virDomainSnapshotPtr
|
323
|
+
attach_function :virDomainHasCurrentSnapshot, [:virDomainPtr, :uint], :int
|
324
|
+
attach_function :virDomainSnapshotCurrent, [:virDomainPtr, :uint], :virDomainSnapshotPtr
|
325
|
+
attach_function :virDomainRevertToSnapshot, [:virDomainSnapshotPtr, :uint], :int
|
326
|
+
attach_function :virDomainSnapshotDelete, [:virDomainSnapshotPtr, :uint], :int
|
327
|
+
attach_function :virDomainSnapshotFree, [:virDomainSnapshotPtr], :int
|
328
|
+
|
329
|
+
attach_function :virConnectDomainEventRegisterAny, [:virConnectPtr, :virDomainPtr, :int, :virConnectDomainEventGenericCallback, :void_pointer, :virFreeCallback], :int
|
330
|
+
attach_function :virConnectDomainEventDeregisterAny, [:virConnectPtr, :int], :int
|
331
|
+
|
332
|
+
# Network filters API
|
333
|
+
attach_function :virConnectNumOfNWFilters, [:virConnectPtr], :int
|
334
|
+
attach_function :virConnectListNWFilters, [:virConnectPtr, :pointer, :int], :int
|
335
|
+
attach_function :virNWFilterLookupByName, [:virConnectPtr, :string], :virNWFilterPtr
|
336
|
+
attach_function :virNWFilterLookupByUUID, [:virConnectPtr, :string], :virNWFilterPtr
|
337
|
+
attach_function :virNWFilterLookupByUUIDString, [:virConnectPtr, :string], :virNWFilterPtr
|
338
|
+
attach_function :virNWFilterDefineXML, [:virConnectPtr, :string], :virNWFilterPtr
|
339
|
+
attach_function :virNWFilterUndefine, [:virNWFilterPtr], :int
|
340
|
+
attach_function :virNWFilterRef, [:virNWFilterPtr], :int
|
341
|
+
attach_function :virNWFilterFree, [:virNWFilterPtr], :int
|
342
|
+
attach_function :virNWFilterGetName, [:virNWFilterPtr], :string
|
343
|
+
attach_function :virNWFilterGetUUID, [:virNWFilterPtr, :pointer], :int
|
344
|
+
attach_function :virNWFilterGetUUIDString, [:virNWFilterPtr, :pointer], :int
|
345
|
+
attach_function :virNWFilterGetXMLDesc, [:virNWFilterPtr, :int], :string
|
346
|
+
end
|
347
|
+
|
348
|
+
libvirt_version "0.8.1" do
|
349
|
+
attach_function :virDomainGetBlockInfo, [:virDomainPtr, :string, :virDomainBlockInfoPtr, :uint], :int
|
350
|
+
end
|
351
|
+
|
352
|
+
libvirt_version "0.8.2" do
|
353
|
+
attach_function :virDomainCreateWithFlags, [:virDomainPtr, :uint], :int
|
354
|
+
end
|
355
|
+
|
356
|
+
# This is currently in git, not released
|
357
|
+
libvirt_version "0.8.5" do
|
358
|
+
# Set memory tunables for the domain
|
359
|
+
attach_function :virDomainSetMemoryParameters, [:virDomainPtr, :virMemoryParameterPtr, :int, :uint], :int
|
360
|
+
attach_function :virDomainGetMemoryParameters, [:virDomainPtr, :virMemoryParameterPtr, :int_pointer, :uint_pointer], :int
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# virNodeInfo structure, used to represent a node which libvirt
|
4
|
+
# is running on.
|
5
|
+
#
|
6
|
+
# struct _virNodeInfo {
|
7
|
+
# char model[32]; /* string indicating the CPU model */
|
8
|
+
# unsigned long memory;/* memory size in kilobytes */
|
9
|
+
# unsigned int cpus; /* the number of active CPUs */
|
10
|
+
# unsigned int mhz; /* expected CPU frequency */
|
11
|
+
# unsigned int nodes; /* the number of NUMA cell, 1 for uniform mem access */
|
12
|
+
# unsigned int sockets;/* number of CPU socket per node */
|
13
|
+
# unsigned int cores; /* number of core per socket */
|
14
|
+
# unsigned int threads;/* number of threads per core */
|
15
|
+
# };
|
16
|
+
class NodeInfo < ::FFI::Struct
|
17
|
+
layout :model, :char, 32,
|
18
|
+
:memory, :ulong,
|
19
|
+
:cpus, :uint,
|
20
|
+
:mhz, :uint,
|
21
|
+
:nodes, :uint,
|
22
|
+
:sockets, :uint,
|
23
|
+
:cores, :uint,
|
24
|
+
:threads, :uint
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# struct _virStorageVolInfo {
|
4
|
+
# int type; /* virStorageVolType flags */
|
5
|
+
# unsigned long long capacity; /* Logical size bytes */
|
6
|
+
# unsigned long long allocation; /* Current allocation bytes */
|
7
|
+
#};
|
8
|
+
class StorageVolumeInfo < ::FFI::Struct
|
9
|
+
layout :type, :virStorageVolType,
|
10
|
+
:capacity, :ulong_long,
|
11
|
+
:allocation, :ulong_long
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# Typedefs for various pointers to libvirt structures
|
4
|
+
typedef :pointer, :virConnectPtr
|
5
|
+
typedef :pointer, :virConnectAuthPtr
|
6
|
+
typedef :pointer, :virDomainPtr
|
7
|
+
typedef :pointer, :virDomainBlockInfoPtr
|
8
|
+
typedef :pointer, :virDomainBlockStatsPtr
|
9
|
+
typedef :pointer, :virDomainInfoPtr
|
10
|
+
typedef :pointer, :virDomainInterfaceStatsPtr
|
11
|
+
typedef :pointer, :virDomainJobInfoPtr
|
12
|
+
typedef :pointer, :virDomainMemoryStatsPtr
|
13
|
+
typedef :pointer, :virDomainSnapshotPtr
|
14
|
+
typedef :pointer, :virInterfacePtr
|
15
|
+
typedef :pointer, :virMemoryParameterPtr
|
16
|
+
typedef :pointer, :virNetworkPtr
|
17
|
+
typedef :pointer, :virNodeDevicePtr
|
18
|
+
typedef :pointer, :virNodeInfoPtr
|
19
|
+
typedef :pointer, :virNWFilterPtr
|
20
|
+
typedef :pointer, :virSchedParameterPtr
|
21
|
+
typedef :pointer, :virSecretPtr
|
22
|
+
typedef :pointer, :virSecurityModelPtr
|
23
|
+
typedef :pointer, :virSecurityLabelPtr
|
24
|
+
typedef :pointer, :virStoragePoolPtr
|
25
|
+
typedef :pointer, :virStoragePoolInfoPtr
|
26
|
+
typedef :pointer, :virStorageVolPtr
|
27
|
+
typedef :pointer, :virStorageVolInfoPtr
|
28
|
+
typedef :pointer, :virStreamPtr
|
29
|
+
typedef :pointer, :virVcpuInfoPtr
|
30
|
+
|
31
|
+
# Pointers for C primitives
|
32
|
+
typedef :pointer, :uchar_pointer
|
33
|
+
typedef :pointer, :int_pointer
|
34
|
+
typedef :pointer, :uint_pointer
|
35
|
+
typedef :pointer, :unsigned_long_pointer
|
36
|
+
typedef :pointer, :ulong_long_pointer
|
37
|
+
typedef :pointer, :void_pointer
|
38
|
+
|
39
|
+
# Callbacks
|
40
|
+
callback :virConnectDomainEventCallback, [:virConnectPtr, :virDomainPtr, :int, :int, :void_pointer], :int
|
41
|
+
callback :virFreeCallback, [:void_pointer], :void
|
42
|
+
callback :virEventHandleCallback, [:int, :int, :int, :void_pointer], :void
|
43
|
+
callback :virEventAddHandleFunc, [:int, :int, :virEventHandleCallback, :void_pointer, :virFreeCallback], :int
|
44
|
+
callback :virEventUpdateHandleFunc, [:int, :int], :void
|
45
|
+
callback :virEventRemoveHandleFunc, [:int], :int
|
46
|
+
callback :virEventTimeoutCallback, [:int, :void_pointer], :void
|
47
|
+
callback :virEventAddTimeoutFunc, [:int, :virEventTimeoutCallback, :void_pointer, :virFreeCallback], :int
|
48
|
+
callback :virEventUpdateTimeoutFunc, [:int, :int], :void
|
49
|
+
callback :virEventRemoveTimeoutFunc, [:int], :int
|
50
|
+
callback :virStreamSourceFunc, [:virStreamPtr, :string, :size_t, :void_pointer], :int
|
51
|
+
callback :virStreamSinkFunc, [:virStreamPtr, :string, :size_t, :void_pointer], :int
|
52
|
+
callback :virStreamEventCallback, [:virStreamPtr, :int, :void_pointer], :void
|
53
|
+
callback :virConnectDomainEventGenericCallback, [:virConnectPtr, :virDomainPtr, :void_pointer], :void
|
54
|
+
|
55
|
+
# Enums
|
56
|
+
enum :virDomainState, [:nostate, :running, :blocked, :paused, :shutdown, :shutoff, :crashed]
|
57
|
+
enum :virStoragePoolDeleteFlags, [:normal, :zeroed]
|
58
|
+
enum :virStoragePoolState, [:inactive, :building, :running, :degraded, :inaccessible]
|
59
|
+
enum :virStorageVolType, [:file, :block]
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
# Utility methods which may be helpful when dealing with the FFI layer.
|
4
|
+
module Util
|
5
|
+
# Parses the raw version integer returned by various libvirt methods
|
6
|
+
# into proper `[major, minor, patch]` format.
|
7
|
+
#
|
8
|
+
# @return [Array]
|
9
|
+
def self.parse_version_number(number)
|
10
|
+
# Format is MAJOR * 1,000,000 + MINOR * 1,000 + PATCH
|
11
|
+
major = number / 1_000_000
|
12
|
+
number %= 1_000_000
|
13
|
+
minor = number / 1_000
|
14
|
+
number %= 1000
|
15
|
+
[major, minor, number]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module FFI
|
2
|
+
module Libvirt
|
3
|
+
attach_function :virGetVersion, [:unsigned_long_pointer, :string, :unsigned_long_pointer], :int
|
4
|
+
|
5
|
+
class << self
|
6
|
+
# Returns the version of libvirt client on this machine. The
|
7
|
+
# version is returned as an array of `[major, minor, patch]`.
|
8
|
+
#
|
9
|
+
# @return [Array]
|
10
|
+
def version
|
11
|
+
Util.parse_version_number(raw_version)
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
# Returns the version of libvirt as the raw integer version, such as
|
17
|
+
# 8004 (which is actually "0.8.4"). This is used internally to do fast
|
18
|
+
# version comparisons.
|
19
|
+
#
|
20
|
+
# @return [Integer]
|
21
|
+
def raw_version
|
22
|
+
out = FFI::MemoryPointer.new(:ulong)
|
23
|
+
FFI::Libvirt.virGetVersion(out, nil, nil)
|
24
|
+
out.get_ulong(0)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Allows the scoping of certain FFI attaches to specific versions of
|
28
|
+
# libvirt. This allows the FFI library to work from early versions of
|
29
|
+
# libvirt through to later versions.
|
30
|
+
def libvirt_version(string_version, &block)
|
31
|
+
# Convert the given version to the proper numerical representation so
|
32
|
+
# it is more easily compared.
|
33
|
+
multiplier = 1_000_000
|
34
|
+
numeric_version = string_version.split(".").inject(0) do |acc, part|
|
35
|
+
acc += part.to_i * multiplier
|
36
|
+
multiplier /= 1000
|
37
|
+
acc
|
38
|
+
end
|
39
|
+
|
40
|
+
# If the version we have is newer, then eval the block, since we
|
41
|
+
# support it.
|
42
|
+
instance_eval(&block) if raw_version >= numeric_version
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|