ruby-libvirt 0.5.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  * network.c: virNetwork methods
3
3
  *
4
4
  * Copyright (C) 2007,2010 Red Hat Inc.
5
- * Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ * Copyright (C) 2013-2016 Chris Lalancette <clalancette@gmail.com>
6
6
  *
7
7
  * This library is free software; you can redistribute it and/or
8
8
  * modify it under the terms of the GNU Lesser General Public
@@ -48,7 +48,7 @@ VALUE ruby_libvirt_network_new(virNetworkPtr n, VALUE conn)
48
48
  * call-seq:
49
49
  * net.undefine -> nil
50
50
  *
51
- * Call virNetworkUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkUndefine]
51
+ * Call virNetworkUndefine[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkUndefine]
52
52
  * to undefine this network.
53
53
  */
54
54
  static VALUE libvirt_network_undefine(VALUE n)
@@ -62,7 +62,7 @@ static VALUE libvirt_network_undefine(VALUE n)
62
62
  * call-seq:
63
63
  * net.create -> nil
64
64
  *
65
- * Call virNetworkCreate[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkCreate]
65
+ * Call virNetworkCreate[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkCreate]
66
66
  * to start this network.
67
67
  */
68
68
  static VALUE libvirt_network_create(VALUE n)
@@ -77,7 +77,7 @@ static VALUE libvirt_network_create(VALUE n)
77
77
  * call-seq:
78
78
  * net.update -> nil
79
79
  *
80
- * Call virNetworkUpdate[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkUpdate]
80
+ * Call virNetworkUpdate[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkUpdate]
81
81
  * to update this network.
82
82
  */
83
83
  static VALUE libvirt_network_update(VALUE n, VALUE command, VALUE section,
@@ -95,7 +95,7 @@ static VALUE libvirt_network_update(VALUE n, VALUE command, VALUE section,
95
95
  * call-seq:
96
96
  * net.destroy -> nil
97
97
  *
98
- * Call virNetworkDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkDestroy]
98
+ * Call virNetworkDestroy[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkDestroy]
99
99
  * to shutdown this network.
100
100
  */
101
101
  static VALUE libvirt_network_destroy(VALUE n)
@@ -107,9 +107,9 @@ static VALUE libvirt_network_destroy(VALUE n)
107
107
 
108
108
  /*
109
109
  * call-seq:
110
- * net.name -> string
110
+ * net.name -> String
111
111
  *
112
- * Call virNetworkGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetName]
112
+ * Call virNetworkGetName[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetName]
113
113
  * to retrieve the name of this network.
114
114
  */
115
115
  static VALUE libvirt_network_name(VALUE n)
@@ -121,9 +121,9 @@ static VALUE libvirt_network_name(VALUE n)
121
121
 
122
122
  /*
123
123
  * call-seq:
124
- * net.uuid -> string
124
+ * net.uuid -> String
125
125
  *
126
- * Call virNetworkGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetUUIDString]
126
+ * Call virNetworkGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUIDString]
127
127
  * to retrieve the UUID of this network.
128
128
  */
129
129
  static VALUE libvirt_network_uuid(VALUE n)
@@ -134,14 +134,14 @@ static VALUE libvirt_network_uuid(VALUE n)
134
134
 
135
135
  /*
136
136
  * call-seq:
137
- * net.xml_desc(flags=0) -> string
137
+ * net.xml_desc(flags=0) -> String
138
138
  *
139
- * Call virNetworkGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetXMLDesc]
139
+ * Call virNetworkGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetXMLDesc]
140
140
  * to retrieve the XML for this network.
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
 
@@ -153,9 +153,9 @@ static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
153
153
 
154
154
  /*
155
155
  * call-seq:
156
- * net.bridge_name -> string
156
+ * net.bridge_name -> String
157
157
  *
158
- * Call virNetworkGetBridgeName[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetBridgeName]
158
+ * Call virNetworkGetBridgeName[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetBridgeName]
159
159
  * to retrieve the bridge name for this network.
160
160
  */
161
161
  static VALUE libvirt_network_bridge_name(VALUE n)
@@ -169,7 +169,7 @@ static VALUE libvirt_network_bridge_name(VALUE n)
169
169
  * call-seq:
170
170
  * net.autostart? -> [true|false]
171
171
  *
172
- * Call virNetworkGetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetAutostart]
172
+ * Call virNetworkGetAutostart[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetAutostart]
173
173
  * to determine if this network will be autostarted when libvirtd starts.
174
174
  */
175
175
  static VALUE libvirt_network_autostart(VALUE n)
@@ -187,7 +187,7 @@ static VALUE libvirt_network_autostart(VALUE n)
187
187
  * call-seq:
188
188
  * net.autostart = [true|false]
189
189
  *
190
- * Call virNetworkSetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkSetAutostart]
190
+ * Call virNetworkSetAutostart[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkSetAutostart]
191
191
  * to set this network to be autostarted when libvirtd starts.
192
192
  */
193
193
  static VALUE libvirt_network_autostart_equal(VALUE n, VALUE autostart)
@@ -206,7 +206,7 @@ static VALUE libvirt_network_autostart_equal(VALUE n, VALUE autostart)
206
206
  * call-seq:
207
207
  * net.free -> nil
208
208
  *
209
- * Call virNetworkFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkFree]
209
+ * Call virNetworkFree[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkFree]
210
210
  * to free this network. The object will no longer be valid after this call.
211
211
  */
212
212
  static VALUE libvirt_network_free(VALUE n)
@@ -219,7 +219,7 @@ static VALUE libvirt_network_free(VALUE n)
219
219
  * call-seq:
220
220
  * net.active? -> [true|false]
221
221
  *
222
- * Call virNetworkIsActive[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkIsActive]
222
+ * Call virNetworkIsActive[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsActive]
223
223
  * to determine if this network is currently active.
224
224
  */
225
225
  static VALUE libvirt_network_active_p(VALUE n)
@@ -235,7 +235,7 @@ static VALUE libvirt_network_active_p(VALUE n)
235
235
  * call-seq:
236
236
  * net.persistent? -> [true|false]
237
237
  *
238
- * Call virNetworkIsPersistent[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkIsPersistent]
238
+ * Call virNetworkIsPersistent[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsPersistent]
239
239
  * to determine if this network is persistent.
240
240
  */
241
241
  static VALUE libvirt_network_persistent_p(VALUE n)
@@ -246,6 +246,92 @@ static VALUE libvirt_network_persistent_p(VALUE n)
246
246
  }
247
247
  #endif
248
248
 
249
+ #if HAVE_VIRNETWORKGETDHCPLEASES
250
+ struct leases_arg {
251
+ virNetworkDHCPLeasePtr *leases;
252
+ int nleases;
253
+ };
254
+
255
+ static VALUE leases_wrap(VALUE arg)
256
+ {
257
+ struct leases_arg *e = (struct leases_arg *)arg;
258
+ VALUE result, hash;
259
+ virNetworkDHCPLeasePtr lease;
260
+ int i;
261
+
262
+ result = rb_ary_new2(e->nleases);
263
+
264
+ for (i = 0; i < e->nleases; i++) {
265
+ lease = e->leases[i];
266
+
267
+ hash = rb_hash_new();
268
+ rb_hash_aset(hash, rb_str_new2("iface"), rb_str_new2(lease->iface));
269
+ rb_hash_aset(hash, rb_str_new2("expirytime"),
270
+ LL2NUM(lease->expirytime));
271
+ rb_hash_aset(hash, rb_str_new2("type"), INT2NUM(lease->type));
272
+ if (lease->mac) {
273
+ rb_hash_aset(hash, rb_str_new2("mac"), rb_str_new2(lease->mac));
274
+ }
275
+ if (lease->iaid) {
276
+ rb_hash_aset(hash, rb_str_new2("iaid"), rb_str_new2(lease->iaid));
277
+ }
278
+ rb_hash_aset(hash, rb_str_new2("ipaddr"), rb_str_new2(lease->ipaddr));
279
+ rb_hash_aset(hash, rb_str_new2("prefix"), UINT2NUM(lease->prefix));
280
+ if (lease->hostname) {
281
+ rb_hash_aset(hash, rb_str_new2("hostname"),
282
+ rb_str_new2(lease->hostname));
283
+ }
284
+ if (lease->clientid) {
285
+ rb_hash_aset(hash, rb_str_new2("clientid"),
286
+ rb_str_new2(lease->clientid));
287
+ }
288
+
289
+ rb_ary_store(result, i, hash);
290
+ }
291
+
292
+ return result;
293
+ }
294
+
295
+ /*
296
+ * call-seq:
297
+ * net.dhcp_leases(mac=nil, flags=0) -> Hash
298
+ *
299
+ * Call virNetworkGetDHCPLeases[http://www.libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLeases]
300
+ * to retrieve the leases for this network.
301
+ */
302
+ static VALUE libvirt_network_get_dhcp_leases(int argc, VALUE *argv, VALUE n)
303
+ {
304
+ VALUE mac = RUBY_Qnil, flags = RUBY_Qnil, result;
305
+ int nleases, i = 0, exception = 0;
306
+ virNetworkDHCPLeasePtr *leases = NULL;
307
+ struct leases_arg args;
308
+
309
+ rb_scan_args(argc, argv, "02", &mac, &flags);
310
+
311
+ nleases = virNetworkGetDHCPLeases(network_get(n),
312
+ ruby_libvirt_get_cstring_or_null(mac),
313
+ &leases,
314
+ ruby_libvirt_value_to_uint(flags));
315
+ ruby_libvirt_raise_error_if(nleases < 0, e_Error, "virNetworkGetDHCPLeases",
316
+ ruby_libvirt_connect_get(n));
317
+
318
+ args.leases = leases;
319
+ args.nleases = nleases;
320
+ result = rb_protect(leases_wrap, (VALUE)&args, &exception);
321
+
322
+ for (i = 0; i < nleases; i++) {
323
+ virNetworkDHCPLeaseFree(leases[i]);
324
+ }
325
+ free(leases);
326
+
327
+ if (exception) {
328
+ rb_jump_tag(exception);
329
+ }
330
+
331
+ return result;
332
+ }
333
+ #endif
334
+
249
335
  #endif
250
336
 
251
337
  /*
@@ -450,5 +536,20 @@ void ruby_libvirt_network_init(void)
450
536
  INT2NUM(VIR_NETWORK_UPDATE_COMMAND_DELETE));
451
537
  #endif
452
538
 
539
+ #if HAVE_VIRNETWORKGETDHCPLEASES
540
+ rb_define_method(c_network, "dhcp_leases",
541
+ libvirt_network_get_dhcp_leases, -1);
542
+ #endif
543
+
544
+ #if HAVE_CONST_VIR_IP_ADDR_TYPE_IPV4
545
+ rb_define_const(c_network, "IP_ADDR_TYPE_IPV4",
546
+ INT2NUM(VIR_IP_ADDR_TYPE_IPV4));
547
+ #endif
548
+
549
+ #if HAVE_CONST_VIR_IP_ADDR_TYPE_IPV6
550
+ rb_define_const(c_network, "IP_ADDR_TYPE_IPV6",
551
+ INT2NUM(VIR_IP_ADDR_TYPE_IPV6));
552
+ #endif
553
+
453
554
  #endif
454
555
  }
@@ -2,7 +2,7 @@
2
2
  * nodedevice.c: virNodeDevice methods
3
3
  *
4
4
  * Copyright (C) 2010 Red Hat Inc.
5
- * Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ * Copyright (C) 2013-2016 Chris Lalancette <clalancette@gmail.com>
6
6
  *
7
7
  * This library is free software; you can redistribute it and/or
8
8
  * modify it under the terms of the GNU Lesser General Public
@@ -46,9 +46,9 @@ VALUE ruby_libvirt_nodedevice_new(virNodeDevicePtr n, VALUE conn)
46
46
 
47
47
  /*
48
48
  * call-seq:
49
- * nodedevice.name -> string
49
+ * nodedevice.name -> String
50
50
  *
51
- * Call virNodeDeviceGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetName]
51
+ * Call virNodeDeviceGetName[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetName]
52
52
  * to retrieve the name of the node device.
53
53
  */
54
54
  static VALUE libvirt_nodedevice_name(VALUE c)
@@ -60,9 +60,9 @@ static VALUE libvirt_nodedevice_name(VALUE c)
60
60
 
61
61
  /*
62
62
  * call-seq:
63
- * nodedevice.parent -> string
63
+ * nodedevice.parent -> String
64
64
  *
65
- * Call virNodeDeviceGetParent[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetParent]
65
+ * Call virNodeDeviceGetParent[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetParent]
66
66
  * to retrieve the parent of the node device.
67
67
  */
68
68
  static VALUE libvirt_nodedevice_parent(VALUE c)
@@ -85,9 +85,9 @@ static VALUE libvirt_nodedevice_parent(VALUE c)
85
85
 
86
86
  /*
87
87
  * call-seq:
88
- * nodedevice.num_of_caps -> fixnum
88
+ * nodedevice.num_of_caps -> Fixnum
89
89
  *
90
- * Call virNodeDeviceNumOfCaps[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceNumOfCaps]
90
+ * Call virNodeDeviceNumOfCaps[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceNumOfCaps]
91
91
  * to retrieve the number of capabilities of the node device.
92
92
  */
93
93
  static VALUE libvirt_nodedevice_num_of_caps(VALUE c)
@@ -101,7 +101,7 @@ static VALUE libvirt_nodedevice_num_of_caps(VALUE c)
101
101
  * call-seq:
102
102
  * nodedevice.list_caps -> list
103
103
  *
104
- * Call virNodeDeviceListCaps[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceListCaps]
104
+ * Call virNodeDeviceListCaps[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceListCaps]
105
105
  * to retrieve a list of capabilities of the node device.
106
106
  */
107
107
  static VALUE libvirt_nodedevice_list_caps(VALUE c)
@@ -129,14 +129,14 @@ static VALUE libvirt_nodedevice_list_caps(VALUE c)
129
129
 
130
130
  /*
131
131
  * call-seq:
132
- * nodedevice.xml_desc(flags=0) -> string
132
+ * nodedevice.xml_desc(flags=0) -> String
133
133
  *
134
- * Call virNodeDeviceGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetXMLDesc]
134
+ * Call virNodeDeviceGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceGetXMLDesc]
135
135
  * to retrieve the XML for the node device.
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
 
@@ -150,12 +150,12 @@ static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
150
150
  * call-seq:
151
151
  * nodedevice.detach(driver=nil, flags=0) -> nil
152
152
  *
153
- * Call virNodeDeviceDettach[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDettach]
153
+ * Call virNodeDeviceDettach[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDettach]
154
154
  * to detach the node device from the node.
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
 
@@ -184,7 +184,7 @@ static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
184
184
  * call-seq:
185
185
  * nodedevice.reattach -> nil
186
186
  *
187
- * Call virNodeDeviceReAttach[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReAttach]
187
+ * Call virNodeDeviceReAttach[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach]
188
188
  * to reattach the node device to the node.
189
189
  */
190
190
  static VALUE libvirt_nodedevice_reattach(VALUE n)
@@ -198,7 +198,7 @@ static VALUE libvirt_nodedevice_reattach(VALUE n)
198
198
  * call-seq:
199
199
  * nodedevice.reset -> nil
200
200
  *
201
- * Call virNodeDeviceReset[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReset]
201
+ * Call virNodeDeviceReset[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset]
202
202
  * to reset the node device.
203
203
  */
204
204
  static VALUE libvirt_nodedevice_reset(VALUE n)
@@ -213,7 +213,7 @@ static VALUE libvirt_nodedevice_reset(VALUE n)
213
213
  * call-seq:
214
214
  * nodedevice.destroy -> nil
215
215
  *
216
- * Call virNodeDeviceDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDestroy]
216
+ * Call virNodeDeviceDestroy[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDestroy]
217
217
  * to shutdown the node device.
218
218
  */
219
219
  static VALUE libvirt_nodedevice_destroy(VALUE n)
@@ -228,7 +228,7 @@ static VALUE libvirt_nodedevice_destroy(VALUE n)
228
228
  * call-seq:
229
229
  * nodedevice.free -> nil
230
230
  *
231
- * Call virNodeDeviceFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceFree]
231
+ * Call virNodeDeviceFree[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceFree]
232
232
  * to free the node device object. After this call the node device object is
233
233
  * no longer valid.
234
234
  */
@@ -242,13 +242,13 @@ static VALUE libvirt_nodedevice_free(VALUE n)
242
242
  * call-seq:
243
243
  * nodedevice.lookup_scsi_host_by_wwn(wwnn, wwpn, flags=0) -> Libvirt::NodeDevice
244
244
  *
245
- * Call virNodeDeviceLookupSCSIHostByWWN[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceLookupSCSIHostByWWN]
245
+ * Call virNodeDeviceLookupSCSIHostByWWN[http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceLookupSCSIHostByWWN]
246
246
  * to look up a SCSI host by its WWNN and WWPN.
247
247
  */
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);
@@ -2,7 +2,7 @@
2
2
  * nwfilter.c: virNWFilter methods
3
3
  *
4
4
  * Copyright (C) 2010 Red Hat Inc.
5
- * Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ * Copyright (C) 2013-2016 Chris Lalancette <clalancette@gmail.com>
6
6
  *
7
7
  * This library is free software; you can redistribute it and/or
8
8
  * modify it under the terms of the GNU Lesser General Public
@@ -48,7 +48,7 @@ VALUE ruby_libvirt_nwfilter_new(virNWFilterPtr n, VALUE conn)
48
48
  * call-seq:
49
49
  * nwfilter.undefine -> nil
50
50
  *
51
- * Call virNWFilterUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterUndefine]
51
+ * Call virNWFilterUndefine[http://www.libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterUndefine]
52
52
  * to undefine the network filter.
53
53
  */
54
54
  static VALUE libvirt_nwfilter_undefine(VALUE n)
@@ -60,9 +60,9 @@ static VALUE libvirt_nwfilter_undefine(VALUE n)
60
60
 
61
61
  /*
62
62
  * call-seq:
63
- * nwfilter.name -> string
63
+ * nwfilter.name -> String
64
64
  *
65
- * Call virNWFilterGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetName]
65
+ * Call virNWFilterGetName[http://www.libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetName]
66
66
  * to retrieve the network filter name.
67
67
  */
68
68
  static VALUE libvirt_nwfilter_name(VALUE n)
@@ -74,9 +74,9 @@ static VALUE libvirt_nwfilter_name(VALUE n)
74
74
 
75
75
  /*
76
76
  * call-seq:
77
- * nwfilter.uuid -> string
77
+ * nwfilter.uuid -> String
78
78
  *
79
- * Call virNWFilterGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetUUIDString]
79
+ * Call virNWFilterGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetUUIDString]
80
80
  * to retrieve the network filter UUID.
81
81
  */
82
82
  static VALUE libvirt_nwfilter_uuid(VALUE n)
@@ -87,14 +87,14 @@ static VALUE libvirt_nwfilter_uuid(VALUE n)
87
87
 
88
88
  /*
89
89
  * call-seq:
90
- * nwfilter.xml_desc(flags=0) -> string
90
+ * nwfilter.xml_desc(flags=0) -> String
91
91
  *
92
- * Call virNWFilterGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetXMLDesc]
92
+ * Call virNWFilterGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterGetXMLDesc]
93
93
  * to retrieve the XML for this network filter.
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
 
@@ -108,7 +108,7 @@ static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
108
108
  * call-seq:
109
109
  * nwfilter.free -> nil
110
110
  *
111
- * Call virNWFilterFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterFree]
111
+ * Call virNWFilterFree[http://www.libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterFree]
112
112
  * to free this network filter. After this call the network filter object is
113
113
  * no longer valid.
114
114
  */
data/ext/libvirt/secret.c CHANGED
@@ -2,7 +2,7 @@
2
2
  * secret.c: virSecret methods
3
3
  *
4
4
  * Copyright (C) 2010 Red Hat Inc.
5
- * Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ * Copyright (C) 2013-2016 Chris Lalancette <clalancette@gmail.com>
6
6
  *
7
7
  * This library is free software; you can redistribute it and/or
8
8
  * modify it under the terms of the GNU Lesser General Public
@@ -46,9 +46,9 @@ VALUE ruby_libvirt_secret_new(virSecretPtr s, VALUE conn)
46
46
 
47
47
  /*
48
48
  * call-seq:
49
- * secret.uuid -> string
49
+ * secret.uuid -> String
50
50
  *
51
- * Call virSecretGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretGetUUIDString]
51
+ * Call virSecretGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUUIDString]
52
52
  * to retrieve the UUID for this secret.
53
53
  */
54
54
  static VALUE libvirt_secret_uuid(VALUE s)
@@ -59,9 +59,9 @@ static VALUE libvirt_secret_uuid(VALUE s)
59
59
 
60
60
  /*
61
61
  * call-seq:
62
- * secret.usagetype -> fixnum
62
+ * secret.usagetype -> Fixnum
63
63
  *
64
- * Call virSecretGetUsageType[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretGetUsageType]
64
+ * Call virSecretGetUsageType[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageType]
65
65
  * to retrieve the usagetype for this secret.
66
66
  */
67
67
  static VALUE libvirt_secret_usagetype(VALUE s)
@@ -73,9 +73,9 @@ static VALUE libvirt_secret_usagetype(VALUE s)
73
73
 
74
74
  /*
75
75
  * call-seq:
76
- * secret.usageid -> string
76
+ * secret.usageid -> String
77
77
  *
78
- * Call virSecretGetUsageID[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretGetUsageID]
78
+ * Call virSecretGetUsageID[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageID]
79
79
  * to retrieve the usageid for this secret.
80
80
  */
81
81
  static VALUE libvirt_secret_usageid(VALUE s)
@@ -87,14 +87,14 @@ static VALUE libvirt_secret_usageid(VALUE s)
87
87
 
88
88
  /*
89
89
  * call-seq:
90
- * secret.xml_desc(flags=0) -> string
90
+ * secret.xml_desc(flags=0) -> String
91
91
  *
92
- * Call virSecretGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretGetXMLDesc]
92
+ * Call virSecretGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetXMLDesc]
93
93
  * to retrieve the XML for this secret.
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
 
@@ -108,12 +108,12 @@ static VALUE libvirt_secret_xml_desc(int argc, VALUE *argv, VALUE s)
108
108
  * call-seq:
109
109
  * secret.set_value(value, flags=0) -> nil
110
110
  *
111
- * Call virSecretSetValue[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretSetValue]
111
+ * Call virSecretSetValue[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue]
112
112
  * to set a new value in this secret. Deprecated; use secret.value= instead.
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
 
@@ -131,7 +131,7 @@ static VALUE libvirt_secret_set_value(int argc, VALUE *argv, VALUE s)
131
131
  * call-seq:
132
132
  * secret.value = value,flags=0
133
133
  *
134
- * Call virSecretSetValue[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretSetValue]
134
+ * Call virSecretSetValue[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretSetValue]
135
135
  * to set a new value in this secret.
136
136
  */
137
137
  static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
@@ -166,14 +166,14 @@ static VALUE libvirt_secret_value_equal(VALUE s, VALUE in)
166
166
 
167
167
  /*
168
168
  * call-seq:
169
- * secret.value(flags=0) -> string
169
+ * secret.value(flags=0) -> String
170
170
  *
171
- * Call virSecretGetValue[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretGetValue]
171
+ * Call virSecretGetValue[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetValue]
172
172
  * to retrieve the value from this secret.
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;
@@ -203,7 +203,7 @@ static VALUE libvirt_secret_value(int argc, VALUE *argv, VALUE s)
203
203
  * call-seq:
204
204
  * secret.undefine -> nil
205
205
  *
206
- * Call virSecretUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretUndefine]
206
+ * Call virSecretUndefine[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretUndefine]
207
207
  * to undefine this secret.
208
208
  */
209
209
  static VALUE libvirt_secret_undefine(VALUE s)
@@ -217,7 +217,7 @@ static VALUE libvirt_secret_undefine(VALUE s)
217
217
  * call-seq:
218
218
  * secret.free -> nil
219
219
  *
220
- * Call virSecretFree[http://www.libvirt.org/html/libvirt-libvirt.html#virSecretFree]
220
+ * Call virSecretFree[http://www.libvirt.org/html/libvirt-libvirt-secret.html#virSecretFree]
221
221
  * to free this secret. After this call the secret object is no longer valid.
222
222
  */
223
223
  static VALUE libvirt_secret_free(VALUE s)