ruby-libvirt 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/NEWS +13 -0
- data/README +1 -1
- data/README.rdoc +1 -1
- data/Rakefile +3 -3
- data/ext/libvirt/_libvirt.c +10 -100
- data/ext/libvirt/common.c +9 -6
- data/ext/libvirt/common.h +1 -1
- data/ext/libvirt/connect.c +122 -358
- data/ext/libvirt/domain.c +267 -961
- data/ext/libvirt/extconf.h +0 -389
- data/ext/libvirt/extconf.rb +6 -490
- data/ext/libvirt/interface.c +8 -18
- data/ext/libvirt/network.c +15 -46
- data/ext/libvirt/nodedevice.c +22 -41
- data/ext/libvirt/nwfilter.c +5 -9
- data/ext/libvirt/secret.c +9 -20
- data/ext/libvirt/storage.c +36 -129
- data/ext/libvirt/stream.c +10 -14
- data/tests/test_domain.rb +2 -0
- data/tests/test_utils.rb +18 -0
- metadata +8 -9
data/ext/libvirt/storage.c
CHANGED
@@ -27,7 +27,6 @@
|
|
27
27
|
#include "extconf.h"
|
28
28
|
#include "stream.h"
|
29
29
|
|
30
|
-
#if HAVE_TYPE_VIRSTORAGEVOLPTR
|
31
30
|
/* this has to be here (as opposed to below with the rest of the volume
|
32
31
|
* stuff) because libvirt_storage_vol_get_pool() relies on it
|
33
32
|
*/
|
@@ -35,9 +34,7 @@ static virStorageVolPtr vol_get(VALUE v)
|
|
35
34
|
{
|
36
35
|
ruby_libvirt_get_struct(StorageVol, v);
|
37
36
|
}
|
38
|
-
#endif
|
39
37
|
|
40
|
-
#if HAVE_TYPE_VIRSTORAGEPOOLPTR
|
41
38
|
static VALUE c_storage_pool;
|
42
39
|
static VALUE c_storage_pool_info;
|
43
40
|
|
@@ -64,7 +61,7 @@ VALUE pool_new(virStoragePoolPtr p, VALUE conn)
|
|
64
61
|
* call-seq:
|
65
62
|
* vol.pool -> Libvirt::StoragePool
|
66
63
|
*
|
67
|
-
* Call virStoragePoolLookupByVolume[
|
64
|
+
* Call virStoragePoolLookupByVolume[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolLookupByVolume]
|
68
65
|
* to retrieve the storage pool for this volume.
|
69
66
|
*/
|
70
67
|
static VALUE libvirt_storage_vol_pool(VALUE v)
|
@@ -83,7 +80,7 @@ static VALUE libvirt_storage_vol_pool(VALUE v)
|
|
83
80
|
* call-seq:
|
84
81
|
* pool.build(flags=0) -> nil
|
85
82
|
*
|
86
|
-
* Call virStoragePoolBuild[
|
83
|
+
* Call virStoragePoolBuild[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolBuild]
|
87
84
|
* to build this storage pool.
|
88
85
|
*/
|
89
86
|
static VALUE libvirt_storage_pool_build(int argc, VALUE *argv, VALUE p)
|
@@ -102,7 +99,7 @@ static VALUE libvirt_storage_pool_build(int argc, VALUE *argv, VALUE p)
|
|
102
99
|
* call-seq:
|
103
100
|
* pool.undefine -> nil
|
104
101
|
*
|
105
|
-
* Call virStoragePoolUndefine[
|
102
|
+
* Call virStoragePoolUndefine[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolUndefine]
|
106
103
|
* to undefine this storage pool.
|
107
104
|
*/
|
108
105
|
static VALUE libvirt_storage_pool_undefine(VALUE p)
|
@@ -116,7 +113,7 @@ static VALUE libvirt_storage_pool_undefine(VALUE p)
|
|
116
113
|
* call-seq:
|
117
114
|
* pool.create(flags=0) -> nil
|
118
115
|
*
|
119
|
-
* Call virStoragePoolCreate[
|
116
|
+
* Call virStoragePoolCreate[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolCreate]
|
120
117
|
* to start this storage pool.
|
121
118
|
*/
|
122
119
|
static VALUE libvirt_storage_pool_create(int argc, VALUE *argv, VALUE p)
|
@@ -135,7 +132,7 @@ static VALUE libvirt_storage_pool_create(int argc, VALUE *argv, VALUE p)
|
|
135
132
|
* call-seq:
|
136
133
|
* pool.destroy -> nil
|
137
134
|
*
|
138
|
-
* Call virStoragePoolDestroy[
|
135
|
+
* Call virStoragePoolDestroy[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDestroy]
|
139
136
|
* to shutdown this storage pool.
|
140
137
|
*/
|
141
138
|
static VALUE libvirt_storage_pool_destroy(VALUE p)
|
@@ -149,7 +146,7 @@ static VALUE libvirt_storage_pool_destroy(VALUE p)
|
|
149
146
|
* call-seq:
|
150
147
|
* pool.delete(flags=0) -> nil
|
151
148
|
*
|
152
|
-
* Call virStoragePoolDelete[
|
149
|
+
* Call virStoragePoolDelete[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolDelete]
|
153
150
|
* to delete the data corresponding to this data pool. This is a destructive
|
154
151
|
* operation.
|
155
152
|
*/
|
@@ -169,7 +166,7 @@ static VALUE libvirt_storage_pool_delete(int argc, VALUE *argv, VALUE p)
|
|
169
166
|
* call-seq:
|
170
167
|
* pool.refresh(flags=0) -> nil
|
171
168
|
*
|
172
|
-
* Call virStoragePoolRefresh[
|
169
|
+
* Call virStoragePoolRefresh[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolRefresh]
|
173
170
|
* to refresh the list of volumes in this storage pool.
|
174
171
|
*/
|
175
172
|
static VALUE libvirt_storage_pool_refresh(int argc, VALUE *argv, VALUE p)
|
@@ -188,7 +185,7 @@ static VALUE libvirt_storage_pool_refresh(int argc, VALUE *argv, VALUE p)
|
|
188
185
|
* call-seq:
|
189
186
|
* pool.name -> String
|
190
187
|
*
|
191
|
-
* Call virStoragePoolGetName[
|
188
|
+
* Call virStoragePoolGetName[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetName]
|
192
189
|
* to retrieve the name of this storage pool.
|
193
190
|
*/
|
194
191
|
static VALUE libvirt_storage_pool_name(VALUE p)
|
@@ -202,7 +199,7 @@ static VALUE libvirt_storage_pool_name(VALUE p)
|
|
202
199
|
* call-seq:
|
203
200
|
* pool.uuid -> String
|
204
201
|
*
|
205
|
-
* Call virStoragePoolGetUUIDString[
|
202
|
+
* Call virStoragePoolGetUUIDString[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetUUIDString]
|
206
203
|
* to retrieve the UUID of this storage pool.
|
207
204
|
*/
|
208
205
|
static VALUE libvirt_storage_pool_uuid(VALUE p)
|
@@ -215,7 +212,7 @@ static VALUE libvirt_storage_pool_uuid(VALUE p)
|
|
215
212
|
* call-seq:
|
216
213
|
* pool.info -> Libvirt::StoragePoolInfo
|
217
214
|
*
|
218
|
-
* Call virStoragePoolGetInfo[
|
215
|
+
* Call virStoragePoolGetInfo[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetInfo]
|
219
216
|
* to retrieve information about this storage pool.
|
220
217
|
*/
|
221
218
|
static VALUE libvirt_storage_pool_info(VALUE p)
|
@@ -242,7 +239,7 @@ static VALUE libvirt_storage_pool_info(VALUE p)
|
|
242
239
|
* call-seq:
|
243
240
|
* pool.xml_desc(flags=0) -> String
|
244
241
|
*
|
245
|
-
* Call virStoragePoolGetXMLDesc[
|
242
|
+
* Call virStoragePoolGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetXMLDesc]
|
246
243
|
* to retrieve the XML for this storage pool.
|
247
244
|
*/
|
248
245
|
static VALUE libvirt_storage_pool_xml_desc(int argc, VALUE *argv, VALUE p)
|
@@ -261,7 +258,7 @@ static VALUE libvirt_storage_pool_xml_desc(int argc, VALUE *argv, VALUE p)
|
|
261
258
|
* call-seq:
|
262
259
|
* pool.autostart? -> [true|false]
|
263
260
|
*
|
264
|
-
* Call virStoragePoolGetAutostart[
|
261
|
+
* Call virStoragePoolGetAutostart[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetAutostart]
|
265
262
|
* to determine whether this storage pool will autostart when libvirtd starts.
|
266
263
|
*/
|
267
264
|
static VALUE libvirt_storage_pool_autostart(VALUE p)
|
@@ -280,7 +277,7 @@ static VALUE libvirt_storage_pool_autostart(VALUE p)
|
|
280
277
|
* call-seq:
|
281
278
|
* pool.autostart = [true|false]
|
282
279
|
*
|
283
|
-
* Call virStoragePoolSetAutostart[
|
280
|
+
* Call virStoragePoolSetAutostart[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolSetAutostart]
|
284
281
|
* to make this storage pool start when libvirtd starts.
|
285
282
|
*/
|
286
283
|
static VALUE libvirt_storage_pool_autostart_equal(VALUE p, VALUE autostart)
|
@@ -299,7 +296,7 @@ static VALUE libvirt_storage_pool_autostart_equal(VALUE p, VALUE autostart)
|
|
299
296
|
* call-seq:
|
300
297
|
* pool.num_of_volumes -> Fixnum
|
301
298
|
*
|
302
|
-
* Call virStoragePoolNumOfVolumes[
|
299
|
+
* Call virStoragePoolNumOfVolumes[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolNumOfVolumes]
|
303
300
|
* to retrieve the number of volumes in this storage pool.
|
304
301
|
*/
|
305
302
|
static VALUE libvirt_storage_pool_num_of_volumes(VALUE p)
|
@@ -318,7 +315,7 @@ static VALUE libvirt_storage_pool_num_of_volumes(VALUE p)
|
|
318
315
|
* call-seq:
|
319
316
|
* pool.list_volumes -> list
|
320
317
|
*
|
321
|
-
* Call virStoragePoolListVolumes[
|
318
|
+
* Call virStoragePoolListVolumes[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListVolumes]
|
322
319
|
* to retrieve a list of volume names in this storage pools.
|
323
320
|
*/
|
324
321
|
static VALUE libvirt_storage_pool_list_volumes(VALUE p)
|
@@ -347,7 +344,7 @@ static VALUE libvirt_storage_pool_list_volumes(VALUE p)
|
|
347
344
|
* call-seq:
|
348
345
|
* pool.free -> nil
|
349
346
|
*
|
350
|
-
* Call virStoragePoolFree[
|
347
|
+
* Call virStoragePoolFree[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolFree]
|
351
348
|
* to free this storage pool object. After this call the storage pool object
|
352
349
|
* is no longer valid.
|
353
350
|
*/
|
@@ -355,9 +352,7 @@ static VALUE libvirt_storage_pool_free(VALUE p)
|
|
355
352
|
{
|
356
353
|
ruby_libvirt_generate_call_free(StoragePool, p);
|
357
354
|
}
|
358
|
-
#endif
|
359
355
|
|
360
|
-
#if HAVE_TYPE_VIRSTORAGEVOLPTR
|
361
356
|
/*
|
362
357
|
* Libvirt::StorageVol
|
363
358
|
*/
|
@@ -378,7 +373,7 @@ static VALUE vol_new(virStorageVolPtr v, VALUE conn)
|
|
378
373
|
* call-seq:
|
379
374
|
* pool.lookup_volume_by_name(name) -> Libvirt::StorageVol
|
380
375
|
*
|
381
|
-
* Call virStorageVolLookupByName[
|
376
|
+
* Call virStorageVolLookupByName[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByName]
|
382
377
|
* to retrieve a storage volume object by name.
|
383
378
|
*/
|
384
379
|
static VALUE libvirt_storage_pool_lookup_vol_by_name(VALUE p, VALUE name)
|
@@ -397,7 +392,7 @@ static VALUE libvirt_storage_pool_lookup_vol_by_name(VALUE p, VALUE name)
|
|
397
392
|
* call-seq:
|
398
393
|
* pool.lookup_volume_by_key(key) -> Libvirt::StorageVol
|
399
394
|
*
|
400
|
-
* Call virStorageVolLookupByKey[
|
395
|
+
* Call virStorageVolLookupByKey[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByKey]
|
401
396
|
* to retrieve a storage volume object by key.
|
402
397
|
*/
|
403
398
|
static VALUE libvirt_storage_pool_lookup_vol_by_key(VALUE p, VALUE key)
|
@@ -418,7 +413,7 @@ static VALUE libvirt_storage_pool_lookup_vol_by_key(VALUE p, VALUE key)
|
|
418
413
|
* call-seq:
|
419
414
|
* pool.lookup_volume_by_path(path) -> Libvirt::StorageVol
|
420
415
|
*
|
421
|
-
* Call virStorageVolLookupByPath[
|
416
|
+
* Call virStorageVolLookupByPath[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookupByPath]
|
422
417
|
* to retrieve a storage volume object by path.
|
423
418
|
*/
|
424
419
|
static VALUE libvirt_storage_pool_lookup_vol_by_path(VALUE p, VALUE path)
|
@@ -435,12 +430,11 @@ static VALUE libvirt_storage_pool_lookup_vol_by_path(VALUE p, VALUE path)
|
|
435
430
|
return vol_new(vol, ruby_libvirt_conn_attr(p));
|
436
431
|
}
|
437
432
|
|
438
|
-
#if HAVE_VIRSTORAGEPOOLLISTALLVOLUMES
|
439
433
|
/*
|
440
434
|
* call-seq:
|
441
435
|
* pool.list_all_volumes(flags=0) -> Array
|
442
436
|
*
|
443
|
-
* Call virStoragePoolListAllVolumes[
|
437
|
+
* Call virStoragePoolListAllVolumes[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolListAllVolumes]
|
444
438
|
* to get an array of volume objects for all volumes.
|
445
439
|
*/
|
446
440
|
static VALUE libvirt_storage_pool_list_all_volumes(int argc, VALUE *argv,
|
@@ -451,13 +445,12 @@ static VALUE libvirt_storage_pool_list_all_volumes(int argc, VALUE *argv,
|
|
451
445
|
pool_get(p), p, vol_new,
|
452
446
|
virStorageVolFree);
|
453
447
|
}
|
454
|
-
#endif
|
455
448
|
|
456
449
|
/*
|
457
450
|
* call-seq:
|
458
451
|
* vol.name -> String
|
459
452
|
*
|
460
|
-
* Call virStorageVolGetName[
|
453
|
+
* Call virStorageVolGetName[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetName]
|
461
454
|
* to retrieve the name of this storage volume.
|
462
455
|
*/
|
463
456
|
static VALUE libvirt_storage_vol_name(VALUE v)
|
@@ -471,7 +464,7 @@ static VALUE libvirt_storage_vol_name(VALUE v)
|
|
471
464
|
* call-seq:
|
472
465
|
* vol.key -> String
|
473
466
|
*
|
474
|
-
* Call virStorageVolGetKey[
|
467
|
+
* Call virStorageVolGetKey[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetKey]
|
475
468
|
* to retrieve the key for this storage volume.
|
476
469
|
*/
|
477
470
|
static VALUE libvirt_storage_vol_key(VALUE v)
|
@@ -485,7 +478,7 @@ static VALUE libvirt_storage_vol_key(VALUE v)
|
|
485
478
|
* call-seq:
|
486
479
|
* pool.create_volume_xml(xml, flags=0) -> Libvirt::StorageVol
|
487
480
|
*
|
488
|
-
* Call virStorageVolCreateXML[
|
481
|
+
* Call virStorageVolCreateXML[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXML]
|
489
482
|
* to create a new storage volume from xml.
|
490
483
|
*/
|
491
484
|
static VALUE libvirt_storage_pool_create_volume_xml(int argc, VALUE *argv,
|
@@ -504,12 +497,11 @@ static VALUE libvirt_storage_pool_create_volume_xml(int argc, VALUE *argv,
|
|
504
497
|
return vol_new(vol, ruby_libvirt_conn_attr(p));
|
505
498
|
}
|
506
499
|
|
507
|
-
#if HAVE_VIRSTORAGEVOLCREATEXMLFROM
|
508
500
|
/*
|
509
501
|
* call-seq:
|
510
502
|
* pool.create_volume_xml_from(xml, clonevol, flags=0) -> Libvirt::StorageVol
|
511
503
|
*
|
512
|
-
* Call virStorageVolCreateXMLFrom[
|
504
|
+
* Call virStorageVolCreateXMLFrom[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXMLFrom]
|
513
505
|
* to clone a volume from an existing volume with the properties specified in
|
514
506
|
* xml.
|
515
507
|
*/
|
@@ -530,14 +522,12 @@ static VALUE libvirt_storage_pool_create_volume_xml_from(int argc, VALUE *argv,
|
|
530
522
|
|
531
523
|
return vol_new(vol, ruby_libvirt_conn_attr(p));
|
532
524
|
}
|
533
|
-
#endif
|
534
525
|
|
535
|
-
#if HAVE_VIRSTORAGEPOOLISACTIVE
|
536
526
|
/*
|
537
527
|
* call-seq:
|
538
528
|
* pool.active? -> [true|false]
|
539
529
|
*
|
540
|
-
* Call virStoragePoolIsActive[
|
530
|
+
* Call virStoragePoolIsActive[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsActive]
|
541
531
|
* to determine if this storage pool is active.
|
542
532
|
*/
|
543
533
|
static VALUE libvirt_storage_pool_active_p(VALUE p)
|
@@ -546,14 +536,12 @@ static VALUE libvirt_storage_pool_active_p(VALUE p)
|
|
546
536
|
ruby_libvirt_connect_get(p),
|
547
537
|
pool_get(p));
|
548
538
|
}
|
549
|
-
#endif
|
550
539
|
|
551
|
-
#if HAVE_VIRSTORAGEPOOLISPERSISTENT
|
552
540
|
/*
|
553
541
|
* call-seq:
|
554
542
|
* pool.persistent? -> [true|false]
|
555
543
|
*
|
556
|
-
* Call virStoragePoolIsPersistent[
|
544
|
+
* Call virStoragePoolIsPersistent[https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolIsPersistent]
|
557
545
|
* to determine if this storage pool is persistent.
|
558
546
|
*/
|
559
547
|
static VALUE libvirt_storage_pool_persistent_p(VALUE p)
|
@@ -562,13 +550,12 @@ static VALUE libvirt_storage_pool_persistent_p(VALUE p)
|
|
562
550
|
ruby_libvirt_connect_get(p),
|
563
551
|
pool_get(p));
|
564
552
|
}
|
565
|
-
#endif
|
566
553
|
|
567
554
|
/*
|
568
555
|
* call-seq:
|
569
556
|
* vol.delete(flags=0) -> nil
|
570
557
|
*
|
571
|
-
* Call virStorageVolDelete[
|
558
|
+
* Call virStorageVolDelete[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDelete]
|
572
559
|
* to delete this volume. This is a destructive operation.
|
573
560
|
*/
|
574
561
|
static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
|
@@ -583,12 +570,11 @@ static VALUE libvirt_storage_vol_delete(int argc, VALUE *argv, VALUE v)
|
|
583
570
|
ruby_libvirt_value_to_uint(flags));
|
584
571
|
}
|
585
572
|
|
586
|
-
#if HAVE_VIRSTORAGEVOLWIPE
|
587
573
|
/*
|
588
574
|
* call-seq:
|
589
575
|
* vol.wipe(flags=0) -> nil
|
590
576
|
*
|
591
|
-
* Call virStorageVolWipe[
|
577
|
+
* Call virStorageVolWipe[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipe]
|
592
578
|
* to wipe the data from this storage volume. This is a destructive operation.
|
593
579
|
*/
|
594
580
|
static VALUE libvirt_storage_vol_wipe(int argc, VALUE *argv, VALUE v)
|
@@ -602,13 +588,12 @@ static VALUE libvirt_storage_vol_wipe(int argc, VALUE *argv, VALUE v)
|
|
602
588
|
vol_get(v),
|
603
589
|
ruby_libvirt_value_to_uint(flags));
|
604
590
|
}
|
605
|
-
#endif
|
606
591
|
|
607
592
|
/*
|
608
593
|
* call-seq:
|
609
594
|
* vol.info -> Libvirt::StorageVolInfo
|
610
595
|
*
|
611
|
-
* Call virStorageVolGetInfo[
|
596
|
+
* Call virStorageVolGetInfo[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetInfo]
|
612
597
|
* to retrieve information about this storage volume.
|
613
598
|
*/
|
614
599
|
static VALUE libvirt_storage_vol_info(VALUE v)
|
@@ -633,7 +618,7 @@ static VALUE libvirt_storage_vol_info(VALUE v)
|
|
633
618
|
* call-seq:
|
634
619
|
* vol.xml_desc(flags=0) -> String
|
635
620
|
*
|
636
|
-
* Call virStorageVolGetXMLDesc[
|
621
|
+
* Call virStorageVolGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetXMLDesc]
|
637
622
|
* to retrieve the xml for this storage volume.
|
638
623
|
*/
|
639
624
|
static VALUE libvirt_storage_vol_xml_desc(int argc, VALUE *argv, VALUE v)
|
@@ -652,7 +637,7 @@ static VALUE libvirt_storage_vol_xml_desc(int argc, VALUE *argv, VALUE v)
|
|
652
637
|
* call-seq:
|
653
638
|
* vol.path -> String
|
654
639
|
*
|
655
|
-
* Call virStorageVolGetPath[
|
640
|
+
* Call virStorageVolGetPath[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolGetPath]
|
656
641
|
* to retrieve the path for this storage volume.
|
657
642
|
*/
|
658
643
|
static VALUE libvirt_storage_vol_path(VALUE v)
|
@@ -666,7 +651,7 @@ static VALUE libvirt_storage_vol_path(VALUE v)
|
|
666
651
|
* call-seq:
|
667
652
|
* vol.free -> nil
|
668
653
|
*
|
669
|
-
* Call virStorageVolFree[
|
654
|
+
* Call virStorageVolFree[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolFree]
|
670
655
|
* to free the storage volume object. After this call the storage volume object
|
671
656
|
* is no longer valid.
|
672
657
|
*/
|
@@ -674,14 +659,12 @@ static VALUE libvirt_storage_vol_free(VALUE v)
|
|
674
659
|
{
|
675
660
|
ruby_libvirt_generate_call_free(StorageVol, v);
|
676
661
|
}
|
677
|
-
#endif
|
678
662
|
|
679
|
-
#if HAVE_VIRSTORAGEVOLDOWNLOAD
|
680
663
|
/*
|
681
664
|
* call-seq:
|
682
665
|
* vol.download(stream, offset, length, flags=0) -> nil
|
683
666
|
*
|
684
|
-
* Call virStorageVolDownload[
|
667
|
+
* Call virStorageVolDownload[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolDownload]
|
685
668
|
* to download the content of a volume as a stream.
|
686
669
|
*/
|
687
670
|
static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
|
@@ -701,7 +684,7 @@ static VALUE libvirt_storage_vol_download(int argc, VALUE *argv, VALUE v)
|
|
701
684
|
* call-seq:
|
702
685
|
* vol.upload(stream, offset, length, flags=0) -> nil
|
703
686
|
*
|
704
|
-
* Call virStorageVolUpload[
|
687
|
+
* Call virStorageVolUpload[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolUpload]
|
705
688
|
* to upload new content to a volume from a stream.
|
706
689
|
*/
|
707
690
|
static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
|
@@ -716,14 +699,12 @@ static VALUE libvirt_storage_vol_upload(int argc, VALUE *argv, VALUE v)
|
|
716
699
|
NUM2ULL(offset), NUM2ULL(length),
|
717
700
|
ruby_libvirt_value_to_uint(flags));
|
718
701
|
}
|
719
|
-
#endif
|
720
702
|
|
721
|
-
#if HAVE_VIRSTORAGEVOLWIPEPATTERN
|
722
703
|
/*
|
723
704
|
* call-seq:
|
724
705
|
* vol.wipe_pattern(alg, flags=0) -> nil
|
725
706
|
*
|
726
|
-
* Call virStorageVolWipePattern[
|
707
|
+
* Call virStorageVolWipePattern[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolWipePattern]
|
727
708
|
* to wipe the data from this storage volume. This is a destructive operation.
|
728
709
|
*/
|
729
710
|
static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
|
@@ -737,14 +718,12 @@ static VALUE libvirt_storage_vol_wipe_pattern(int argc, VALUE *argv, VALUE v)
|
|
737
718
|
vol_get(v), NUM2UINT(alg),
|
738
719
|
ruby_libvirt_value_to_uint(flags));
|
739
720
|
}
|
740
|
-
#endif
|
741
721
|
|
742
|
-
#if HAVE_VIRSTORAGEVOLRESIZE
|
743
722
|
/*
|
744
723
|
* call-seq:
|
745
724
|
* vol.resize(capacity, flags=0) -> nil
|
746
725
|
*
|
747
|
-
* Call virStorageVolResize[
|
726
|
+
* Call virStorageVolResize[https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolResize]
|
748
727
|
* to resize the associated storage volume.
|
749
728
|
*/
|
750
729
|
static VALUE libvirt_storage_vol_resize(int argc, VALUE *argv, VALUE v)
|
@@ -758,14 +737,12 @@ static VALUE libvirt_storage_vol_resize(int argc, VALUE *argv, VALUE v)
|
|
758
737
|
vol_get(v), NUM2ULL(capacity),
|
759
738
|
ruby_libvirt_value_to_uint(flags));
|
760
739
|
}
|
761
|
-
#endif
|
762
740
|
|
763
741
|
void ruby_libvirt_storage_init(void)
|
764
742
|
{
|
765
743
|
/*
|
766
744
|
* Class Libvirt::StoragePool and Libvirt::StoragePoolInfo
|
767
745
|
*/
|
768
|
-
#if HAVE_TYPE_VIRSTORAGEPOOLPTR
|
769
746
|
c_storage_pool_info = rb_define_class_under(m_libvirt, "StoragePoolInfo",
|
770
747
|
rb_cObject);
|
771
748
|
rb_define_attr(c_storage_pool_info, "state", 1, 0);
|
@@ -787,15 +764,11 @@ void ruby_libvirt_storage_init(void)
|
|
787
764
|
INT2NUM(VIR_STORAGE_POOL_RUNNING));
|
788
765
|
rb_define_const(c_storage_pool, "DEGRADED",
|
789
766
|
INT2NUM(VIR_STORAGE_POOL_DEGRADED));
|
790
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_INACCESSIBLE
|
791
767
|
rb_define_const(c_storage_pool, "INACCESSIBLE",
|
792
768
|
INT2NUM(VIR_STORAGE_POOL_INACCESSIBLE));
|
793
|
-
#endif
|
794
769
|
|
795
|
-
#if HAVE_CONST_VIR_STORAGE_XML_INACTIVE
|
796
770
|
rb_define_const(c_storage_pool, "XML_INACTIVE",
|
797
771
|
INT2NUM(VIR_STORAGE_XML_INACTIVE));
|
798
|
-
#endif
|
799
772
|
|
800
773
|
/* virStoragePoolBuildFlags */
|
801
774
|
rb_define_const(c_storage_pool, "BUILD_NEW",
|
@@ -811,31 +784,19 @@ void ruby_libvirt_storage_init(void)
|
|
811
784
|
rb_define_const(c_storage_pool, "DELETE_ZEROED",
|
812
785
|
INT2NUM(VIR_STORAGE_POOL_DELETE_ZEROED));
|
813
786
|
|
814
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
|
815
787
|
rb_define_const(c_storage_pool, "CREATE_PREALLOC_METADATA",
|
816
788
|
INT2NUM(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA));
|
817
|
-
#endif
|
818
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_CREATE_REFLINK
|
819
789
|
rb_define_const(c_storage_pool, "CREATE_REFLINK",
|
820
790
|
INT2NUM(VIR_STORAGE_VOL_CREATE_REFLINK));
|
821
|
-
#endif
|
822
791
|
|
823
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_CREATE_NORMAL
|
824
792
|
rb_define_const(c_storage_pool, "CREATE_NORMAL",
|
825
793
|
INT2NUM(VIR_STORAGE_POOL_CREATE_NORMAL));
|
826
|
-
#endif
|
827
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_CREATE_WITH_BUILD
|
828
794
|
rb_define_const(c_storage_pool, "CREATE_WITH_BUILD",
|
829
795
|
INT2NUM(VIR_STORAGE_POOL_CREATE_WITH_BUILD));
|
830
|
-
#endif
|
831
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE
|
832
796
|
rb_define_const(c_storage_pool, "CREATE_WITH_BUILD_OVERWRITE",
|
833
797
|
INT2NUM(VIR_STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE));
|
834
|
-
#endif
|
835
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE
|
836
798
|
rb_define_const(c_storage_pool, "CREATE_WITH_BUILD_NO_OVERWRITE",
|
837
799
|
INT2NUM(VIR_STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE));
|
838
|
-
#endif
|
839
800
|
|
840
801
|
/* Creating/destroying pools */
|
841
802
|
rb_define_method(c_storage_pool, "build", libvirt_storage_pool_build, -1);
|
@@ -875,39 +836,23 @@ void ruby_libvirt_storage_init(void)
|
|
875
836
|
rb_define_method(c_storage_pool, "create_volume_xml",
|
876
837
|
libvirt_storage_pool_create_volume_xml, -1);
|
877
838
|
rb_define_alias(c_storage_pool, "create_vol_xml", "create_volume_xml");
|
878
|
-
#if HAVE_VIRSTORAGEVOLCREATEXMLFROM
|
879
839
|
rb_define_method(c_storage_pool, "create_volume_xml_from",
|
880
840
|
libvirt_storage_pool_create_volume_xml_from, -1);
|
881
841
|
rb_define_alias(c_storage_pool, "create_vol_xml_from",
|
882
842
|
"create_volume_xml_from");
|
883
|
-
#endif
|
884
|
-
#if HAVE_VIRSTORAGEPOOLISACTIVE
|
885
843
|
rb_define_method(c_storage_pool, "active?", libvirt_storage_pool_active_p,
|
886
844
|
0);
|
887
|
-
#endif
|
888
|
-
#if HAVE_VIRSTORAGEPOOLISPERSISTENT
|
889
845
|
rb_define_method(c_storage_pool, "persistent?",
|
890
846
|
libvirt_storage_pool_persistent_p, 0);
|
891
|
-
#endif
|
892
847
|
|
893
|
-
#if HAVE_VIRSTORAGEPOOLLISTALLVOLUMES
|
894
848
|
rb_define_method(c_storage_pool, "list_all_volumes",
|
895
849
|
libvirt_storage_pool_list_all_volumes, -1);
|
896
|
-
#endif
|
897
850
|
|
898
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_BUILD_NO_OVERWRITE
|
899
851
|
rb_define_const(c_storage_pool, "BUILD_NO_OVERWRITE",
|
900
852
|
INT2NUM(VIR_STORAGE_POOL_BUILD_NO_OVERWRITE));
|
901
|
-
#endif
|
902
|
-
|
903
|
-
#if HAVE_CONST_VIR_STORAGE_POOL_BUILD_OVERWRITE
|
904
853
|
rb_define_const(c_storage_pool, "BUILD_OVERWRITE",
|
905
854
|
INT2NUM(VIR_STORAGE_POOL_BUILD_OVERWRITE));
|
906
|
-
#endif
|
907
|
-
|
908
|
-
#endif
|
909
855
|
|
910
|
-
#if HAVE_TYPE_VIRSTORAGEVOLPTR
|
911
856
|
/*
|
912
857
|
* Class Libvirt::StorageVol and Libvirt::StorageVolInfo
|
913
858
|
*/
|
@@ -920,81 +865,49 @@ void ruby_libvirt_storage_init(void)
|
|
920
865
|
c_storage_vol = rb_define_class_under(m_libvirt, "StorageVol",
|
921
866
|
rb_cObject);
|
922
867
|
|
923
|
-
#if HAVE_CONST_VIR_STORAGE_XML_INACTIVE
|
924
868
|
rb_define_const(c_storage_vol, "XML_INACTIVE",
|
925
869
|
INT2NUM(VIR_STORAGE_XML_INACTIVE));
|
926
|
-
#endif
|
927
870
|
|
928
871
|
/* virStorageVolType */
|
929
872
|
rb_define_const(c_storage_vol, "FILE", INT2NUM(VIR_STORAGE_VOL_FILE));
|
930
873
|
rb_define_const(c_storage_vol, "BLOCK", INT2NUM(VIR_STORAGE_VOL_BLOCK));
|
931
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_DIR
|
932
874
|
rb_define_const(c_storage_vol, "DIR", INT2NUM(VIR_STORAGE_VOL_DIR));
|
933
|
-
#endif
|
934
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_NETWORK
|
935
875
|
rb_define_const(c_storage_vol, "NETWORK", INT2NUM(VIR_STORAGE_VOL_NETWORK));
|
936
|
-
#endif
|
937
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_NETDIR
|
938
876
|
rb_define_const(c_storage_vol, "NETDIR", INT2NUM(VIR_STORAGE_VOL_NETDIR));
|
939
|
-
#endif
|
940
877
|
|
941
878
|
/* virStorageVolDeleteFlags */
|
942
879
|
rb_define_const(c_storage_vol, "DELETE_NORMAL",
|
943
880
|
INT2NUM(VIR_STORAGE_VOL_DELETE_NORMAL));
|
944
881
|
rb_define_const(c_storage_vol, "DELETE_ZEROED",
|
945
882
|
INT2NUM(VIR_STORAGE_VOL_DELETE_ZEROED));
|
946
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS
|
947
883
|
rb_define_const(c_storage_vol, "DELETE_WITH_SNAPSHOTS",
|
948
884
|
INT2NUM(VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS));
|
949
|
-
#endif
|
950
885
|
|
951
886
|
rb_define_method(c_storage_vol, "pool", libvirt_storage_vol_pool, 0);
|
952
887
|
rb_define_method(c_storage_vol, "name", libvirt_storage_vol_name, 0);
|
953
888
|
rb_define_method(c_storage_vol, "key", libvirt_storage_vol_key, 0);
|
954
889
|
rb_define_method(c_storage_vol, "delete", libvirt_storage_vol_delete, -1);
|
955
|
-
#if HAVE_VIRSTORAGEVOLWIPE
|
956
890
|
rb_define_method(c_storage_vol, "wipe", libvirt_storage_vol_wipe, -1);
|
957
|
-
#endif
|
958
|
-
#if HAVE_VIRSTORAGEVOLWIPEPATTERN
|
959
891
|
rb_define_method(c_storage_vol, "wipe_pattern",
|
960
892
|
libvirt_storage_vol_wipe_pattern, -1);
|
961
|
-
#endif
|
962
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_ZERO
|
963
893
|
rb_define_const(c_storage_vol, "WIPE_ALG_ZERO",
|
964
894
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_ZERO));
|
965
|
-
#endif
|
966
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_NNSA
|
967
895
|
rb_define_const(c_storage_vol, "WIPE_ALG_NNSA",
|
968
896
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_NNSA));
|
969
|
-
#endif
|
970
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_DOD
|
971
897
|
rb_define_const(c_storage_vol, "WIPE_ALG_DOD",
|
972
898
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_DOD));
|
973
|
-
#endif
|
974
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_BSI
|
975
899
|
rb_define_const(c_storage_vol, "WIPE_ALG_BSI",
|
976
900
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_BSI));
|
977
|
-
#endif
|
978
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_GUTMANN
|
979
901
|
rb_define_const(c_storage_vol, "WIPE_ALG_GUTMANN",
|
980
902
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_GUTMANN));
|
981
|
-
#endif
|
982
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER
|
983
903
|
rb_define_const(c_storage_vol, "WIPE_ALG_SCHNEIER",
|
984
904
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER));
|
985
|
-
#endif
|
986
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7
|
987
905
|
rb_define_const(c_storage_vol, "WIPE_ALG_PFITZNER7",
|
988
906
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7));
|
989
|
-
#endif
|
990
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33
|
991
907
|
rb_define_const(c_storage_vol, "WIPE_ALG_PFITZNER33",
|
992
908
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33));
|
993
|
-
#endif
|
994
|
-
#if HAVE_CONST_VIR_STORAGE_VOL_WIPE_ALG_RANDOM
|
995
909
|
rb_define_const(c_storage_vol, "WIPE_ALG_RANDOM",
|
996
910
|
INT2NUM(VIR_STORAGE_VOL_WIPE_ALG_RANDOM));
|
997
|
-
#endif
|
998
911
|
|
999
912
|
rb_define_method(c_storage_vol, "info", libvirt_storage_vol_info, 0);
|
1000
913
|
rb_define_method(c_storage_vol, "xml_desc", libvirt_storage_vol_xml_desc,
|
@@ -1002,13 +915,10 @@ void ruby_libvirt_storage_init(void)
|
|
1002
915
|
rb_define_method(c_storage_vol, "path", libvirt_storage_vol_path, 0);
|
1003
916
|
rb_define_method(c_storage_vol, "free", libvirt_storage_vol_free, 0);
|
1004
917
|
|
1005
|
-
#if HAVE_VIRSTORAGEVOLDOWNLOAD
|
1006
918
|
rb_define_method(c_storage_vol, "download", libvirt_storage_vol_download,
|
1007
919
|
-1);
|
1008
920
|
rb_define_method(c_storage_vol, "upload", libvirt_storage_vol_upload, -1);
|
1009
|
-
#endif
|
1010
921
|
|
1011
|
-
#if HAVE_VIRSTORAGEVOLRESIZE
|
1012
922
|
rb_define_const(c_storage_vol, "RESIZE_ALLOCATE",
|
1013
923
|
INT2NUM(VIR_STORAGE_VOL_RESIZE_ALLOCATE));
|
1014
924
|
rb_define_const(c_storage_vol, "RESIZE_DELTA",
|
@@ -1016,7 +926,4 @@ void ruby_libvirt_storage_init(void)
|
|
1016
926
|
rb_define_const(c_storage_vol, "RESIZE_SHRINK",
|
1017
927
|
INT2NUM(VIR_STORAGE_VOL_RESIZE_SHRINK));
|
1018
928
|
rb_define_method(c_storage_vol, "resize", libvirt_storage_vol_resize, -1);
|
1019
|
-
#endif
|
1020
|
-
|
1021
|
-
#endif
|
1022
929
|
}
|