[Pkg-libvirt-commits] [ruby-libvirt] 01/05: New upstream version 0.5.2
Guido Guenther
agx at moszumanska.debian.org
Tue Jan 13 07:45:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
agx pushed a commit to annotated tag debian/0.5.2-1
in repository ruby-libvirt.
commit f561a0302856ebae5fe3b19eae2b12c42839cc74
Author: Guido Günther <agx at sigxcpu.org>
Date: Mon Jan 12 08:00:21 2015 +0100
New upstream version 0.5.2
---
NEWS | 3 +++
Rakefile | 4 ++--
ext/libvirt/connect.c | 4 ++--
ext/libvirt/domain.c | 2 +-
ext/libvirt/nodedevice.c | 2 +-
ext/libvirt/storage.c | 2 +-
tests/test_nodedevice.rb | 2 +-
tests/test_open.rb | 36 ++++++++++++++++++------------------
tests/test_stream.rb | 2 +-
tests/test_utils.rb | 2 ++
10 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/NEWS b/NEWS
index 47abd97..eb5e7d9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+2014-01-08
+ * Fix to make sure we don't free more entires than retrieved
+
2013-12-15
* Fixes to compile against older libvirt
* Fixes to compile against ruby 1.8
diff --git a/Rakefile b/Rakefile
index 753a096..4155f0e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -2,7 +2,7 @@
# Rakefile: build ruby libvirt bindings
#
# Copyright (C) 2007,2010 Red Hat, Inc.
-# Copyright (C) 2013 Chris Lalancette <clalancette at gmail.com>
+# Copyright (C) 2013,2014 Chris Lalancette <clalancette at gmail.com>
#
# Distributed under the GNU Lesser General Public License v2.1 or later.
# See COPYING for details
@@ -21,7 +21,7 @@ require 'rubygems/package_task'
require 'rbconfig'
PKG_NAME='ruby-libvirt'
-PKG_VERSION='0.5.1'
+PKG_VERSION='0.5.2'
EXT_CONF='ext/libvirt/extconf.rb'
MAKEFILE="ext/libvirt/Makefile"
diff --git a/ext/libvirt/connect.c b/ext/libvirt/connect.c
index 36cac20..cef4de1 100644
--- a/ext/libvirt/connect.c
+++ b/ext/libvirt/connect.c
@@ -67,7 +67,7 @@
names = alloca(sizeof(char *) * num); \
r = virConnectList##objs(ruby_libvirt_connect_get(c), names, num); \
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virConnectList" # objs, ruby_libvirt_connect_get(c)); \
- return ruby_libvirt_generate_list(num, names); \
+ return ruby_libvirt_generate_list(r, names); \
} while(0)
static VALUE c_connect;
@@ -1508,7 +1508,7 @@ static VALUE libvirt_connect_list_nodedevices(int argc, VALUE *argv, VALUE c)
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virNodeListDevices",
ruby_libvirt_connect_get(c));
- return ruby_libvirt_generate_list(num, names);
+ return ruby_libvirt_generate_list(r, names);
}
/*
diff --git a/ext/libvirt/domain.c b/ext/libvirt/domain.c
index ddce2d8..8ac7d99 100644
--- a/ext/libvirt/domain.c
+++ b/ext/libvirt/domain.c
@@ -1532,7 +1532,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
"virDomainSnapshotListNames",
ruby_libvirt_connect_get(d));
- return ruby_libvirt_generate_list(num, names);
+ return ruby_libvirt_generate_list(r, names);
}
/*
diff --git a/ext/libvirt/nodedevice.c b/ext/libvirt/nodedevice.c
index 98b3715..f0cbb4b 100644
--- a/ext/libvirt/nodedevice.c
+++ b/ext/libvirt/nodedevice.c
@@ -124,7 +124,7 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
"virNodeDeviceListCaps",
ruby_libvirt_connect_get(c));
- return ruby_libvirt_generate_list(num, names);
+ return ruby_libvirt_generate_list(r, names);
}
/*
diff --git a/ext/libvirt/storage.c b/ext/libvirt/storage.c
index 4b96d2e..a01edbc 100644
--- a/ext/libvirt/storage.c
+++ b/ext/libvirt/storage.c
@@ -340,7 +340,7 @@ static VALUE libvirt_storage_pool_list_volumes(VALUE p)
"virStoragePoolListVolumes",
ruby_libvirt_connect_get(p));
- return ruby_libvirt_generate_list(num, names);
+ return ruby_libvirt_generate_list(r, names);
}
/*
diff --git a/tests/test_nodedevice.rb b/tests/test_nodedevice.rb
index 7da1a5f..50a1304 100644
--- a/tests/test_nodedevice.rb
+++ b/tests/test_nodedevice.rb
@@ -9,7 +9,7 @@ require 'test_utils.rb'
set_test_object("nodedevice")
-conn = Libvirt::open("qemu:///system")
+conn = Libvirt::open(URI)
# TESTGROUP: nodedevice.name
testnode = conn.lookup_nodedevice_by_name(conn.list_nodedevices[0])
diff --git a/tests/test_open.rb b/tests/test_open.rb
index 17baa93..c67eaab 100644
--- a/tests/test_open.rb
+++ b/tests/test_open.rb
@@ -21,49 +21,49 @@ expect_success(Libvirt, "nil arg", "version", nil) {|x| x.class == Array and x.l
expect_success(Libvirt, "Test arg", "version", "Test") {|x| x.class == Array and x.length == 2}
# TESTGROUP: Libvirt::open
-expect_too_many_args(Libvirt, "open", "qemu:///system", 1)
+expect_too_many_args(Libvirt, "open", URI, 1)
expect_connect_error("open", "foo:///system")
conn = expect_success(Libvirt, "no args", "open") {|x| x.class == Libvirt::Connect }
conn.close
-conn = expect_success(Libvirt, "qemu:///system", "open", "qemu:///system") {|x| x.class == Libvirt::Connect }
+conn = expect_success(Libvirt, URI, "open", URI) {|x| x.class == Libvirt::Connect }
conn.close
conn = expect_success(Libvirt, "nil arg", "open", nil) {|x| x.class == Libvirt::Connect }
conn.close
# TESTGROUP: Libvirt::open_read_only
-expect_too_many_args(Libvirt, "open_read_only", "qemu:///system", 1)
+expect_too_many_args(Libvirt, "open_read_only", URI, 1)
expect_connect_error("open_read_only", "foo:///system")
conn = expect_success(Libvirt, "no args", "open_read_only") {|x| x.class == Libvirt::Connect }
conn.close
-conn = expect_success(Libvirt, "qemu:///system", "open_read_only", "qemu:///system") {|x| x.class == Libvirt::Connect }
+conn = expect_success(Libvirt, URI, "open_read_only", URI) {|x| x.class == Libvirt::Connect }
conn.close
conn = expect_success(Libvirt, "nil arg", "open_read_only", nil) {|x| x.class == Libvirt::Connect }
conn.close
# TESTGROUP: Libvirt::open_auth
-expect_too_many_args(Libvirt, "open_auth", "qemu:///system", [], "hello there", 1, 2)
+expect_too_many_args(Libvirt, "open_auth", URI, [], "hello there", 1, 2)
expect_connect_error("open_auth", "foo:///system")
expect_invalid_arg_type(Libvirt, "open_auth", 1)
-expect_invalid_arg_type(Libvirt, "open_auth", "qemu:///system", [], "hello", "foo")
+expect_invalid_arg_type(Libvirt, "open_auth", URI, [], "hello", "foo")
conn = expect_success(Libvirt, "no args", "open_auth") {|x| x.class == Libvirt::Connect }
conn.close
-conn = expect_success(Libvirt, "uri arg", "open_auth", "qemu:///system") {|x| x.class == Libvirt::Connect }
+conn = expect_success(Libvirt, "uri arg", "open_auth", URI) {|x| x.class == Libvirt::Connect }
conn.close
-conn = expect_success(Libvirt, "uri and empty cred args", "open_auth", "qemu:///system", []) {|x| x.class == Libvirt::Connect }
+conn = expect_success(Libvirt, "uri and empty cred args", "open_auth", URI, []) {|x| x.class == Libvirt::Connect }
conn.close
-conn = expect_success(Libvirt, "uri and full cred args", "open_auth", "qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE]) {|x| x.class == Libvirt::Connect }
+conn = expect_success(Libvirt, "uri and full cred args", "open_auth", URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE]) {|x| x.class == Libvirt::Connect }
conn.close
-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 }
+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 }
conn.close
# equivalent to expect_invalid_arg_type
begin
- conn = Libvirt::open_auth("qemu:///system", {}) do |cred|
+ conn = Libvirt::open_auth(URI, {}) do |cred|
end
rescue TypeError => e
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -73,7 +73,7 @@ end
# equivalent to expect_invalid_arg_type
begin
- conn = Libvirt::open_auth("qemu:///system", 1) do |cred|
+ conn = Libvirt::open_auth(URI, 1) do |cred|
end
rescue TypeError => e
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -83,7 +83,7 @@ end
# equivalent to expect_invalid_arg_type
begin
- conn = Libvirt::open_auth("qemu:///system", 'foo') do |cred|
+ conn = Libvirt::open_auth(URI, 'foo') do |cred|
end
rescue TypeError => e
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
@@ -93,7 +93,7 @@ end
# equivalent to "expect_success"
begin
- conn = Libvirt::open_auth("qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") do |cred|
+ conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") do |cred|
if not cred["userdata"].nil?
puts "userdata is #{cred["userdata"]}"
end
@@ -122,7 +122,7 @@ end
# equivalent to "expect_success"
begin
- conn = Libvirt::open_auth("qemu:///system") do |cred|
+ conn = Libvirt::open_auth(URI) do |cred|
end
puts_ok "Libvirt.open_auth uri, succeeded"
@@ -135,7 +135,7 @@ end
# equivalent to "expect_success"
begin
- conn = Libvirt::open_auth("qemu:///system", [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello", Libvirt::CONNECT_RO) do |cred|
+ conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello", Libvirt::CONNECT_RO) do |cred|
if not cred["userdata"].nil?
puts "userdata is #{cred["userdata"]}"
end
@@ -163,7 +163,7 @@ rescue => e
end
# TESTGROUP: Libvirt::event_invoke_handle_callback
-conn = Libvirt::open("qemu:///system")
+conn = Libvirt::open(URI)
expect_too_many_args(Libvirt, "event_invoke_handle_callback", 1, 2, 3, 4, 5)
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
conn.close
# TESTGROUP: Libvirt::event_invoke_timeout_callback
-conn = Libvirt::open("qemu:///system")
+conn = Libvirt::open(URI)
expect_too_many_args(Libvirt, "event_invoke_timeout_callback", 1, 2, 3)
expect_too_few_args(Libvirt, "event_invoke_timeout_callback")
diff --git a/tests/test_stream.rb b/tests/test_stream.rb
index 07ec222..e272104 100644
--- a/tests/test_stream.rb
+++ b/tests/test_stream.rb
@@ -9,7 +9,7 @@ require 'test_utils.rb'
set_test_object("stream")
-conn = Libvirt::open("qemu:///system")
+conn = Libvirt::open(URI)
# TESTGROUP: stream.send
st = conn.stream
diff --git a/tests/test_utils.rb b/tests/test_utils.rb
index 1bac1cc..519de27 100644
--- a/tests/test_utils.rb
+++ b/tests/test_utils.rb
@@ -2,6 +2,8 @@ $FAIL = 0
$SUCCESS = 0
$SKIPPED = 0
+URI = ENV['RUBY_LIBVIRT_TEST_URI'] || "qemu:///system"
+
$GUEST_BASE = '/var/lib/libvirt/images/ruby-libvirt-tester'
$GUEST_DISK = $GUEST_BASE + '.qcow2'
$GUEST_SAVE = $GUEST_BASE + '.save'
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/ruby-libvirt.git
More information about the Pkg-libvirt-commits
mailing list