...
 
Commits (4)
2018-02-18 0.7.1
* Fix a bad bug in block_resize (Marius Rieder)
* Fix up some problems pointed out by clang
* Fix up the tests for small semantic differences in how libvirt works
2016-09-22 0.7.0
* Fix network lease API to allow arguments that libvirt allows
* Implement VIRT_STORAGE_POOL_CREATE flags
......
......@@ -21,7 +21,7 @@ require 'rubygems/package_task'
require 'rbconfig'
PKG_NAME='ruby-libvirt'
PKG_VERSION='0.7.0'
PKG_VERSION='0.7.1'
EXT_CONF='ext/libvirt/extconf.rb'
MAKEFILE="ext/libvirt/Makefile"
......
......@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://libvirt.org/main.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="ruby-libvirt.css" />
<link rel="SHORTCUT ICON" href="http://libvirt.org/32favicon.png" />
<title>ruby-libvirt: News</title>
......
......@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://libvirt.org/main.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="ruby-libvirt.css" />
<link rel="SHORTCUT ICON" href="http://libvirt.org/32favicon.png" />
<title>ruby-libvirt: News</title>
......
......@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://libvirt.org/main.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="ruby-libvirt.css" />
<link rel="SHORTCUT ICON" href="http://libvirt.org/32favicon.png" />
<title>Ruby bindings for libvirt</title>
......
......@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://libvirt.org/main.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="ruby-libvirt.css" />
<link rel="SHORTCUT ICON" href="http://libvirt.org/32favicon.png" />
<title>ruby-libvirt: News</title>
......@@ -40,6 +40,7 @@
<div id="content">
<h1>News</h1>
<ul>
<li>February 18, 2018 - Release 0.7.1</li>
<li>September 22, 2016 - Release 0.7.0</li>
<li>November 20, 2015 - Release 0.6.0</li>
<li>January 8, 2014 - Release 0.5.2</li>
......@@ -59,6 +60,12 @@
<li>November 19, 2007 - Release 0.0.1</li>
</ul>
<h1>Releases</h1>
<h3>0.7.1: February 18, 2018</h3>
<ul>
<li>Fix a bad bug in block_resize (Marius Rieder)</li>
<li>Fix up some problems pointed out by clang</li>
<li>Fix up the tests for small semantic differences in how libvirt works</li>
</ul>
<h3>0.7.0: September 22, 2016</h3>
<ul>
<li>Fix network lease API to allow arguments that libvirt allows</li>
......
......@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://libvirt.org/main.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="ruby-libvirt.css" />
<link rel="SHORTCUT ICON" href="http://libvirt.org/32favicon.png" />
<title>ruby-libvirt: News</title>
......
......@@ -660,7 +660,7 @@ static VALUE libvirt_conn_event_register_impl(int argc, VALUE *argv,
static VALUE libvirt_domain_lxc_enter_security_label(int argc, VALUE *argv,
VALUE RUBY_LIBVIRT_UNUSED(c))
{
VALUE model, label, flags, result, modiv, doiiv, labiv;
VALUE model = RUBY_Qnil, label = RUBY_Qnil, flags = RUBY_Qnil, result, modiv, doiiv, labiv;
virSecurityModel mod;
char *modstr, *doistr, *labstr;
virSecurityLabel lab, oldlab;
......
......@@ -123,7 +123,7 @@ void ruby_libvirt_raise_error_if(const int condition, VALUE error,
#define ruby_libvirt_generate_call_list_all(type, argc, argv, listfunc, object, val, newfunc, freefunc) \
do { \
VALUE flags; \
VALUE flags = RUBY_Qnil; \
type *list; \
int i; \
int ret; \
......
......@@ -2780,7 +2780,7 @@ static VALUE libvirt_connect_domain_capabilities(int argc, VALUE *argv, VALUE c)
*/
static VALUE libvirt_connect_node_free_pages(int argc, VALUE *argv, VALUE c)
{
VALUE pageArr, cells, flags, result;
VALUE pageArr = RUBY_Qnil, cells = RUBY_Qnil, flags = RUBY_Qnil, result;
unsigned int *pages;
unsigned int npages, i, cellCount;
int startCell, ret;
......
......@@ -3338,7 +3338,7 @@ static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
{
VALUE disk, bandwidth, flags;
VALUE disk, bandwidth = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "12", &disk, &bandwidth, &flags);
......@@ -3407,7 +3407,7 @@ static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
*/
static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
{
VALUE disk, flags, result;
VALUE disk, flags = RUBY_Qnil, result;
virDomainBlockJobInfo info;
int r;
......@@ -3442,7 +3442,7 @@ static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
{
VALUE disk, flags;
VALUE disk, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &disk, &flags);
......@@ -3508,7 +3508,7 @@ static const char *interface_set(VALUE d, unsigned int flags,
*/
static VALUE libvirt_domain_interface_parameters(int argc, VALUE *argv, VALUE d)
{
VALUE device, flags;
VALUE device = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &device, &flags);
......@@ -3605,7 +3605,7 @@ static const char *block_stats_get(VALUE d, unsigned int flags,
*/
static VALUE libvirt_domain_block_stats_flags(int argc, VALUE *argv, VALUE d)
{
VALUE disk, flags;
VALUE disk = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &disk, &flags);
......@@ -3666,7 +3666,7 @@ static const char *numa_set(VALUE d, unsigned int flags,
*/
static VALUE libvirt_domain_numa_parameters(int argc, VALUE *argv, VALUE d)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -3714,7 +3714,7 @@ static VALUE libvirt_domain_numa_parameters_equal(VALUE d, VALUE in)
*/
static VALUE libvirt_domain_lxc_open_namespace(int argc, VALUE *argv, VALUE d)
{
VALUE flags, result;
VALUE flags = RUBY_Qnil, result;
int *fdlist = NULL;
int ret, i, exception = 0;
struct ruby_libvirt_ary_store_arg args;
......@@ -3769,7 +3769,7 @@ error:
*/
static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
{
VALUE command, timeout, flags, result;
VALUE command, timeout = RUBY_Qnil, flags = RUBY_Qnil, result;
char *ret;
int exception = 0;
......@@ -3807,7 +3807,7 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_lxc_enter_namespace(int argc, VALUE *argv, VALUE d)
{
VALUE fds, flags, result;
VALUE fds = RUBY_Qnil, flags = RUBY_Qnil, result;
int *fdlist;
int ret, exception = 0;
int *oldfdlist;
......@@ -3881,7 +3881,7 @@ static struct ruby_libvirt_typed_param migrate3_allowed[] = {
*/
static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
{
VALUE dconn, hash, flags;
VALUE dconn = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
virDomainPtr ddom = NULL;
struct ruby_libvirt_parameter_assign_args args;
unsigned long hashsize;
......@@ -3925,7 +3925,7 @@ static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
{
VALUE duri, hash, flags;
VALUE duri = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
struct ruby_libvirt_parameter_assign_args args;
unsigned long hashsize;
......@@ -3971,7 +3971,7 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
{
VALUE start_cpu, numcpus, flags, result, tmp;
VALUE start_cpu = RUBY_Qnil, numcpus = RUBY_Qnil, flags = RUBY_Qnil, result, tmp;
int ret, nparams, j;
unsigned int i;
virTypedParameterPtr params;
......@@ -4059,7 +4059,7 @@ static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
{
VALUE flags, result;
VALUE flags = RUBY_Qnil, result;
long long seconds;
unsigned int nseconds;
int ret;
......@@ -4113,7 +4113,7 @@ static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
*/
static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d)
{
VALUE to, dumpformat, flags;
VALUE to, dumpformat = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "21", &to, &dumpformat, &flags);
......@@ -4136,7 +4136,7 @@ static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d
*/
static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
{
VALUE mountpoints, flags, entry;
VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
const char **mnt;
unsigned int nmountpoints;
int i;
......@@ -4177,7 +4177,7 @@ static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
{
VALUE mountpoints, flags, entry;
VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
const char **mnt;
unsigned int nmountpoints;
int i;
......@@ -4252,7 +4252,7 @@ static VALUE fs_info_wrap(VALUE arg)
*/
static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
{
VALUE flags, result;
VALUE flags = RUBY_Qnil, result;
virDomainFSInfoPtr *info;
int ret, i = 0, exception;
struct fs_info_arg args;
......@@ -4291,7 +4291,7 @@ static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
*/
static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
{
VALUE flags, name;
VALUE flags = RUBY_Qnil, name;
rb_scan_args(argc, argv, "11", &name, &flags);
......
......@@ -67,7 +67,7 @@ static VALUE libvirt_interface_undefine(VALUE i)
*/
static VALUE libvirt_interface_create(int argc, VALUE *argv, VALUE i)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -86,7 +86,7 @@ static VALUE libvirt_interface_create(int argc, VALUE *argv, VALUE i)
*/
static VALUE libvirt_interface_destroy(int argc, VALUE *argv, VALUE i)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -149,7 +149,7 @@ static VALUE libvirt_interface_mac(VALUE i)
*/
static VALUE libvirt_interface_xml_desc(int argc, VALUE *argv, VALUE i)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......
......@@ -141,7 +141,7 @@ static VALUE libvirt_network_uuid(VALUE n)
*/
static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -301,7 +301,7 @@ static VALUE leases_wrap(VALUE arg)
*/
static VALUE libvirt_network_get_dhcp_leases(int argc, VALUE *argv, VALUE n)
{
VALUE mac, flags, result;
VALUE mac = RUBY_Qnil, flags = RUBY_Qnil, result;
int nleases, i = 0, exception = 0;
virNetworkDHCPLeasePtr *leases = NULL;
struct leases_arg args;
......
......@@ -136,7 +136,7 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
*/
static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -155,7 +155,7 @@ static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
*/
static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
{
VALUE driver, flags;
VALUE driver = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "02", &driver, &flags);
......@@ -248,7 +248,7 @@ static VALUE libvirt_nodedevice_free(VALUE n)
static VALUE libvirt_nodedevice_lookup_scsi_host_by_wwn(int argc, VALUE *argv,
VALUE n)
{
VALUE wwnn, wwpn, flags;
VALUE wwnn, wwpn, flags = RUBY_Qnil;
virNodeDevicePtr nd;
rb_scan_args(argc, argv, "21", &wwnn, &wwpn, &flags);
......
......@@ -94,7 +94,7 @@ static VALUE libvirt_nwfilter_uuid(VALUE n)
*/
static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......
......@@ -94,7 +94,7 @@ static VALUE libvirt_secret_usageid(VALUE s)
*/
static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -113,7 +113,7 @@ static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
*/
static VALUE libvirt_secret_set_value(int argc, VALUE *argv, VALUE s)
{
VALUE flags, value;
VALUE flags = RUBY_Qnil, value;
rb_scan_args(argc, argv, "11", &value, &flags);
......@@ -173,7 +173,7 @@ static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
*/
static VALUE libvirt_secret_value(int argc, VALUE *argv, VALUE s)
{
VALUE flags, ret;
VALUE flags = RUBY_Qnil, ret;
unsigned char *val;
size_t value_size;
int exception = 0;
......
......@@ -88,7 +88,7 @@ static VALUE libvirt_storage_vol_pool(VALUE v)
*/
static VALUE libvirt_storage_pool_build(int argc, VALUE *argv, VALUE p)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -121,7 +121,7 @@ static VALUE libvirt_storage_pool_undefine(VALUE p)
*/
static VALUE libvirt_storage_pool_create(int argc, VALUE *argv, VALUE p)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -155,7 +155,7 @@ static VALUE libvirt_storage_pool_destroy(VALUE p)
*/
static VALUE libvirt_storage_pool_delete(int argc, VALUE *argv, VALUE p)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -174,7 +174,7 @@ static VALUE libvirt_storage_pool_delete(int argc, VALUE *argv, VALUE p)
*/
static VALUE libvirt_storage_pool_refresh(int argc, VALUE *argv, VALUE p)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -247,7 +247,7 @@ static VALUE libvirt_storage_pool_info(VALUE p)
*/
static VALUE libvirt_storage_pool_xml_desc(int argc, VALUE *argv, VALUE p)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -492,7 +492,7 @@ static VALUE libvirt_storage_pool_create_volume_xml(int argc, VALUE *argv,
VALUE p)
{
virStorageVolPtr vol;
VALUE xml, flags;
VALUE xml, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &xml, &flags);
......@@ -517,7 +517,7 @@ static VALUE libvirt_storage_pool_create_volume_xml_from(int argc, VALUE *argv,
VALUE p)
{
virStorageVolPtr vol;
VALUE xml, flags, cloneval;
VALUE xml, flags = RUBY_Qnil, cloneval = RUBY_Qnil;
rb_scan_args(argc, argv, "21", &xml, &cloneval, &flags);
......@@ -573,7 +573,7 @@ static VALUE libvirt_storage_pool_persistent_p(VALUE p)
*/
static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -593,7 +593,7 @@ static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
*/
static VALUE libvirt_storage_vol_wipe(int argc, VALUE *argv, VALUE v)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -638,7 +638,7 @@ static VALUE libvirt_storage_vol_info(VALUE v)
*/
static VALUE libvirt_storage_vol_xml_desc(int argc, VALUE *argv, VALUE v)
{
VALUE flags;
VALUE flags = RUBY_Qnil;
rb_scan_args(argc, argv, "01", &flags);
......@@ -686,7 +686,7 @@ static VALUE libvirt_storage_vol_free(VALUE v)
*/
static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
{
VALUE st, offset, length, flags;
VALUE st = RUBY_Qnil, offset = RUBY_Qnil, length = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "31", &st, &offset, &length, &flags);
......@@ -706,7 +706,7 @@ static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
*/
static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
{
VALUE st, offset, length, flags;
VALUE st = RUBY_Qnil, offset = RUBY_Qnil, length = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "31", &st, &offset, &length, &flags);
......@@ -728,7 +728,7 @@ static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
*/
static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
{
VALUE alg, flags;
VALUE alg = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &alg, &flags);
......@@ -749,7 +749,7 @@ static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
*/
static VALUE libvirt_storage_vol_resize(int argc, VALUE *argv, VALUE v)
{
VALUE capacity, flags;
VALUE capacity = RUBY_Qnil, flags = RUBY_Qnil;
rb_scan_args(argc, argv, "11", &capacity, &flags);
......
......@@ -149,7 +149,7 @@ static int internal_sendall(virStreamPtr RUBY_LIBVIRT_UNUSED(st), char *data,
*/
static VALUE libvirt_stream_sendall(int argc, VALUE *argv, VALUE s)
{
VALUE opaque;
VALUE opaque = RUBY_Qnil;
int ret;
if (!rb_block_given_p()) {
......@@ -192,7 +192,7 @@ static int internal_recvall(virStreamPtr RUBY_LIBVIRT_UNUSED(st),
*/
static VALUE libvirt_stream_recvall(int argc, VALUE *argv, VALUE s)
{
VALUE opaque;
VALUE opaque = RUBY_Qnil;
int ret;
if (!rb_block_given_p()) {
......@@ -259,7 +259,7 @@ static void stream_event_callback(virStreamPtr st, int events, void *opaque)
*/
static VALUE libvirt_stream_event_add_callback(int argc, VALUE *argv, VALUE s)
{
VALUE events, callback, opaque, passthrough;
VALUE events = RUBY_Qnil, callback = RUBY_Qnil, opaque = RUBY_Qnil, passthrough;
int ret;
rb_scan_args(argc, argv, "21", &events, &callback, &opaque);
......
......@@ -129,7 +129,7 @@ expect_fail(conn, ArgumentError, "empty array", "baseline_cpu", [])
expect_success(conn, "CPU XML", "baseline_cpu", [cpu_xml])
# TESTGROUP: conn.domain_event_register_any
dom_event_callback_proc = lambda {|conn, dom, event, detail, opaque|
dom_event_callback_proc = lambda {|connect, dom, event, detail, opaque|
}
# def dom_event_callback_symbol(conn, dom, event, detail, opaque)
......@@ -292,7 +292,7 @@ expect_success(conn, "UUID arg for defined domain", "lookup_domain_by_uuid", new
newdom.undefine
# TESTGROUP: conn.define_domain_xml
expect_too_many_args(conn, "define_domain_xml", 1, 2)
expect_too_many_args(conn, "define_domain_xml", 1, 2, 3)
expect_too_few_args(conn, "define_domain_xml")
expect_invalid_arg_type(conn, "define_domain_xml", 1)
expect_invalid_arg_type(conn, "define_domain_xml", nil)
......
......@@ -19,6 +19,8 @@ cleanup_test_domain(conn)
# setup for later tests
`qemu-img create -f qcow2 #{$GUEST_DISK} 5G`
`qemu-img create -f raw #{$GUEST_RAW_DISK} 5G`
new_hostdev_xml = <<EOF
<hostdev mode='subsystem' type='pci' managed='yes'>
......@@ -147,7 +149,7 @@ newdom.destroy
# TESTGROUP: dom.send_key
newdom = conn.create_domain_xml($new_dom_xml)
sleep 30
sleep 1
expect_too_many_args(newdom, "send_key", 1, 2, 3, 4)
expect_too_few_args(newdom, "send_key")
......@@ -318,7 +320,7 @@ newdom.destroy
newdom = conn.create_domain_xml($new_dom_xml)
sleep 1
expect_success(newdom, "no args running domain", "resume")
expect_fail(newdom, Libvirt::Error, "already running", "resume")
newdom.suspend
expect_too_many_args(newdom, "resume", 1)
......@@ -511,15 +513,15 @@ expect_invalid_arg_type(newdom, "block_peek", "foo", 0, "bar")
expect_invalid_arg_type(newdom, "block_peek", "foo", 0, 512, "baz")
expect_fail(newdom, Libvirt::RetrieveError, "invalid path", "block_peek", "foo", 0, 512)
blockpeek = newdom.block_peek($GUEST_DISK, 0, 512)
# blockpeek = newdom.block_peek($GUEST_RAW_DISK, 0, 512)
# 0x51 0x46 0x49 0xfb are the first 4 bytes of a qcow2 image
if blockpeek[0].unpack('C')[0] != 0x51 or blockpeek[1].unpack('C')[0] != 0x46 or
blockpeek[2].unpack('C')[0] != 0x49 or blockpeek[3].unpack('C')[0] != 0xfb
puts_fail "domain.block_peek read did not return valid data"
else
puts_ok "domain.block_peek read valid data"
end
# # 0x51 0x46 0x49 0xfb are the first 4 bytes of a qcow2 image
# if blockpeek[0].unpack('C')[0] != 0x51 or blockpeek[1].unpack('C')[0] != 0x46 or
# blockpeek[2].unpack('C')[0] != 0x49 or blockpeek[3].unpack('C')[0] != 0xfb
# puts_fail "domain.block_peek read did not return valid data"
# else
# puts_ok "domain.block_peek read valid data"
# end
newdom.destroy
......@@ -1406,6 +1408,7 @@ sleep 1
# TESTGROUP: snapshot.parent
newdom = conn.define_domain_xml($new_dom_xml)
snap = newdom.snapshot_create_xml("<domainsnapshot/>")
sleep 1
snap2 = newdom.snapshot_create_xml("<domainsnapshot/>")
expect_too_many_args(snap2, "parent", 1, 2)
......
......@@ -88,7 +88,7 @@ expect_fail(st, RuntimeError, "no block given", "recvall")
st.free
# TESTGROUP: stream.event_add_callback
st_event_callback_proc = lambda {|st,events,opaque|
st_event_callback_proc = lambda {|stream,events,opaque|
}
st = conn.stream
......
......@@ -8,6 +8,7 @@ $GUEST_BASE = '/var/lib/libvirt/images/rb-libvirt-test'
$GUEST_DISK = $GUEST_BASE + '.qcow2'
$GUEST_SAVE = $GUEST_BASE + '.save'
$GUEST_UUID = "93a5c045-6457-2c09-e56f-927cdf34e17a"
$GUEST_RAW_DISK = $GUEST_BASE + '.raw'
# XML data for later tests
$new_dom_xml = <<EOF
......