libvirt_ffi 0.5.2 → 0.5.3
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/lib/libvirt/connection.rb +7 -0
- data/lib/libvirt/ffi/host.rb +5 -0
- data/lib/libvirt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2337cfa3a044b561ab70fe277e7fafff9f39919c494edc64e0f24dabce256d
|
4
|
+
data.tar.gz: a2dbb17ebb8eca45d0336293da344f1b6959f5afdbcee394d87ad5c103a9406a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e1354133c74a9fe27affc1414f2e8a466fd1c97664e3ed365736c7f3c574d9e7e1530bd15af5d229442437e33cfcf4f18d48b8e538af7e62a49975d92d7b591
|
7
|
+
data.tar.gz: 57d42fe97ad18a5827710d63eec68d0681ec1282d97168a71f1ce27263cc69c8f0063c4374543bb8baf0ff707a587080f23530b0fbc1d7ce8f158a46f57f62a4
|
data/lib/libvirt/connection.rb
CHANGED
@@ -79,6 +79,13 @@ module Libvirt
|
|
79
79
|
result.zero?
|
80
80
|
end
|
81
81
|
|
82
|
+
def free_memory
|
83
|
+
result = FFI::Host.virNodeGetFreeMemory(@conn_ptr)
|
84
|
+
raise Errors::LibError, "Couldn't set connection keep_alive" if result.negative?
|
85
|
+
|
86
|
+
result
|
87
|
+
end
|
88
|
+
|
82
89
|
def to_s
|
83
90
|
"#<#{self.class}:0x#{object_id.to_s(16)} @uri=#{@uri.inspect} @conn_ptr=0x#{@conn_ptr.address.to_s(16)}>"
|
84
91
|
end
|
data/lib/libvirt/ffi/host.rb
CHANGED
@@ -117,6 +117,11 @@ module Libvirt
|
|
117
117
|
# virConnectPtr conn
|
118
118
|
# )
|
119
119
|
attach_function :virConnectRef, [:pointer], :int
|
120
|
+
|
121
|
+
# unsigned long long virNodeGetFreeMemory (
|
122
|
+
# virConnectPtr conn
|
123
|
+
# )
|
124
|
+
attach_function :virNodeGetFreeMemory, [:pointer], :u_long_long
|
120
125
|
end
|
121
126
|
end
|
122
127
|
end
|
data/lib/libvirt/version.rb
CHANGED