ruby-libvirt 0.8.1 → 0.8.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
  SHA256:
3
- metadata.gz: fee786f1797ab1c5a5e8d496b387667786a5f703872a29125fbc0d43f6737b4b
4
- data.tar.gz: e79852df639e0ff830afae0918e2e5e3754e555eb2db8c9641b38cb834793091
3
+ metadata.gz: bf273ca7e41e36f188e254668c9c5811613941975b2fce9638f592026a96e7a6
4
+ data.tar.gz: 4802c02baa9233f4305a27705d52052d2bbea308d59d8db0c51444102368d33a
5
5
  SHA512:
6
- metadata.gz: f927ee0ed89539c2db5ae8aa955d4e03960b770e511bec78b5e46972ccc61f8e3d6bcf1d5c34efa84b3573b9f55365bdb6be52534ad7e3777b6d6b926d5001da
7
- data.tar.gz: 933864259c5b508f6956de0c5f99ba3a9ba3c741863e9f9e74fbe2d433f83e68fbf650725598f0c41c3df3c9abe51f3a717ccd27da547a57d359b86071379e03
6
+ metadata.gz: c1df9d3f345b3e89ed50820d139a4c64e0d0034271c5f5cf326d8385c5f957eef72bf9f27e9d7e9949f3ccba21bab7af5d079a7557ed4539b058477e179737e5
7
+ data.tar.gz: e5b4f69d58d2630df70e2f00ded49c116441f640ecb677070dbd5cbef97d9f6f597d75d9940baaeabae863e7ec43c1793fd33e71db79e0f7723b37752e90f204
data/NEWS CHANGED
@@ -1,3 +1,7 @@
1
+ 2024-02-09 0.8.1
2
+ * Fix StoragePool#list_all_volumes
3
+ * Fix regression in Domain#attach_device and Domain#detach_device
4
+
1
5
  2024-02-08 0.8.1
2
6
  * Add missing virDomainUndefineFlagsValues constants
3
7
  * Require libvirt 2.0.0
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.8.1'
24
+ PKG_VERSION='0.8.2'
25
25
 
26
26
  EXT_CONF='ext/libvirt/extconf.rb'
27
27
  MAKEFILE="ext/libvirt/Makefile"
data/ext/libvirt/domain.c CHANGED
@@ -1232,7 +1232,7 @@ static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
1232
1232
  * call-seq:
1233
1233
  * dom.attach_device(device_xml, flags=0) -> nil
1234
1234
  *
1235
- * Call virDomainAttachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice]
1235
+ * Call virDomainAttachDeviceFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDeviceFlags]
1236
1236
  * to attach the device described by the device_xml to the domain.
1237
1237
  */
1238
1238
  static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
@@ -1241,25 +1241,23 @@ static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
1241
1241
 
1242
1242
  rb_scan_args(argc, argv, "11", &xml, &flags);
1243
1243
 
1244
- if (ruby_libvirt_value_to_uint(flags) != 0) {
1245
- ruby_libvirt_generate_call_nil(virDomainAttachDeviceFlags,
1246
- ruby_libvirt_connect_get(d),
1247
- ruby_libvirt_domain_get(d),
1248
- StringValueCStr(xml),
1249
- ruby_libvirt_value_to_uint(flags));
1250
- } else {
1251
- ruby_libvirt_generate_call_nil(virDomainAttachDevice,
1252
- ruby_libvirt_connect_get(d),
1253
- ruby_libvirt_domain_get(d),
1254
- StringValueCStr(xml));
1255
- }
1244
+ /* NOTE: can't use virDomainAttachDevice() when flags==0 here
1245
+ * because that function only works on active domains and
1246
+ * VIR_DOMAIN_AFFECT_CURRENT==0.
1247
+ *
1248
+ * See https://gitlab.com/libvirt/libvirt-ruby/-/issues/11 */
1249
+ ruby_libvirt_generate_call_nil(virDomainAttachDeviceFlags,
1250
+ ruby_libvirt_connect_get(d),
1251
+ ruby_libvirt_domain_get(d),
1252
+ StringValueCStr(xml),
1253
+ ruby_libvirt_value_to_uint(flags));
1256
1254
  }
1257
1255
 
1258
1256
  /*
1259
1257
  * call-seq:
1260
1258
  * dom.detach_device(device_xml, flags=0) -> nil
1261
1259
  *
1262
- * Call virDomainDetachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice]
1260
+ * Call virDomainDetachDeviceFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceFlags]
1263
1261
  * to detach the device described by the device_xml from the domain.
1264
1262
  */
1265
1263
  static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
@@ -1268,18 +1266,16 @@ static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
1268
1266
 
1269
1267
  rb_scan_args(argc, argv, "11", &xml, &flags);
1270
1268
 
1271
- if (ruby_libvirt_value_to_uint(flags) != 0) {
1272
- ruby_libvirt_generate_call_nil(virDomainDetachDeviceFlags,
1273
- ruby_libvirt_connect_get(d),
1274
- ruby_libvirt_domain_get(d),
1275
- StringValueCStr(xml),
1276
- ruby_libvirt_value_to_uint(flags));
1277
- } else {
1278
- ruby_libvirt_generate_call_nil(virDomainDetachDevice,
1279
- ruby_libvirt_connect_get(d),
1280
- ruby_libvirt_domain_get(d),
1281
- StringValueCStr(xml));
1282
- }
1269
+ /* NOTE: can't use virDomainDetachDevice() when flags==0 here
1270
+ * because that function only works on active domains and
1271
+ * VIR_DOMAIN_AFFECT_CURRENT==0.
1272
+ *
1273
+ * See https://gitlab.com/libvirt/libvirt-ruby/-/issues/11 */
1274
+ ruby_libvirt_generate_call_nil(virDomainDetachDeviceFlags,
1275
+ ruby_libvirt_connect_get(d),
1276
+ ruby_libvirt_domain_get(d),
1277
+ StringValueCStr(xml),
1278
+ ruby_libvirt_value_to_uint(flags));
1283
1279
  }
1284
1280
 
1285
1281
  /*
@@ -442,8 +442,8 @@ static VALUE libvirt_storage_pool_list_all_volumes(int argc, VALUE *argv,
442
442
  {
443
443
  ruby_libvirt_generate_call_list_all(virStorageVolPtr, argc, argv,
444
444
  virStoragePoolListAllVolumes,
445
- pool_get(p), p, vol_new,
446
- virStorageVolFree);
445
+ pool_get(p), ruby_libvirt_conn_attr(p),
446
+ vol_new, virStorageVolFree);
447
447
  }
448
448
 
449
449
  /*
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.8.1
4
+ version: 0.8.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: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-02-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby bindings for libvirt.
14
14
  email: libvir-list@redhat.com