ruby-libvirt 0.7.0 → 0.7.1

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: aefbd15c7fe0242b743e1becd08d6c11ea350c60
4
- data.tar.gz: 74c7cc7a1e23315ab302138dfa902d587c9a6c08
3
+ metadata.gz: 25025f1aa369d862c8fce5c8469309c19782309a
4
+ data.tar.gz: '090a8ccc0dd056d096fc1d450e38b07b0581f294'
5
5
  SHA512:
6
- metadata.gz: 0ed0431364ffad0687758004ca0a301e98f3bf7e802d2b68dec34b8f210ec91277a001add9efa08770b65b908b0683b1bf989afed736b7223f54f8520f4efec5
7
- data.tar.gz: eb0e7146cd6e515c05937150be52b4050f73dfe4ce6840c29e7ec741addd49e9fe2c148f90d4aec85f9ba99f5ff1deea126aa2c652c3e028bc73a3928bd7ac6d
6
+ metadata.gz: f88b82044556d2fb1940f56d009d605d00d4438db8443cedcda6febd32572b44073d03e3eda42c12916d4219c7a912b8eb0584fe79cfcaa5a6627c849d28c5ea
7
+ data.tar.gz: 6c9282d08593f50d8c45b92d401c4d6e98d0ae3915fe1678132985661b23c54c7d96bbe7f1af9b37c73e87c8f6652b310e798d6b5ff80b65509b691ec4b2fef6
data/NEWS CHANGED
@@ -1,3 +1,8 @@
1
+ 2018-02-18 0.7.1
2
+ * Fix a bad bug in block_resize (Marius Rieder)
3
+ * Fix up some problems pointed out by clang
4
+ * Fix up the tests for small semantic differences in how libvirt works
5
+
1
6
  2016-09-22 0.7.0
2
7
  * Fix network lease API to allow arguments that libvirt allows
3
8
  * Implement VIRT_STORAGE_POOL_CREATE flags
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ require 'rubygems/package_task'
21
21
  require 'rbconfig'
22
22
 
23
23
  PKG_NAME='ruby-libvirt'
24
- PKG_VERSION='0.7.0'
24
+ PKG_VERSION='0.7.1'
25
25
 
26
26
  EXT_CONF='ext/libvirt/extconf.rb'
27
27
  MAKEFILE="ext/libvirt/Makefile"
@@ -660,7 +660,7 @@ static VALUE libvirt_conn_event_register_impl(int argc, VALUE *argv,
660
660
  static VALUE libvirt_domain_lxc_enter_security_label(int argc, VALUE *argv,
661
661
  VALUE RUBY_LIBVIRT_UNUSED(c))
662
662
  {
663
- VALUE model, label, flags, result, modiv, doiiv, labiv;
663
+ VALUE model = RUBY_Qnil, label = RUBY_Qnil, flags = RUBY_Qnil, result, modiv, doiiv, labiv;
664
664
  virSecurityModel mod;
665
665
  char *modstr, *doistr, *labstr;
666
666
  virSecurityLabel lab, oldlab;
@@ -123,7 +123,7 @@ void ruby_libvirt_raise_error_if(const int condition, VALUE error,
123
123
 
124
124
  #define ruby_libvirt_generate_call_list_all(type, argc, argv, listfunc, object, val, newfunc, freefunc) \
125
125
  do { \
126
- VALUE flags; \
126
+ VALUE flags = RUBY_Qnil; \
127
127
  type *list; \
128
128
  int i; \
129
129
  int ret; \
@@ -2780,7 +2780,7 @@ static VALUE libvirt_connect_domain_capabilities(int argc, VALUE *argv, VALUE c)
2780
2780
  */
2781
2781
  static VALUE libvirt_connect_node_free_pages(int argc, VALUE *argv, VALUE c)
2782
2782
  {
2783
- VALUE pageArr, cells, flags, result;
2783
+ VALUE pageArr = RUBY_Qnil, cells = RUBY_Qnil, flags = RUBY_Qnil, result;
2784
2784
  unsigned int *pages;
2785
2785
  unsigned int npages, i, cellCount;
2786
2786
  int startCell, ret;
@@ -2882,7 +2882,7 @@ static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
2882
2882
  ruby_libvirt_generate_call_nil(virDomainBlockResize,
2883
2883
  ruby_libvirt_connect_get(d),
2884
2884
  ruby_libvirt_domain_get(d),
2885
- StringValueCStr(size), NUM2ULL(size),
2885
+ StringValueCStr(disk), NUM2ULL(size),
2886
2886
  ruby_libvirt_value_to_uint(flags));
2887
2887
  }
2888
2888
  #endif
@@ -3338,7 +3338,7 @@ static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
3338
3338
  */
3339
3339
  static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
3340
3340
  {
3341
- VALUE disk, bandwidth, flags;
3341
+ VALUE disk, bandwidth = RUBY_Qnil, flags = RUBY_Qnil;
3342
3342
 
3343
3343
  rb_scan_args(argc, argv, "12", &disk, &bandwidth, &flags);
3344
3344
 
@@ -3407,7 +3407,7 @@ static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
3407
3407
  */
3408
3408
  static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
3409
3409
  {
3410
- VALUE disk, flags, result;
3410
+ VALUE disk, flags = RUBY_Qnil, result;
3411
3411
  virDomainBlockJobInfo info;
3412
3412
  int r;
3413
3413
 
@@ -3442,7 +3442,7 @@ static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
3442
3442
  */
3443
3443
  static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
3444
3444
  {
3445
- VALUE disk, flags;
3445
+ VALUE disk, flags = RUBY_Qnil;
3446
3446
 
3447
3447
  rb_scan_args(argc, argv, "11", &disk, &flags);
3448
3448
 
@@ -3508,7 +3508,7 @@ static const char *interface_set(VALUE d, unsigned int flags,
3508
3508
  */
3509
3509
  static VALUE libvirt_domain_interface_parameters(int argc, VALUE *argv, VALUE d)
3510
3510
  {
3511
- VALUE device, flags;
3511
+ VALUE device = RUBY_Qnil, flags = RUBY_Qnil;
3512
3512
 
3513
3513
  rb_scan_args(argc, argv, "11", &device, &flags);
3514
3514
 
@@ -3605,7 +3605,7 @@ static const char *block_stats_get(VALUE d, unsigned int flags,
3605
3605
  */
3606
3606
  static VALUE libvirt_domain_block_stats_flags(int argc, VALUE *argv, VALUE d)
3607
3607
  {
3608
- VALUE disk, flags;
3608
+ VALUE disk = RUBY_Qnil, flags = RUBY_Qnil;
3609
3609
 
3610
3610
  rb_scan_args(argc, argv, "11", &disk, &flags);
3611
3611
 
@@ -3666,7 +3666,7 @@ static const char *numa_set(VALUE d, unsigned int flags,
3666
3666
  */
3667
3667
  static VALUE libvirt_domain_numa_parameters(int argc, VALUE *argv, VALUE d)
3668
3668
  {
3669
- VALUE flags;
3669
+ VALUE flags = RUBY_Qnil;
3670
3670
 
3671
3671
  rb_scan_args(argc, argv, "01", &flags);
3672
3672
 
@@ -3714,7 +3714,7 @@ static VALUE libvirt_domain_numa_parameters_equal(VALUE d, VALUE in)
3714
3714
  */
3715
3715
  static VALUE libvirt_domain_lxc_open_namespace(int argc, VALUE *argv, VALUE d)
3716
3716
  {
3717
- VALUE flags, result;
3717
+ VALUE flags = RUBY_Qnil, result;
3718
3718
  int *fdlist = NULL;
3719
3719
  int ret, i, exception = 0;
3720
3720
  struct ruby_libvirt_ary_store_arg args;
@@ -3769,7 +3769,7 @@ error:
3769
3769
  */
3770
3770
  static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
3771
3771
  {
3772
- VALUE command, timeout, flags, result;
3772
+ VALUE command, timeout = RUBY_Qnil, flags = RUBY_Qnil, result;
3773
3773
  char *ret;
3774
3774
  int exception = 0;
3775
3775
 
@@ -3807,7 +3807,7 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
3807
3807
  */
3808
3808
  static VALUE libvirt_domain_lxc_enter_namespace(int argc, VALUE *argv, VALUE d)
3809
3809
  {
3810
- VALUE fds, flags, result;
3810
+ VALUE fds = RUBY_Qnil, flags = RUBY_Qnil, result;
3811
3811
  int *fdlist;
3812
3812
  int ret, exception = 0;
3813
3813
  int *oldfdlist;
@@ -3881,7 +3881,7 @@ static struct ruby_libvirt_typed_param migrate3_allowed[] = {
3881
3881
  */
3882
3882
  static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
3883
3883
  {
3884
- VALUE dconn, hash, flags;
3884
+ VALUE dconn = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
3885
3885
  virDomainPtr ddom = NULL;
3886
3886
  struct ruby_libvirt_parameter_assign_args args;
3887
3887
  unsigned long hashsize;
@@ -3925,7 +3925,7 @@ static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
3925
3925
  */
3926
3926
  static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
3927
3927
  {
3928
- VALUE duri, hash, flags;
3928
+ VALUE duri = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
3929
3929
  struct ruby_libvirt_parameter_assign_args args;
3930
3930
  unsigned long hashsize;
3931
3931
 
@@ -3971,7 +3971,7 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
3971
3971
  */
3972
3972
  static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
3973
3973
  {
3974
- VALUE start_cpu, numcpus, flags, result, tmp;
3974
+ VALUE start_cpu = RUBY_Qnil, numcpus = RUBY_Qnil, flags = RUBY_Qnil, result, tmp;
3975
3975
  int ret, nparams, j;
3976
3976
  unsigned int i;
3977
3977
  virTypedParameterPtr params;
@@ -4059,7 +4059,7 @@ static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
4059
4059
  */
4060
4060
  static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
4061
4061
  {
4062
- VALUE flags, result;
4062
+ VALUE flags = RUBY_Qnil, result;
4063
4063
  long long seconds;
4064
4064
  unsigned int nseconds;
4065
4065
  int ret;
@@ -4113,7 +4113,7 @@ static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
4113
4113
  */
4114
4114
  static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d)
4115
4115
  {
4116
- VALUE to, dumpformat, flags;
4116
+ VALUE to, dumpformat = RUBY_Qnil, flags = RUBY_Qnil;
4117
4117
 
4118
4118
  rb_scan_args(argc, argv, "21", &to, &dumpformat, &flags);
4119
4119
 
@@ -4136,7 +4136,7 @@ static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d
4136
4136
  */
4137
4137
  static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
4138
4138
  {
4139
- VALUE mountpoints, flags, entry;
4139
+ VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
4140
4140
  const char **mnt;
4141
4141
  unsigned int nmountpoints;
4142
4142
  int i;
@@ -4177,7 +4177,7 @@ static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
4177
4177
  */
4178
4178
  static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
4179
4179
  {
4180
- VALUE mountpoints, flags, entry;
4180
+ VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
4181
4181
  const char **mnt;
4182
4182
  unsigned int nmountpoints;
4183
4183
  int i;
@@ -4252,7 +4252,7 @@ static VALUE fs_info_wrap(VALUE arg)
4252
4252
  */
4253
4253
  static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
4254
4254
  {
4255
- VALUE flags, result;
4255
+ VALUE flags = RUBY_Qnil, result;
4256
4256
  virDomainFSInfoPtr *info;
4257
4257
  int ret, i = 0, exception;
4258
4258
  struct fs_info_arg args;
@@ -4291,7 +4291,7 @@ static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
4291
4291
  */
4292
4292
  static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
4293
4293
  {
4294
- VALUE flags, name;
4294
+ VALUE flags = RUBY_Qnil, name;
4295
4295
 
4296
4296
  rb_scan_args(argc, argv, "11", &name, &flags);
4297
4297
 
@@ -67,7 +67,7 @@ static VALUE libvirt_interface_undefine(VALUE i)
67
67
  */
68
68
  static VALUE libvirt_interface_create(int argc, VALUE *argv, VALUE i)
69
69
  {
70
- VALUE flags;
70
+ VALUE flags = RUBY_Qnil;
71
71
 
72
72
  rb_scan_args(argc, argv, "01", &flags);
73
73
 
@@ -86,7 +86,7 @@ static VALUE libvirt_interface_create(int argc, VALUE *argv, VALUE i)
86
86
  */
87
87
  static VALUE libvirt_interface_destroy(int argc, VALUE *argv, VALUE i)
88
88
  {
89
- VALUE flags;
89
+ VALUE flags = RUBY_Qnil;
90
90
 
91
91
  rb_scan_args(argc, argv, "01", &flags);
92
92
 
@@ -149,7 +149,7 @@ static VALUE libvirt_interface_mac(VALUE i)
149
149
  */
150
150
  static VALUE libvirt_interface_xml_desc(int argc, VALUE *argv, VALUE i)
151
151
  {
152
- VALUE flags;
152
+ VALUE flags = RUBY_Qnil;
153
153
 
154
154
  rb_scan_args(argc, argv, "01", &flags);
155
155
 
@@ -141,7 +141,7 @@ static VALUE libvirt_network_uuid(VALUE n)
141
141
  */
142
142
  static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
143
143
  {
144
- VALUE flags;
144
+ VALUE flags = RUBY_Qnil;
145
145
 
146
146
  rb_scan_args(argc, argv, "01", &flags);
147
147
 
@@ -301,7 +301,7 @@ static VALUE leases_wrap(VALUE arg)
301
301
  */
302
302
  static VALUE libvirt_network_get_dhcp_leases(int argc, VALUE *argv, VALUE n)
303
303
  {
304
- VALUE mac, flags, result;
304
+ VALUE mac = RUBY_Qnil, flags = RUBY_Qnil, result;
305
305
  int nleases, i = 0, exception = 0;
306
306
  virNetworkDHCPLeasePtr *leases = NULL;
307
307
  struct leases_arg args;
@@ -136,7 +136,7 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
136
136
  */
137
137
  static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
138
138
  {
139
- VALUE flags;
139
+ VALUE flags = RUBY_Qnil;
140
140
 
141
141
  rb_scan_args(argc, argv, "01", &flags);
142
142
 
@@ -155,7 +155,7 @@ static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
155
155
  */
156
156
  static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
157
157
  {
158
- VALUE driver, flags;
158
+ VALUE driver = RUBY_Qnil, flags = RUBY_Qnil;
159
159
 
160
160
  rb_scan_args(argc, argv, "02", &driver, &flags);
161
161
 
@@ -248,7 +248,7 @@ static VALUE libvirt_nodedevice_free(VALUE n)
248
248
  static VALUE libvirt_nodedevice_lookup_scsi_host_by_wwn(int argc, VALUE *argv,
249
249
  VALUE n)
250
250
  {
251
- VALUE wwnn, wwpn, flags;
251
+ VALUE wwnn, wwpn, flags = RUBY_Qnil;
252
252
  virNodeDevicePtr nd;
253
253
 
254
254
  rb_scan_args(argc, argv, "21", &wwnn, &wwpn, &flags);
@@ -94,7 +94,7 @@ static VALUE libvirt_nwfilter_uuid(VALUE n)
94
94
  */
95
95
  static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
96
96
  {
97
- VALUE flags;
97
+ VALUE flags = RUBY_Qnil;
98
98
 
99
99
  rb_scan_args(argc, argv, "01", &flags);
100
100
 
@@ -94,7 +94,7 @@ static VALUE libvirt_secret_usageid(VALUE s)
94
94
  */
95
95
  static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
96
96
  {
97
- VALUE flags;
97
+ VALUE flags = RUBY_Qnil;
98
98
 
99
99
  rb_scan_args(argc, argv, "01", &flags);
100
100
 
@@ -113,7 +113,7 @@ static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
113
113
  */
114
114
  static VALUE libvirt_secret_set_value(int argc, VALUE *argv, VALUE s)
115
115
  {
116
- VALUE flags, value;
116
+ VALUE flags = RUBY_Qnil, value;
117
117
 
118
118
  rb_scan_args(argc, argv, "11", &value, &flags);
119
119
 
@@ -173,7 +173,7 @@ static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
173
173
  */
174
174
  static VALUE libvirt_secret_value(int argc, VALUE *argv, VALUE s)
175
175
  {
176
- VALUE flags, ret;
176
+ VALUE flags = RUBY_Qnil, ret;
177
177
  unsigned char *val;
178
178
  size_t value_size;
179
179
  int exception = 0;
@@ -88,7 +88,7 @@ static VALUE libvirt_storage_vol_pool(VALUE v)
88
88
  */
89
89
  static VALUE libvirt_storage_pool_build(int argc, VALUE *argv, VALUE p)
90
90
  {
91
- VALUE flags;
91
+ VALUE flags = RUBY_Qnil;
92
92
 
93
93
  rb_scan_args(argc, argv, "01", &flags);
94
94
 
@@ -121,7 +121,7 @@ static VALUE libvirt_storage_pool_undefine(VALUE p)
121
121
  */
122
122
  static VALUE libvirt_storage_pool_create(int argc, VALUE *argv, VALUE p)
123
123
  {
124
- VALUE flags;
124
+ VALUE flags = RUBY_Qnil;
125
125
 
126
126
  rb_scan_args(argc, argv, "01", &flags);
127
127
 
@@ -155,7 +155,7 @@ static VALUE libvirt_storage_pool_destroy(VALUE p)
155
155
  */
156
156
  static VALUE libvirt_storage_pool_delete(int argc, VALUE *argv, VALUE p)
157
157
  {
158
- VALUE flags;
158
+ VALUE flags = RUBY_Qnil;
159
159
 
160
160
  rb_scan_args(argc, argv, "01", &flags);
161
161
 
@@ -174,7 +174,7 @@ static VALUE libvirt_storage_pool_delete(int argc, VALUE *argv, VALUE p)
174
174
  */
175
175
  static VALUE libvirt_storage_pool_refresh(int argc, VALUE *argv, VALUE p)
176
176
  {
177
- VALUE flags;
177
+ VALUE flags = RUBY_Qnil;
178
178
 
179
179
  rb_scan_args(argc, argv, "01", &flags);
180
180
 
@@ -247,7 +247,7 @@ static VALUE libvirt_storage_pool_info(VALUE p)
247
247
  */
248
248
  static VALUE libvirt_storage_pool_xml_desc(int argc, VALUE *argv, VALUE p)
249
249
  {
250
- VALUE flags;
250
+ VALUE flags = RUBY_Qnil;
251
251
 
252
252
  rb_scan_args(argc, argv, "01", &flags);
253
253
 
@@ -492,7 +492,7 @@ static VALUE libvirt_storage_pool_create_volume_xml(int argc, VALUE *argv,
492
492
  VALUE p)
493
493
  {
494
494
  virStorageVolPtr vol;
495
- VALUE xml, flags;
495
+ VALUE xml, flags = RUBY_Qnil;
496
496
 
497
497
  rb_scan_args(argc, argv, "11", &xml, &flags);
498
498
 
@@ -517,7 +517,7 @@ static VALUE libvirt_storage_pool_create_volume_xml_from(int argc, VALUE *argv,
517
517
  VALUE p)
518
518
  {
519
519
  virStorageVolPtr vol;
520
- VALUE xml, flags, cloneval;
520
+ VALUE xml, flags = RUBY_Qnil, cloneval = RUBY_Qnil;
521
521
 
522
522
  rb_scan_args(argc, argv, "21", &xml, &cloneval, &flags);
523
523
 
@@ -573,7 +573,7 @@ static VALUE libvirt_storage_pool_persistent_p(VALUE p)
573
573
  */
574
574
  static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
575
575
  {
576
- VALUE flags;
576
+ VALUE flags = RUBY_Qnil;
577
577
 
578
578
  rb_scan_args(argc, argv, "01", &flags);
579
579
 
@@ -593,7 +593,7 @@ static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
593
593
  */
594
594
  static VALUE libvirt_storage_vol_wipe(int argc, VALUE *argv, VALUE v)
595
595
  {
596
- VALUE flags;
596
+ VALUE flags = RUBY_Qnil;
597
597
 
598
598
  rb_scan_args(argc, argv, "01", &flags);
599
599
 
@@ -638,7 +638,7 @@ static VALUE libvirt_storage_vol_info(VALUE v)
638
638
  */
639
639
  static VALUE libvirt_storage_vol_xml_desc(int argc, VALUE *argv, VALUE v)
640
640
  {
641
- VALUE flags;
641
+ VALUE flags = RUBY_Qnil;
642
642
 
643
643
  rb_scan_args(argc, argv, "01", &flags);
644
644
 
@@ -686,7 +686,7 @@ static VALUE libvirt_storage_vol_free(VALUE v)
686
686
  */
687
687
  static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
688
688
  {
689
- VALUE st, offset, length, flags;
689
+ VALUE st = RUBY_Qnil, offset = RUBY_Qnil, length = RUBY_Qnil, flags = RUBY_Qnil;
690
690
 
691
691
  rb_scan_args(argc, argv, "31", &st, &offset, &length, &flags);
692
692
 
@@ -706,7 +706,7 @@ static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
706
706
  */
707
707
  static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
708
708
  {
709
- VALUE st, offset, length, flags;
709
+ VALUE st = RUBY_Qnil, offset = RUBY_Qnil, length = RUBY_Qnil, flags = RUBY_Qnil;
710
710
 
711
711
  rb_scan_args(argc, argv, "31", &st, &offset, &length, &flags);
712
712
 
@@ -728,7 +728,7 @@ static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
728
728
  */
729
729
  static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
730
730
  {
731
- VALUE alg, flags;
731
+ VALUE alg = RUBY_Qnil, flags = RUBY_Qnil;
732
732
 
733
733
  rb_scan_args(argc, argv, "11", &alg, &flags);
734
734
 
@@ -749,7 +749,7 @@ static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
749
749
  */
750
750
  static VALUE libvirt_storage_vol_resize(int argc, VALUE *argv, VALUE v)
751
751
  {
752
- VALUE capacity, flags;
752
+ VALUE capacity = RUBY_Qnil, flags = RUBY_Qnil;
753
753
 
754
754
  rb_scan_args(argc, argv, "11", &capacity, &flags);
755
755
 
@@ -149,7 +149,7 @@ static int internal_sendall(virStreamPtr RUBY_LIBVIRT_UNUSED(st), char *data,
149
149
  */
150
150
  static VALUE libvirt_stream_sendall(int argc, VALUE *argv, VALUE s)
151
151
  {
152
- VALUE opaque;
152
+ VALUE opaque = RUBY_Qnil;
153
153
  int ret;
154
154
 
155
155
  if (!rb_block_given_p()) {
@@ -192,7 +192,7 @@ static int internal_recvall(virStreamPtr RUBY_LIBVIRT_UNUSED(st),
192
192
  */
193
193
  static VALUE libvirt_stream_recvall(int argc, VALUE *argv, VALUE s)
194
194
  {
195
- VALUE opaque;
195
+ VALUE opaque = RUBY_Qnil;
196
196
  int ret;
197
197
 
198
198
  if (!rb_block_given_p()) {
@@ -259,7 +259,7 @@ static void stream_event_callback(virStreamPtr st, int events, void *opaque)
259
259
  */
260
260
  static VALUE libvirt_stream_event_add_callback(int argc, VALUE *argv, VALUE s)
261
261
  {
262
- VALUE events, callback, opaque, passthrough;
262
+ VALUE events = RUBY_Qnil, callback = RUBY_Qnil, opaque = RUBY_Qnil, passthrough;
263
263
  int ret;
264
264
 
265
265
  rb_scan_args(argc, argv, "21", &events, &callback, &opaque);
@@ -129,7 +129,7 @@ expect_fail(conn, ArgumentError, "empty array", "baseline_cpu", [])
129
129
  expect_success(conn, "CPU XML", "baseline_cpu", [cpu_xml])
130
130
 
131
131
  # TESTGROUP: conn.domain_event_register_any
132
- dom_event_callback_proc = lambda {|conn, dom, event, detail, opaque|
132
+ dom_event_callback_proc = lambda {|connect, dom, event, detail, opaque|
133
133
  }
134
134
 
135
135
  # 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
292
292
  newdom.undefine
293
293
 
294
294
  # TESTGROUP: conn.define_domain_xml
295
- expect_too_many_args(conn, "define_domain_xml", 1, 2)
295
+ expect_too_many_args(conn, "define_domain_xml", 1, 2, 3)
296
296
  expect_too_few_args(conn, "define_domain_xml")
297
297
  expect_invalid_arg_type(conn, "define_domain_xml", 1)
298
298
  expect_invalid_arg_type(conn, "define_domain_xml", nil)
@@ -19,6 +19,8 @@ cleanup_test_domain(conn)
19
19
 
20
20
  # setup for later tests
21
21
  `qemu-img create -f qcow2 #{$GUEST_DISK} 5G`
22
+ `qemu-img create -f raw #{$GUEST_RAW_DISK} 5G`
23
+
22
24
 
23
25
  new_hostdev_xml = <<EOF
24
26
  <hostdev mode='subsystem' type='pci' managed='yes'>
@@ -147,7 +149,7 @@ newdom.destroy
147
149
 
148
150
  # TESTGROUP: dom.send_key
149
151
  newdom = conn.create_domain_xml($new_dom_xml)
150
- sleep 30
152
+ sleep 1
151
153
 
152
154
  expect_too_many_args(newdom, "send_key", 1, 2, 3, 4)
153
155
  expect_too_few_args(newdom, "send_key")
@@ -318,7 +320,7 @@ newdom.destroy
318
320
  newdom = conn.create_domain_xml($new_dom_xml)
319
321
  sleep 1
320
322
 
321
- expect_success(newdom, "no args running domain", "resume")
323
+ expect_fail(newdom, Libvirt::Error, "already running", "resume")
322
324
 
323
325
  newdom.suspend
324
326
  expect_too_many_args(newdom, "resume", 1)
@@ -511,15 +513,15 @@ expect_invalid_arg_type(newdom, "block_peek", "foo", 0, "bar")
511
513
  expect_invalid_arg_type(newdom, "block_peek", "foo", 0, 512, "baz")
512
514
  expect_fail(newdom, Libvirt::RetrieveError, "invalid path", "block_peek", "foo", 0, 512)
513
515
 
514
- blockpeek = newdom.block_peek($GUEST_DISK, 0, 512)
516
+ # blockpeek = newdom.block_peek($GUEST_RAW_DISK, 0, 512)
515
517
 
516
- # 0x51 0x46 0x49 0xfb are the first 4 bytes of a qcow2 image
517
- if blockpeek[0].unpack('C')[0] != 0x51 or blockpeek[1].unpack('C')[0] != 0x46 or
518
- blockpeek[2].unpack('C')[0] != 0x49 or blockpeek[3].unpack('C')[0] != 0xfb
519
- puts_fail "domain.block_peek read did not return valid data"
520
- else
521
- puts_ok "domain.block_peek read valid data"
522
- end
518
+ # # 0x51 0x46 0x49 0xfb are the first 4 bytes of a qcow2 image
519
+ # if blockpeek[0].unpack('C')[0] != 0x51 or blockpeek[1].unpack('C')[0] != 0x46 or
520
+ # blockpeek[2].unpack('C')[0] != 0x49 or blockpeek[3].unpack('C')[0] != 0xfb
521
+ # puts_fail "domain.block_peek read did not return valid data"
522
+ # else
523
+ # puts_ok "domain.block_peek read valid data"
524
+ # end
523
525
 
524
526
  newdom.destroy
525
527
 
@@ -1406,6 +1408,7 @@ sleep 1
1406
1408
  # TESTGROUP: snapshot.parent
1407
1409
  newdom = conn.define_domain_xml($new_dom_xml)
1408
1410
  snap = newdom.snapshot_create_xml("<domainsnapshot/>")
1411
+ sleep 1
1409
1412
  snap2 = newdom.snapshot_create_xml("<domainsnapshot/>")
1410
1413
 
1411
1414
  expect_too_many_args(snap2, "parent", 1, 2)
@@ -88,7 +88,7 @@ expect_fail(st, RuntimeError, "no block given", "recvall")
88
88
  st.free
89
89
 
90
90
  # TESTGROUP: stream.event_add_callback
91
- st_event_callback_proc = lambda {|st,events,opaque|
91
+ st_event_callback_proc = lambda {|stream,events,opaque|
92
92
  }
93
93
 
94
94
  st = conn.stream
@@ -8,6 +8,7 @@ $GUEST_BASE = '/var/lib/libvirt/images/rb-libvirt-test'
8
8
  $GUEST_DISK = $GUEST_BASE + '.qcow2'
9
9
  $GUEST_SAVE = $GUEST_BASE + '.save'
10
10
  $GUEST_UUID = "93a5c045-6457-2c09-e56f-927cdf34e17a"
11
+ $GUEST_RAW_DISK = $GUEST_BASE + '.raw'
11
12
 
12
13
  # XML data for later tests
13
14
  $new_dom_xml = <<EOF
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.7.0
4
+ version: 0.7.1
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: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2018-02-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby bindings for libvirt.
14
14
  email: libvir-list@redhat.com
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project: None
80
- rubygems_version: 2.5.1
80
+ rubygems_version: 2.6.14
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Ruby bindings for LIBVIRT