ruby-libvirt 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3d8455cea04535a67a854a1668e65e697f8f5a9
4
- data.tar.gz: d7f64cdb9354ca004ce37b6ca0a13b32e3d6f424
3
+ metadata.gz: fbcf087680f4524b1c5e1faba3dfad5bbc22f281
4
+ data.tar.gz: 298b6f117bd8b15acc809c70954b38341d7ace4c
5
5
  SHA512:
6
- metadata.gz: 793d87e2aed2a20afa6de1ae61898c04875b0d4bcb706c5cdc53a73214ceba84019be1c4153f8a9a0e59b431fe5bf074927d51edbcdf7bbbfc9a6b28534ffe48
7
- data.tar.gz: cffa8666d8784b85afcf6e4bfdf2cfb7fd90722bc789ba5a602a5d7fe4f15005fe309a44d193a1c4dcfe92db06c82df457c27589acb8a01035fa1d9ad9b91f82
6
+ metadata.gz: 9d8508cf6a4033efb7d0fb19451f19ed8efc79ebfd4ecfd6e601f7c1504d1007ce729da33245aab5d6563ae85e42cb98656f5b83091c049392af12f4d80eee4f
7
+ data.tar.gz: 0151aa217bfa464c7f08755b8d586e262b89ce196ac26c0024b0c8741cc1043a93c8ed70eb2ec082fd21dea3bdea5899cf5766c4ae86dbb478841bbe8c18c58a
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 2014-01-08
2
+ * Fix to make sure we don't free more entires than retrieved
3
+
1
4
  2013-12-15
2
5
  * Fixes to compile against older libvirt
3
6
  * Fixes to compile against ruby 1.8
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
  # Rakefile: build ruby libvirt bindings
3
3
  #
4
4
  # Copyright (C) 2007,2010 Red Hat, Inc.
5
- # Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ # Copyright (C) 2013,2014 Chris Lalancette <clalancette@gmail.com>
6
6
  #
7
7
  # Distributed under the GNU Lesser General Public License v2.1 or later.
8
8
  # See COPYING for details
@@ -21,7 +21,7 @@ require 'rubygems/package_task'
21
21
  require 'rbconfig'
22
22
 
23
23
  PKG_NAME='ruby-libvirt'
24
- PKG_VERSION='0.5.1'
24
+ PKG_VERSION='0.5.2'
25
25
 
26
26
  EXT_CONF='ext/libvirt/extconf.rb'
27
27
  MAKEFILE="ext/libvirt/Makefile"
@@ -67,7 +67,7 @@
67
67
  names = alloca(sizeof(char *) * num); \
68
68
  r = virConnectList##objs(ruby_libvirt_connect_get(c), names, num); \
69
69
  ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virConnectList" # objs, ruby_libvirt_connect_get(c)); \
70
- return ruby_libvirt_generate_list(num, names); \
70
+ return ruby_libvirt_generate_list(r, names); \
71
71
  } while(0)
72
72
 
73
73
  static VALUE c_connect;
@@ -1508,7 +1508,7 @@ static VALUE libvirt_connect_list_nodedevices(int argc, VALUE *argv, VALUE c)
1508
1508
  ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virNodeListDevices",
1509
1509
  ruby_libvirt_connect_get(c));
1510
1510
 
1511
- return ruby_libvirt_generate_list(num, names);
1511
+ return ruby_libvirt_generate_list(r, names);
1512
1512
  }
1513
1513
 
1514
1514
  /*
@@ -1532,7 +1532,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
1532
1532
  "virDomainSnapshotListNames",
1533
1533
  ruby_libvirt_connect_get(d));
1534
1534
 
1535
- return ruby_libvirt_generate_list(num, names);
1535
+ return ruby_libvirt_generate_list(r, names);
1536
1536
  }
1537
1537
 
1538
1538
  /*
@@ -124,7 +124,7 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
124
124
  "virNodeDeviceListCaps",
125
125
  ruby_libvirt_connect_get(c));
126
126
 
127
- return ruby_libvirt_generate_list(num, names);
127
+ return ruby_libvirt_generate_list(r, names);
128
128
  }
129
129
 
130
130
  /*
@@ -340,7 +340,7 @@ static VALUE libvirt_storage_pool_list_volumes(VALUE p)
340
340
  "virStoragePoolListVolumes",
341
341
  ruby_libvirt_connect_get(p));
342
342
 
343
- return ruby_libvirt_generate_list(num, names);
343
+ return ruby_libvirt_generate_list(r, names);
344
344
  }
345
345
 
346
346
  /*
@@ -9,7 +9,7 @@ require 'test_utils.rb'
9
9
 
10
10
  set_test_object("nodedevice")
11
11
 
12
- conn = Libvirt::open("qemu:///system")
12
+ conn = Libvirt::open(URI)
13
13
 
14
14
  # TESTGROUP: nodedevice.name
15
15
  testnode = conn.lookup_nodedevice_by_name(conn.list_nodedevices[0])
@@ -21,49 +21,49 @@ expect_success(Libvirt, "nil arg", "version", nil) {|x| x.class == Array and x.l
21
21
  expect_success(Libvirt, "Test arg", "version", "Test") {|x| x.class == Array and x.length == 2}
22
22
 
23
23
  # TESTGROUP: Libvirt::open
24
- expect_too_many_args(Libvirt, "open", "qemu:///system", 1)
24
+ expect_too_many_args(Libvirt, "open", URI, 1)
25
25
  expect_connect_error("open", "foo:///system")
26
26
  conn = expect_success(Libvirt, "no args", "open") {|x| x.class == Libvirt::Connect }
27
27
  conn.close
28
- conn = expect_success(Libvirt, "qemu:///system", "open", "qemu:///system") {|x| x.class == Libvirt::Connect }
28
+ conn = expect_success(Libvirt, URI, "open", URI) {|x| x.class == Libvirt::Connect }
29
29
  conn.close
30
30
  conn = expect_success(Libvirt, "nil arg", "open", nil) {|x| x.class == Libvirt::Connect }
31
31
  conn.close
32
32
 
33
33
  # TESTGROUP: Libvirt::open_read_only
34
- expect_too_many_args(Libvirt, "open_read_only", "qemu:///system", 1)
34
+ expect_too_many_args(Libvirt, "open_read_only", URI, 1)
35
35
  expect_connect_error("open_read_only", "foo:///system")
36
36
  conn = expect_success(Libvirt, "no args", "open_read_only") {|x| x.class == Libvirt::Connect }
37
37
  conn.close
38
- conn = expect_success(Libvirt, "qemu:///system", "open_read_only", "qemu:///system") {|x| x.class == Libvirt::Connect }
38
+ conn = expect_success(Libvirt, URI, "open_read_only", URI) {|x| x.class == Libvirt::Connect }
39
39
  conn.close
40
40
  conn = expect_success(Libvirt, "nil arg", "open_read_only", nil) {|x| x.class == Libvirt::Connect }
41
41
  conn.close
42
42
 
43
43
  # TESTGROUP: Libvirt::open_auth
44
- expect_too_many_args(Libvirt, "open_auth", "qemu:///system", [], "hello there", 1, 2)
44
+ expect_too_many_args(Libvirt, "open_auth", URI, [], "hello there", 1, 2)
45
45
  expect_connect_error("open_auth", "foo:///system")
46
46
  expect_invalid_arg_type(Libvirt, "open_auth", 1)
47
- expect_invalid_arg_type(Libvirt, "open_auth", "qemu:///system", [], "hello", "foo")
47
+ expect_invalid_arg_type(Libvirt, "open_auth", URI, [], "hello", "foo")
48
48
 
49
49
  conn = expect_success(Libvirt, "no args", "open_auth") {|x| x.class == Libvirt::Connect }
50
50
  conn.close
51
51
 
52
- conn = expect_success(Libvirt, "uri arg", "open_auth", "qemu:///system") {|x| x.class == Libvirt::Connect }
52
+ conn = expect_success(Libvirt, "uri arg", "open_auth", URI) {|x| x.class == Libvirt::Connect }
53
53
  conn.close
54
54
 
55
- conn = expect_success(Libvirt, "uri and empty cred args", "open_auth", "qemu:///system", []) {|x| x.class == Libvirt::Connect }
55
+ conn = expect_success(Libvirt, "uri and empty cred args", "open_auth", URI, []) {|x| x.class == Libvirt::Connect }
56
56
  conn.close
57
57
 
58
- conn = expect_success(Libvirt, "uri and full cred args", "open_auth", "qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE]) {|x| x.class == Libvirt::Connect }
58
+ conn = expect_success(Libvirt, "uri and full cred args", "open_auth", URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE]) {|x| x.class == Libvirt::Connect }
59
59
  conn.close
60
60
 
61
- conn = expect_success(Libvirt, "uri, full cred, and user args", "open_auth", "qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") {|x| x.class == Libvirt::Connect }
61
+ conn = expect_success(Libvirt, "uri, full cred, and user args", "open_auth", URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") {|x| x.class == Libvirt::Connect }
62
62
  conn.close
63
63
 
64
64
  # equivalent to expect_invalid_arg_type
65
65
  begin
66
- conn = Libvirt::open_auth("qemu:///system", {}) do |cred|
66
+ conn = Libvirt::open_auth(URI, {}) do |cred|
67
67
  end
68
68
  rescue TypeError => e
69
69
  puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -73,7 +73,7 @@ end
73
73
 
74
74
  # equivalent to expect_invalid_arg_type
75
75
  begin
76
- conn = Libvirt::open_auth("qemu:///system", 1) do |cred|
76
+ conn = Libvirt::open_auth(URI, 1) do |cred|
77
77
  end
78
78
  rescue TypeError => e
79
79
  puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -83,7 +83,7 @@ end
83
83
 
84
84
  # equivalent to expect_invalid_arg_type
85
85
  begin
86
- conn = Libvirt::open_auth("qemu:///system", 'foo') do |cred|
86
+ conn = Libvirt::open_auth(URI, 'foo') do |cred|
87
87
  end
88
88
  rescue TypeError => e
89
89
  puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -93,7 +93,7 @@ end
93
93
 
94
94
  # equivalent to "expect_success"
95
95
  begin
96
- conn = Libvirt::open_auth("qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") do |cred|
96
+ conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") do |cred|
97
97
  if not cred["userdata"].nil?
98
98
  puts "userdata is #{cred["userdata"]}"
99
99
  end
@@ -122,7 +122,7 @@ end
122
122
 
123
123
  # equivalent to "expect_success"
124
124
  begin
125
- conn = Libvirt::open_auth("qemu:///system") do |cred|
125
+ conn = Libvirt::open_auth(URI) do |cred|
126
126
  end
127
127
 
128
128
  puts_ok "Libvirt.open_auth uri, succeeded"
@@ -135,7 +135,7 @@ end
135
135
 
136
136
  # equivalent to "expect_success"
137
137
  begin
138
- conn = Libvirt::open_auth("qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello", Libvirt::CONNECT_RO) do |cred|
138
+ conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello", Libvirt::CONNECT_RO) do |cred|
139
139
  if not cred["userdata"].nil?
140
140
  puts "userdata is #{cred["userdata"]}"
141
141
  end
@@ -163,7 +163,7 @@ rescue => e
163
163
  end
164
164
 
165
165
  # TESTGROUP: Libvirt::event_invoke_handle_callback
166
- conn = Libvirt::open("qemu:///system")
166
+ conn = Libvirt::open(URI)
167
167
 
168
168
  expect_too_many_args(Libvirt, "event_invoke_handle_callback", 1, 2, 3, 4, 5)
169
169
  expect_too_few_args(Libvirt, "event_invoke_handle_callback")
@@ -188,7 +188,7 @@ expect_invalid_arg_type(Libvirt, "event_invoke_handle_callback", 1, 1, 1, { "lib
188
188
  conn.close
189
189
 
190
190
  # TESTGROUP: Libvirt::event_invoke_timeout_callback
191
- conn = Libvirt::open("qemu:///system")
191
+ conn = Libvirt::open(URI)
192
192
 
193
193
  expect_too_many_args(Libvirt, "event_invoke_timeout_callback", 1, 2, 3)
194
194
  expect_too_few_args(Libvirt, "event_invoke_timeout_callback")
@@ -9,7 +9,7 @@ require 'test_utils.rb'
9
9
 
10
10
  set_test_object("stream")
11
11
 
12
- conn = Libvirt::open("qemu:///system")
12
+ conn = Libvirt::open(URI)
13
13
 
14
14
  # TESTGROUP: stream.send
15
15
  st = conn.stream
@@ -2,6 +2,8 @@ $FAIL = 0
2
2
  $SUCCESS = 0
3
3
  $SKIPPED = 0
4
4
 
5
+ URI = ENV['RUBY_LIBVIRT_TEST_URI'] || "qemu:///system"
6
+
5
7
  $GUEST_BASE = '/var/lib/libvirt/images/ruby-libvirt-tester'
6
8
  $GUEST_DISK = $GUEST_BASE + '.qcow2'
7
9
  $GUEST_SAVE = $GUEST_BASE + '.save'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-libvirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Lutterkort, Chris Lalancette
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-15 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby bindings for libvirt.
14
14
  email: libvir-list@redhat.com