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/network.c
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
#include "connect.h"
|
27
27
|
#include "extconf.h"
|
28
28
|
|
29
|
-
#if HAVE_TYPE_VIRNETWORKPTR
|
30
29
|
static VALUE c_network;
|
31
30
|
|
32
31
|
static void network_free(void *d)
|
@@ -48,7 +47,7 @@ VALUE ruby_libvirt_network_new(virNetworkPtr n, VALUE conn)
|
|
48
47
|
* call-seq:
|
49
48
|
* net.undefine -> nil
|
50
49
|
*
|
51
|
-
* Call virNetworkUndefine[
|
50
|
+
* Call virNetworkUndefine[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUndefine]
|
52
51
|
* to undefine this network.
|
53
52
|
*/
|
54
53
|
static VALUE libvirt_network_undefine(VALUE n)
|
@@ -62,7 +61,7 @@ static VALUE libvirt_network_undefine(VALUE n)
|
|
62
61
|
* call-seq:
|
63
62
|
* net.create -> nil
|
64
63
|
*
|
65
|
-
* Call virNetworkCreate[
|
64
|
+
* Call virNetworkCreate[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreate]
|
66
65
|
* to start this network.
|
67
66
|
*/
|
68
67
|
static VALUE libvirt_network_create(VALUE n)
|
@@ -72,12 +71,11 @@ static VALUE libvirt_network_create(VALUE n)
|
|
72
71
|
network_get(n));
|
73
72
|
}
|
74
73
|
|
75
|
-
#if HAVE_VIRNETWORKUPDATE
|
76
74
|
/*
|
77
75
|
* call-seq:
|
78
76
|
* net.update -> nil
|
79
77
|
*
|
80
|
-
* Call virNetworkUpdate[
|
78
|
+
* Call virNetworkUpdate[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkUpdate]
|
81
79
|
* to update this network.
|
82
80
|
*/
|
83
81
|
static VALUE libvirt_network_update(VALUE n, VALUE command, VALUE section,
|
@@ -89,13 +87,12 @@ static VALUE libvirt_network_update(VALUE n, VALUE command, VALUE section,
|
|
89
87
|
NUM2UINT(section), NUM2INT(index),
|
90
88
|
StringValuePtr(xml), NUM2UINT(flags));
|
91
89
|
}
|
92
|
-
#endif
|
93
90
|
|
94
91
|
/*
|
95
92
|
* call-seq:
|
96
93
|
* net.destroy -> nil
|
97
94
|
*
|
98
|
-
* Call virNetworkDestroy[
|
95
|
+
* Call virNetworkDestroy[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDestroy]
|
99
96
|
* to shutdown this network.
|
100
97
|
*/
|
101
98
|
static VALUE libvirt_network_destroy(VALUE n)
|
@@ -109,7 +106,7 @@ static VALUE libvirt_network_destroy(VALUE n)
|
|
109
106
|
* call-seq:
|
110
107
|
* net.name -> String
|
111
108
|
*
|
112
|
-
* Call virNetworkGetName[
|
109
|
+
* Call virNetworkGetName[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetName]
|
113
110
|
* to retrieve the name of this network.
|
114
111
|
*/
|
115
112
|
static VALUE libvirt_network_name(VALUE n)
|
@@ -123,7 +120,7 @@ static VALUE libvirt_network_name(VALUE n)
|
|
123
120
|
* call-seq:
|
124
121
|
* net.uuid -> String
|
125
122
|
*
|
126
|
-
* Call virNetworkGetUUIDString[
|
123
|
+
* Call virNetworkGetUUIDString[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUIDString]
|
127
124
|
* to retrieve the UUID of this network.
|
128
125
|
*/
|
129
126
|
static VALUE libvirt_network_uuid(VALUE n)
|
@@ -136,7 +133,7 @@ static VALUE libvirt_network_uuid(VALUE n)
|
|
136
133
|
* call-seq:
|
137
134
|
* net.xml_desc(flags=0) -> String
|
138
135
|
*
|
139
|
-
* Call virNetworkGetXMLDesc[
|
136
|
+
* Call virNetworkGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetXMLDesc]
|
140
137
|
* to retrieve the XML for this network.
|
141
138
|
*/
|
142
139
|
static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
|
@@ -155,7 +152,7 @@ static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
|
|
155
152
|
* call-seq:
|
156
153
|
* net.bridge_name -> String
|
157
154
|
*
|
158
|
-
* Call virNetworkGetBridgeName[
|
155
|
+
* Call virNetworkGetBridgeName[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetBridgeName]
|
159
156
|
* to retrieve the bridge name for this network.
|
160
157
|
*/
|
161
158
|
static VALUE libvirt_network_bridge_name(VALUE n)
|
@@ -169,7 +166,7 @@ static VALUE libvirt_network_bridge_name(VALUE n)
|
|
169
166
|
* call-seq:
|
170
167
|
* net.autostart? -> [true|false]
|
171
168
|
*
|
172
|
-
* Call virNetworkGetAutostart[
|
169
|
+
* Call virNetworkGetAutostart[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetAutostart]
|
173
170
|
* to determine if this network will be autostarted when libvirtd starts.
|
174
171
|
*/
|
175
172
|
static VALUE libvirt_network_autostart(VALUE n)
|
@@ -187,7 +184,7 @@ static VALUE libvirt_network_autostart(VALUE n)
|
|
187
184
|
* call-seq:
|
188
185
|
* net.autostart = [true|false]
|
189
186
|
*
|
190
|
-
* Call virNetworkSetAutostart[
|
187
|
+
* Call virNetworkSetAutostart[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkSetAutostart]
|
191
188
|
* to set this network to be autostarted when libvirtd starts.
|
192
189
|
*/
|
193
190
|
static VALUE libvirt_network_autostart_equal(VALUE n, VALUE autostart)
|
@@ -206,7 +203,7 @@ static VALUE libvirt_network_autostart_equal(VALUE n, VALUE autostart)
|
|
206
203
|
* call-seq:
|
207
204
|
* net.free -> nil
|
208
205
|
*
|
209
|
-
* Call virNetworkFree[
|
206
|
+
* Call virNetworkFree[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkFree]
|
210
207
|
* to free this network. The object will no longer be valid after this call.
|
211
208
|
*/
|
212
209
|
static VALUE libvirt_network_free(VALUE n)
|
@@ -214,12 +211,11 @@ static VALUE libvirt_network_free(VALUE n)
|
|
214
211
|
ruby_libvirt_generate_call_free(Network, n);
|
215
212
|
}
|
216
213
|
|
217
|
-
#if HAVE_VIRNETWORKISACTIVE
|
218
214
|
/*
|
219
215
|
* call-seq:
|
220
216
|
* net.active? -> [true|false]
|
221
217
|
*
|
222
|
-
* Call virNetworkIsActive[
|
218
|
+
* Call virNetworkIsActive[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsActive]
|
223
219
|
* to determine if this network is currently active.
|
224
220
|
*/
|
225
221
|
static VALUE libvirt_network_active_p(VALUE n)
|
@@ -228,14 +224,12 @@ static VALUE libvirt_network_active_p(VALUE n)
|
|
228
224
|
ruby_libvirt_connect_get(n),
|
229
225
|
network_get(n));
|
230
226
|
}
|
231
|
-
#endif
|
232
227
|
|
233
|
-
#if HAVE_VIRNETWORKISPERSISTENT
|
234
228
|
/*
|
235
229
|
* call-seq:
|
236
230
|
* net.persistent? -> [true|false]
|
237
231
|
*
|
238
|
-
* Call virNetworkIsPersistent[
|
232
|
+
* Call virNetworkIsPersistent[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsPersistent]
|
239
233
|
* to determine if this network is persistent.
|
240
234
|
*/
|
241
235
|
static VALUE libvirt_network_persistent_p(VALUE n)
|
@@ -244,9 +238,7 @@ static VALUE libvirt_network_persistent_p(VALUE n)
|
|
244
238
|
ruby_libvirt_connect_get(n),
|
245
239
|
network_get(n));
|
246
240
|
}
|
247
|
-
#endif
|
248
241
|
|
249
|
-
#if HAVE_VIRNETWORKGETDHCPLEASES
|
250
242
|
struct leases_arg {
|
251
243
|
virNetworkDHCPLeasePtr *leases;
|
252
244
|
int nleases;
|
@@ -296,7 +288,7 @@ static VALUE leases_wrap(VALUE arg)
|
|
296
288
|
* call-seq:
|
297
289
|
* net.dhcp_leases(mac=nil, flags=0) -> Hash
|
298
290
|
*
|
299
|
-
* Call virNetworkGetDHCPLeases[
|
291
|
+
* Call virNetworkGetDHCPLeases[https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLeases]
|
300
292
|
* to retrieve the leases for this network.
|
301
293
|
*/
|
302
294
|
static VALUE libvirt_network_get_dhcp_leases(int argc, VALUE *argv, VALUE n)
|
@@ -330,24 +322,19 @@ static VALUE libvirt_network_get_dhcp_leases(int argc, VALUE *argv, VALUE n)
|
|
330
322
|
|
331
323
|
return result;
|
332
324
|
}
|
333
|
-
#endif
|
334
|
-
|
335
|
-
#endif
|
336
325
|
|
337
326
|
/*
|
338
327
|
* Class Libvirt::Network
|
339
328
|
*/
|
340
329
|
void ruby_libvirt_network_init(void)
|
341
330
|
{
|
342
|
-
#if HAVE_TYPE_VIRNETWORKPTR
|
343
331
|
c_network = rb_define_class_under(m_libvirt, "Network", rb_cObject);
|
344
332
|
rb_define_attr(c_network, "connection", 1, 0);
|
345
333
|
|
346
334
|
rb_define_method(c_network, "undefine", libvirt_network_undefine, 0);
|
347
335
|
rb_define_method(c_network, "create", libvirt_network_create, 0);
|
348
|
-
#if HAVE_VIRNETWORKUPDATE
|
349
336
|
rb_define_method(c_network, "update", libvirt_network_update, 5);
|
350
|
-
|
337
|
+
|
351
338
|
rb_define_method(c_network, "destroy", libvirt_network_destroy, 0);
|
352
339
|
rb_define_method(c_network, "name", libvirt_network_name, 0);
|
353
340
|
rb_define_method(c_network, "uuid", libvirt_network_uuid, 0);
|
@@ -358,13 +345,8 @@ void ruby_libvirt_network_init(void)
|
|
358
345
|
rb_define_method(c_network, "autostart=", libvirt_network_autostart_equal,
|
359
346
|
1);
|
360
347
|
rb_define_method(c_network, "free", libvirt_network_free, 0);
|
361
|
-
#if HAVE_VIRNETWORKISACTIVE
|
362
348
|
rb_define_method(c_network, "active?", libvirt_network_active_p, 0);
|
363
|
-
#endif
|
364
|
-
#if HAVE_VIRNETWORKISPERSISTENT
|
365
349
|
rb_define_method(c_network, "persistent?", libvirt_network_persistent_p, 0);
|
366
|
-
#endif
|
367
|
-
#if HAVE_CONST_VIR_NETWORK_UPDATE_COMMAND_NONE
|
368
350
|
/* Ideally we would just have the "UPDATE_COMMAND_NONE" constant.
|
369
351
|
* Unfortunately we screwed up long ago, and we have to
|
370
352
|
* leave "NETWORK_UPDATE_COMMAND_NONE" for backwards compatibility.
|
@@ -525,31 +507,18 @@ void ruby_libvirt_network_init(void)
|
|
525
507
|
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CONFIG));
|
526
508
|
rb_define_const(c_network, "NETWORK_UPDATE_AFFECT_CONFIG",
|
527
509
|
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CONFIG));
|
528
|
-
#endif
|
529
510
|
|
530
|
-
#if HAVE_CONST_VIR_NETWORK_XML_INACTIVE
|
531
511
|
rb_define_const(c_network, "XML_INACTIVE",
|
532
512
|
INT2NUM(VIR_NETWORK_XML_INACTIVE));
|
533
|
-
#endif
|
534
|
-
#if HAVE_CONST_VIR_NETWORK_UPDATE_COMMAND_DELETE
|
535
513
|
rb_define_const(c_network, "UPDATE_COMMAND_DELETE",
|
536
514
|
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_DELETE));
|
537
|
-
#endif
|
538
515
|
|
539
|
-
#if HAVE_VIRNETWORKGETDHCPLEASES
|
540
516
|
rb_define_method(c_network, "dhcp_leases",
|
541
517
|
libvirt_network_get_dhcp_leases, -1);
|
542
|
-
#endif
|
543
518
|
|
544
|
-
#if HAVE_CONST_VIR_IP_ADDR_TYPE_IPV4
|
545
519
|
rb_define_const(c_network, "IP_ADDR_TYPE_IPV4",
|
546
520
|
INT2NUM(VIR_IP_ADDR_TYPE_IPV4));
|
547
|
-
#endif
|
548
521
|
|
549
|
-
#if HAVE_CONST_VIR_IP_ADDR_TYPE_IPV6
|
550
522
|
rb_define_const(c_network, "IP_ADDR_TYPE_IPV6",
|
551
523
|
INT2NUM(VIR_IP_ADDR_TYPE_IPV6));
|
552
|
-
#endif
|
553
|
-
|
554
|
-
#endif
|
555
524
|
}
|
data/ext/libvirt/nodedevice.c
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
#include "connect.h"
|
27
27
|
#include "extconf.h"
|
28
28
|
|
29
|
-
#if HAVE_TYPE_VIRNODEDEVICEPTR
|
30
29
|
static VALUE c_nodedevice;
|
31
30
|
|
32
31
|
static void nodedevice_free(void *s)
|
@@ -48,7 +47,7 @@ VALUE ruby_libvirt_nodedevice_new(virNodeDevicePtr n, VALUE conn)
|
|
48
47
|
* call-seq:
|
49
48
|
* nodedevice.name -> String
|
50
49
|
*
|
51
|
-
* Call virNodeDeviceGetName[
|
50
|
+
* Call virNodeDeviceGetName[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetName]
|
52
51
|
* to retrieve the name of the node device.
|
53
52
|
*/
|
54
53
|
static VALUE libvirt_nodedevice_name(VALUE c)
|
@@ -62,7 +61,7 @@ static VALUE libvirt_nodedevice_name(VALUE c)
|
|
62
61
|
* call-seq:
|
63
62
|
* nodedevice.parent -> String
|
64
63
|
*
|
65
|
-
* Call virNodeDeviceGetParent[
|
64
|
+
* Call virNodeDeviceGetParent[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetParent]
|
66
65
|
* to retrieve the parent of the node device.
|
67
66
|
*/
|
68
67
|
static VALUE libvirt_nodedevice_parent(VALUE c)
|
@@ -87,7 +86,7 @@ static VALUE libvirt_nodedevice_parent(VALUE c)
|
|
87
86
|
* call-seq:
|
88
87
|
* nodedevice.num_of_caps -> Fixnum
|
89
88
|
*
|
90
|
-
* Call virNodeDeviceNumOfCaps[
|
89
|
+
* Call virNodeDeviceNumOfCaps[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceNumOfCaps]
|
91
90
|
* to retrieve the number of capabilities of the node device.
|
92
91
|
*/
|
93
92
|
static VALUE libvirt_nodedevice_num_of_caps(VALUE c)
|
@@ -101,7 +100,7 @@ static VALUE libvirt_nodedevice_num_of_caps(VALUE c)
|
|
101
100
|
* call-seq:
|
102
101
|
* nodedevice.list_caps -> list
|
103
102
|
*
|
104
|
-
* Call virNodeDeviceListCaps[
|
103
|
+
* Call virNodeDeviceListCaps[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceListCaps]
|
105
104
|
* to retrieve a list of capabilities of the node device.
|
106
105
|
*/
|
107
106
|
static VALUE libvirt_nodedevice_list_caps(VALUE c)
|
@@ -131,7 +130,7 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
|
|
131
130
|
* call-seq:
|
132
131
|
* nodedevice.xml_desc(flags=0) -> String
|
133
132
|
*
|
134
|
-
* Call virNodeDeviceGetXMLDesc[
|
133
|
+
* Call virNodeDeviceGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetXMLDesc]
|
135
134
|
* to retrieve the XML for the node device.
|
136
135
|
*/
|
137
136
|
static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
|
@@ -150,7 +149,7 @@ static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
|
|
150
149
|
* call-seq:
|
151
150
|
* nodedevice.detach(driver=nil, flags=0) -> nil
|
152
151
|
*
|
153
|
-
* Call virNodeDeviceDettach[
|
152
|
+
* Call virNodeDeviceDettach[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDettach]
|
154
153
|
* to detach the node device from the node.
|
155
154
|
*/
|
156
155
|
static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
|
@@ -159,32 +158,25 @@ static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
|
|
159
158
|
|
160
159
|
rb_scan_args(argc, argv, "02", &driver, &flags);
|
161
160
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
if (ruby_libvirt_get_cstring_or_null(driver) != NULL) {
|
174
|
-
rb_raise(e_NoSupportError, "Non-NULL driver not supported");
|
161
|
+
if (ruby_libvirt_value_to_uint(flags) != 0 ||
|
162
|
+
ruby_libvirt_get_cstring_or_null(driver) != NULL) {
|
163
|
+
ruby_libvirt_generate_call_nil(virNodeDeviceDetachFlags,
|
164
|
+
ruby_libvirt_connect_get(n),
|
165
|
+
nodedevice_get(n),
|
166
|
+
ruby_libvirt_get_cstring_or_null(driver),
|
167
|
+
ruby_libvirt_value_to_uint(flags));
|
168
|
+
} else {
|
169
|
+
ruby_libvirt_generate_call_nil(virNodeDeviceDettach,
|
170
|
+
ruby_libvirt_connect_get(n),
|
171
|
+
nodedevice_get(n));
|
175
172
|
}
|
176
|
-
|
177
|
-
ruby_libvirt_generate_call_nil(virNodeDeviceDettach,
|
178
|
-
ruby_libvirt_connect_get(n),
|
179
|
-
nodedevice_get(n));
|
180
|
-
#endif
|
181
173
|
}
|
182
174
|
|
183
175
|
/*
|
184
176
|
* call-seq:
|
185
177
|
* nodedevice.reattach -> nil
|
186
178
|
*
|
187
|
-
* Call virNodeDeviceReAttach[
|
179
|
+
* Call virNodeDeviceReAttach[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach]
|
188
180
|
* to reattach the node device to the node.
|
189
181
|
*/
|
190
182
|
static VALUE libvirt_nodedevice_reattach(VALUE n)
|
@@ -198,7 +190,7 @@ static VALUE libvirt_nodedevice_reattach(VALUE n)
|
|
198
190
|
* call-seq:
|
199
191
|
* nodedevice.reset -> nil
|
200
192
|
*
|
201
|
-
* Call virNodeDeviceReset[
|
193
|
+
* Call virNodeDeviceReset[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset]
|
202
194
|
* to reset the node device.
|
203
195
|
*/
|
204
196
|
static VALUE libvirt_nodedevice_reset(VALUE n)
|
@@ -208,12 +200,11 @@ static VALUE libvirt_nodedevice_reset(VALUE n)
|
|
208
200
|
nodedevice_get(n));
|
209
201
|
}
|
210
202
|
|
211
|
-
#if HAVE_VIRNODEDEVICEDESTROY
|
212
203
|
/*
|
213
204
|
* call-seq:
|
214
205
|
* nodedevice.destroy -> nil
|
215
206
|
*
|
216
|
-
* Call virNodeDeviceDestroy[
|
207
|
+
* Call virNodeDeviceDestroy[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDestroy]
|
217
208
|
* to shutdown the node device.
|
218
209
|
*/
|
219
210
|
static VALUE libvirt_nodedevice_destroy(VALUE n)
|
@@ -222,13 +213,12 @@ static VALUE libvirt_nodedevice_destroy(VALUE n)
|
|
222
213
|
ruby_libvirt_connect_get(n),
|
223
214
|
nodedevice_get(n));
|
224
215
|
}
|
225
|
-
#endif
|
226
216
|
|
227
217
|
/*
|
228
218
|
* call-seq:
|
229
219
|
* nodedevice.free -> nil
|
230
220
|
*
|
231
|
-
* Call virNodeDeviceFree[
|
221
|
+
* Call virNodeDeviceFree[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceFree]
|
232
222
|
* to free the node device object. After this call the node device object is
|
233
223
|
* no longer valid.
|
234
224
|
*/
|
@@ -237,12 +227,11 @@ static VALUE libvirt_nodedevice_free(VALUE n)
|
|
237
227
|
ruby_libvirt_generate_call_free(NodeDevice, n);
|
238
228
|
}
|
239
229
|
|
240
|
-
#if HAVE_VIRNODEDEVICELOOKUPSCSIHOSTBYWWN
|
241
230
|
/*
|
242
231
|
* call-seq:
|
243
232
|
* nodedevice.lookup_scsi_host_by_wwn(wwnn, wwpn, flags=0) -> Libvirt::NodeDevice
|
244
233
|
*
|
245
|
-
* Call virNodeDeviceLookupSCSIHostByWWN[
|
234
|
+
* Call virNodeDeviceLookupSCSIHostByWWN[https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupSCSIHostByWWN]
|
246
235
|
* to look up a SCSI host by its WWNN and WWPN.
|
247
236
|
*/
|
248
237
|
static VALUE libvirt_nodedevice_lookup_scsi_host_by_wwn(int argc, VALUE *argv,
|
@@ -263,16 +252,13 @@ static VALUE libvirt_nodedevice_lookup_scsi_host_by_wwn(int argc, VALUE *argv,
|
|
263
252
|
|
264
253
|
return ruby_libvirt_nodedevice_new(nd, ruby_libvirt_conn_attr(n));
|
265
254
|
}
|
266
|
-
#endif
|
267
255
|
|
268
|
-
#endif
|
269
256
|
|
270
257
|
/*
|
271
258
|
* Class Libvirt::NodeDevice
|
272
259
|
*/
|
273
260
|
void ruby_libvirt_nodedevice_init(void)
|
274
261
|
{
|
275
|
-
#if HAVE_TYPE_VIRNODEDEVICEPTR
|
276
262
|
c_nodedevice = rb_define_class_under(m_libvirt, "NodeDevice", rb_cObject);
|
277
263
|
|
278
264
|
rb_define_attr(c_nodedevice, "connection", 1, 0);
|
@@ -287,13 +273,8 @@ void ruby_libvirt_nodedevice_init(void)
|
|
287
273
|
rb_define_method(c_nodedevice, "detach", libvirt_nodedevice_detach, -1);
|
288
274
|
rb_define_method(c_nodedevice, "reattach", libvirt_nodedevice_reattach, 0);
|
289
275
|
rb_define_method(c_nodedevice, "reset", libvirt_nodedevice_reset, 0);
|
290
|
-
#if HAVE_VIRNODEDEVICEDESTROY
|
291
276
|
rb_define_method(c_nodedevice, "destroy", libvirt_nodedevice_destroy, 0);
|
292
|
-
#endif
|
293
277
|
rb_define_method(c_nodedevice, "free", libvirt_nodedevice_free, 0);
|
294
|
-
#if HAVE_VIRNODEDEVICELOOKUPSCSIHOSTBYWWN
|
295
278
|
rb_define_method(c_nodedevice, "lookup_scsi_host_by_wwn",
|
296
279
|
libvirt_nodedevice_lookup_scsi_host_by_wwn, -1);
|
297
|
-
#endif
|
298
|
-
#endif
|
299
280
|
}
|
data/ext/libvirt/nwfilter.c
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
#include "connect.h"
|
27
27
|
#include "extconf.h"
|
28
28
|
|
29
|
-
#if HAVE_TYPE_VIRNWFILTERPTR
|
30
29
|
static VALUE c_nwfilter;
|
31
30
|
|
32
31
|
static void nwfilter_free(void *n)
|
@@ -48,7 +47,7 @@ VALUE ruby_libvirt_nwfilter_new(virNWFilterPtr n, VALUE conn)
|
|
48
47
|
* call-seq:
|
49
48
|
* nwfilter.undefine -> nil
|
50
49
|
*
|
51
|
-
* Call virNWFilterUndefine[
|
50
|
+
* Call virNWFilterUndefine[https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterUndefine]
|
52
51
|
* to undefine the network filter.
|
53
52
|
*/
|
54
53
|
static VALUE libvirt_nwfilter_undefine(VALUE n)
|
@@ -62,7 +61,7 @@ static VALUE libvirt_nwfilter_undefine(VALUE n)
|
|
62
61
|
* call-seq:
|
63
62
|
* nwfilter.name -> String
|
64
63
|
*
|
65
|
-
* Call virNWFilterGetName[
|
64
|
+
* Call virNWFilterGetName[https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetName]
|
66
65
|
* to retrieve the network filter name.
|
67
66
|
*/
|
68
67
|
static VALUE libvirt_nwfilter_name(VALUE n)
|
@@ -76,7 +75,7 @@ static VALUE libvirt_nwfilter_name(VALUE n)
|
|
76
75
|
* call-seq:
|
77
76
|
* nwfilter.uuid -> String
|
78
77
|
*
|
79
|
-
* Call virNWFilterGetUUIDString[
|
78
|
+
* Call virNWFilterGetUUIDString[https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUIDString]
|
80
79
|
* to retrieve the network filter UUID.
|
81
80
|
*/
|
82
81
|
static VALUE libvirt_nwfilter_uuid(VALUE n)
|
@@ -89,7 +88,7 @@ static VALUE libvirt_nwfilter_uuid(VALUE n)
|
|
89
88
|
* call-seq:
|
90
89
|
* nwfilter.xml_desc(flags=0) -> String
|
91
90
|
*
|
92
|
-
* Call virNWFilterGetXMLDesc[
|
91
|
+
* Call virNWFilterGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetXMLDesc]
|
93
92
|
* to retrieve the XML for this network filter.
|
94
93
|
*/
|
95
94
|
static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
|
@@ -108,7 +107,7 @@ static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
|
|
108
107
|
* call-seq:
|
109
108
|
* nwfilter.free -> nil
|
110
109
|
*
|
111
|
-
* Call virNWFilterFree[
|
110
|
+
* Call virNWFilterFree[https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterFree]
|
112
111
|
* to free this network filter. After this call the network filter object is
|
113
112
|
* no longer valid.
|
114
113
|
*/
|
@@ -117,14 +116,12 @@ static VALUE libvirt_nwfilter_free(VALUE n)
|
|
117
116
|
ruby_libvirt_generate_call_free(NWFilter, n);
|
118
117
|
}
|
119
118
|
|
120
|
-
#endif
|
121
119
|
|
122
120
|
/*
|
123
121
|
* Class Libvirt::NWFilter
|
124
122
|
*/
|
125
123
|
void ruby_libvirt_nwfilter_init(void)
|
126
124
|
{
|
127
|
-
#if HAVE_TYPE_VIRNWFILTERPTR
|
128
125
|
c_nwfilter = rb_define_class_under(m_libvirt, "NWFilter", rb_cObject);
|
129
126
|
rb_define_attr(c_nwfilter, "connection", 1, 0);
|
130
127
|
|
@@ -134,5 +131,4 @@ void ruby_libvirt_nwfilter_init(void)
|
|
134
131
|
rb_define_method(c_nwfilter, "uuid", libvirt_nwfilter_uuid, 0);
|
135
132
|
rb_define_method(c_nwfilter, "xml_desc", libvirt_nwfilter_xml_desc, -1);
|
136
133
|
rb_define_method(c_nwfilter, "free", libvirt_nwfilter_free, 0);
|
137
|
-
#endif
|
138
134
|
}
|
data/ext/libvirt/secret.c
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
#include "connect.h"
|
27
27
|
#include "extconf.h"
|
28
28
|
|
29
|
-
#if HAVE_TYPE_VIRSECRETPTR
|
30
29
|
static VALUE c_secret;
|
31
30
|
|
32
31
|
static void secret_free(void *s)
|
@@ -48,7 +47,7 @@ VALUE ruby_libvirt_secret_new(virSecretPtr s, VALUE conn)
|
|
48
47
|
* call-seq:
|
49
48
|
* secret.uuid -> String
|
50
49
|
*
|
51
|
-
* Call virSecretGetUUIDString[
|
50
|
+
* Call virSecretGetUUIDString[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUIDString]
|
52
51
|
* to retrieve the UUID for this secret.
|
53
52
|
*/
|
54
53
|
static VALUE libvirt_secret_uuid(VALUE s)
|
@@ -61,7 +60,7 @@ static VALUE libvirt_secret_uuid(VALUE s)
|
|
61
60
|
* call-seq:
|
62
61
|
* secret.usagetype -> Fixnum
|
63
62
|
*
|
64
|
-
* Call virSecretGetUsageType[
|
63
|
+
* Call virSecretGetUsageType[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageType]
|
65
64
|
* to retrieve the usagetype for this secret.
|
66
65
|
*/
|
67
66
|
static VALUE libvirt_secret_usagetype(VALUE s)
|
@@ -75,7 +74,7 @@ static VALUE libvirt_secret_usagetype(VALUE s)
|
|
75
74
|
* call-seq:
|
76
75
|
* secret.usageid -> String
|
77
76
|
*
|
78
|
-
* Call virSecretGetUsageID[
|
77
|
+
* Call virSecretGetUsageID[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageID]
|
79
78
|
* to retrieve the usageid for this secret.
|
80
79
|
*/
|
81
80
|
static VALUE libvirt_secret_usageid(VALUE s)
|
@@ -89,7 +88,7 @@ static VALUE libvirt_secret_usageid(VALUE s)
|
|
89
88
|
* call-seq:
|
90
89
|
* secret.xml_desc(flags=0) -> String
|
91
90
|
*
|
92
|
-
* Call virSecretGetXMLDesc[
|
91
|
+
* Call virSecretGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetXMLDesc]
|
93
92
|
* to retrieve the XML for this secret.
|
94
93
|
*/
|
95
94
|
static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
|
@@ -108,7 +107,7 @@ static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
|
|
108
107
|
* call-seq:
|
109
108
|
* secret.set_value(value, flags=0) -> nil
|
110
109
|
*
|
111
|
-
* Call virSecretSetValue[
|
110
|
+
* Call virSecretSetValue[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue]
|
112
111
|
* to set a new value in this secret. Deprecated; use secret.value= instead.
|
113
112
|
*/
|
114
113
|
static VALUE libvirt_secret_set_value(int argc, VALUE *argv, VALUE s)
|
@@ -131,7 +130,7 @@ static VALUE libvirt_secret_set_value(int argc, VALUE *argv, VALUE s)
|
|
131
130
|
* call-seq:
|
132
131
|
* secret.value = value,flags=0
|
133
132
|
*
|
134
|
-
* Call virSecretSetValue[
|
133
|
+
* Call virSecretSetValue[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue]
|
135
134
|
* to set a new value in this secret.
|
136
135
|
*/
|
137
136
|
static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
|
@@ -168,7 +167,7 @@ static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
|
|
168
167
|
* call-seq:
|
169
168
|
* secret.value(flags=0) -> String
|
170
169
|
*
|
171
|
-
* Call virSecretGetValue[
|
170
|
+
* Call virSecretGetValue[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetValue]
|
172
171
|
* to retrieve the value from this secret.
|
173
172
|
*/
|
174
173
|
static VALUE libvirt_secret_value(int argc, VALUE *argv, VALUE s)
|
@@ -203,7 +202,7 @@ static VALUE libvirt_secret_value(int argc, VALUE *argv, VALUE s)
|
|
203
202
|
* call-seq:
|
204
203
|
* secret.undefine -> nil
|
205
204
|
*
|
206
|
-
* Call virSecretUndefine[
|
205
|
+
* Call virSecretUndefine[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretUndefine]
|
207
206
|
* to undefine this secret.
|
208
207
|
*/
|
209
208
|
static VALUE libvirt_secret_undefine(VALUE s)
|
@@ -217,7 +216,7 @@ static VALUE libvirt_secret_undefine(VALUE s)
|
|
217
216
|
* call-seq:
|
218
217
|
* secret.free -> nil
|
219
218
|
*
|
220
|
-
* Call virSecretFree[
|
219
|
+
* Call virSecretFree[https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretFree]
|
221
220
|
* to free this secret. After this call the secret object is no longer valid.
|
222
221
|
*/
|
223
222
|
static VALUE libvirt_secret_free(VALUE s)
|
@@ -225,14 +224,11 @@ static VALUE libvirt_secret_free(VALUE s)
|
|
225
224
|
ruby_libvirt_generate_call_free(Secret, s);
|
226
225
|
}
|
227
226
|
|
228
|
-
#endif
|
229
|
-
|
230
227
|
/*
|
231
228
|
* Class Libvirt::Secret
|
232
229
|
*/
|
233
230
|
void ruby_libvirt_secret_init(void)
|
234
231
|
{
|
235
|
-
#if HAVE_TYPE_VIRSECRETPTR
|
236
232
|
c_secret = rb_define_class_under(m_libvirt, "Secret", rb_cObject);
|
237
233
|
|
238
234
|
rb_define_attr(c_secret, "connection", 1, 0);
|
@@ -240,18 +236,12 @@ void ruby_libvirt_secret_init(void)
|
|
240
236
|
rb_define_const(c_secret, "USAGE_TYPE_VOLUME",
|
241
237
|
INT2NUM(VIR_SECRET_USAGE_TYPE_VOLUME));
|
242
238
|
|
243
|
-
#if HAVE_CONST_VIR_SECRET_USAGE_TYPE_CEPH
|
244
239
|
rb_define_const(c_secret, "USAGE_TYPE_CEPH",
|
245
240
|
INT2NUM(VIR_SECRET_USAGE_TYPE_CEPH));
|
246
|
-
#endif
|
247
|
-
#if HAVE_CONST_VIR_SECRET_USAGE_TYPE_ISCSI
|
248
241
|
rb_define_const(c_secret, "USAGE_TYPE_ISCSI",
|
249
242
|
INT2NUM(VIR_SECRET_USAGE_TYPE_ISCSI));
|
250
|
-
#endif
|
251
|
-
#if HAVE_CONST_VIR_SECRET_USAGE_TYPE_NONE
|
252
243
|
rb_define_const(c_secret, "USAGE_TYPE_NONE",
|
253
244
|
INT2NUM(VIR_SECRET_USAGE_TYPE_NONE));
|
254
|
-
#endif
|
255
245
|
|
256
246
|
/* Secret object methods */
|
257
247
|
rb_define_method(c_secret, "uuid", libvirt_secret_uuid, 0);
|
@@ -264,5 +254,4 @@ void ruby_libvirt_secret_init(void)
|
|
264
254
|
rb_define_alias(c_secret, "get_value", "value");
|
265
255
|
rb_define_method(c_secret, "undefine", libvirt_secret_undefine, 0);
|
266
256
|
rb_define_method(c_secret, "free", libvirt_secret_free, 0);
|
267
|
-
#endif
|
268
257
|
}
|