ruby-libvirt 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,8 @@
1
1
  #ifndef NETWORK_H
2
2
  #define NETWORK_H
3
3
 
4
- VALUE network_new(virNetworkPtr n, VALUE conn);
5
- void init_network();
4
+ void ruby_libvirt_network_init(void);
5
+
6
+ VALUE ruby_libvirt_network_new(virNetworkPtr n, VALUE conn);
6
7
 
7
8
  #endif
@@ -2,6 +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
6
  *
6
7
  * This library is free software; you can redistribute it and/or
7
8
  * modify it under the terms of the GNU Lesser General Public
@@ -28,142 +29,183 @@
28
29
  #if HAVE_TYPE_VIRNODEDEVICEPTR
29
30
  static VALUE c_nodedevice;
30
31
 
31
- static void nodedevice_free(void *s) {
32
- generic_free(NodeDevice, s);
32
+ static void nodedevice_free(void *s)
33
+ {
34
+ ruby_libvirt_free_struct(NodeDevice, s);
33
35
  }
34
36
 
35
- static virNodeDevicePtr nodedevice_get(VALUE s) {
36
- generic_get(NodeDevice, s);
37
+ static virNodeDevicePtr nodedevice_get(VALUE n)
38
+ {
39
+ ruby_libvirt_get_struct(NodeDevice, n);
37
40
  }
38
41
 
39
- VALUE nodedevice_new(virNodeDevicePtr s, VALUE conn) {
40
- return generic_new(c_nodedevice, s, conn, nodedevice_free);
42
+ VALUE ruby_libvirt_nodedevice_new(virNodeDevicePtr n, VALUE conn)
43
+ {
44
+ return ruby_libvirt_new_class(c_nodedevice, n, conn, nodedevice_free);
41
45
  }
42
46
 
43
47
  /*
44
48
  * call-seq:
45
49
  * nodedevice.name -> string
46
50
  *
47
- * Call +virNodeDeviceGetName+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetName]
51
+ * Call virNodeDeviceGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetName]
48
52
  * to retrieve the name of the node device.
49
53
  */
50
- static VALUE libvirt_nodedevice_name(VALUE c) {
51
- gen_call_string(virNodeDeviceGetName, conn(c), 0, nodedevice_get(c));
54
+ static VALUE libvirt_nodedevice_name(VALUE c)
55
+ {
56
+ ruby_libvirt_generate_call_string(virNodeDeviceGetName,
57
+ ruby_libvirt_connect_get(c), 0,
58
+ nodedevice_get(c));
52
59
  }
53
60
 
54
61
  /*
55
62
  * call-seq:
56
63
  * nodedevice.parent -> string
57
64
  *
58
- * Call +virNodeDeviceGetParent+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetParent]
65
+ * Call virNodeDeviceGetParent[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetParent]
59
66
  * to retrieve the parent of the node device.
60
67
  */
61
- static VALUE libvirt_nodedevice_parent(VALUE c) {
62
- /* unfortunately we can't use gen_call_string() here because
63
- * virNodeDeviceGetParent() returns NULL as a valid value (when this
64
- * device has no parent. Hand-code it instead
68
+ static VALUE libvirt_nodedevice_parent(VALUE c)
69
+ {
70
+ /* unfortunately we can't use ruby_libvirt_generate_call_string() here
71
+ * because virNodeDeviceGetParent() returns NULL as a valid value (when this
72
+ * device has no parent). Hand-code it instead
65
73
  */
66
74
 
67
75
  const char *str;
68
76
 
69
77
  str = virNodeDeviceGetParent(nodedevice_get(c));
70
- if (str == NULL)
78
+ if (str == NULL) {
71
79
  return Qnil;
72
- else
80
+ }
81
+ else {
73
82
  return rb_str_new2(str);
83
+ }
74
84
  }
75
85
 
76
86
  /*
77
87
  * call-seq:
78
88
  * nodedevice.num_of_caps -> fixnum
79
89
  *
80
- * Call +virNodeDeviceNumOfCaps+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceNumOfCaps]
90
+ * Call virNodeDeviceNumOfCaps[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceNumOfCaps]
81
91
  * to retrieve the number of capabilities of the node device.
82
92
  */
83
- static VALUE libvirt_nodedevice_num_of_caps(VALUE c) {
84
- gen_call_int(virNodeDeviceNumOfCaps, conn(c), nodedevice_get(c));
93
+ static VALUE libvirt_nodedevice_num_of_caps(VALUE c)
94
+ {
95
+ ruby_libvirt_generate_call_int(virNodeDeviceNumOfCaps,
96
+ ruby_libvirt_connect_get(c),
97
+ nodedevice_get(c));
85
98
  }
86
99
 
87
100
  /*
88
101
  * call-seq:
89
102
  * nodedevice.list_caps -> list
90
103
  *
91
- * Call +virNodeDeviceListCaps+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceListCaps]
104
+ * Call virNodeDeviceListCaps[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceListCaps]
92
105
  * to retrieve a list of capabilities of the node device.
93
106
  */
94
- static VALUE libvirt_nodedevice_list_caps(VALUE c) {
107
+ static VALUE libvirt_nodedevice_list_caps(VALUE c)
108
+ {
95
109
  int r, num;
96
- virConnectPtr conn = connect_get(c);
97
- virNodeDevicePtr nodedev = nodedevice_get(c);
98
110
  char **names;
99
111
 
100
- num = virNodeDeviceNumOfCaps(nodedev);
101
- _E(num < 0, create_error(e_RetrieveError, "virNodeDeviceNumOfCaps", conn));
102
- if (num == 0)
112
+ num = virNodeDeviceNumOfCaps(nodedevice_get(c));
113
+ ruby_libvirt_raise_error_if(num < 0, e_RetrieveError,
114
+ "virNodeDeviceNumOfCaps",
115
+ ruby_libvirt_connect_get(c));
116
+ if (num == 0) {
103
117
  /* if num is 0, don't call virNodeDeviceListCaps function */
104
118
  return rb_ary_new2(num);
105
-
106
- names = ALLOC_N(char *, num);
107
- r = virNodeDeviceListCaps(nodedev, names, num);
108
- if (r < 0) {
109
- xfree(names);
110
- rb_exc_raise(create_error(e_RetrieveError, "virNodeDeviceListCaps",
111
- conn));
112
119
  }
113
120
 
114
- return gen_list(num, &names);
121
+ names = alloca(sizeof(char *) * num);
122
+ r = virNodeDeviceListCaps(nodedevice_get(c), names, num);
123
+ ruby_libvirt_raise_error_if(r < 0, e_RetrieveError,
124
+ "virNodeDeviceListCaps",
125
+ ruby_libvirt_connect_get(c));
126
+
127
+ return ruby_libvirt_generate_list(num, names);
115
128
  }
116
129
 
117
130
  /*
118
131
  * call-seq:
119
132
  * nodedevice.xml_desc(flags=0) -> string
120
133
  *
121
- * Call +virNodeDeviceGetXMLDesc+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetXMLDesc]
134
+ * Call virNodeDeviceGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceGetXMLDesc]
122
135
  * to retrieve the XML for the node device.
123
136
  */
124
- static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE s) {
137
+ static VALUE libvirt_nodedevice_xml_desc(int argc, VALUE *argv, VALUE n)
138
+ {
125
139
  VALUE flags;
126
140
 
127
141
  rb_scan_args(argc, argv, "01", &flags);
128
142
 
129
- if (NIL_P(flags))
130
- flags = INT2NUM(0);
131
-
132
- gen_call_string(virNodeDeviceGetXMLDesc, conn(s), 1,
133
- nodedevice_get(s), NUM2UINT(flags));
143
+ ruby_libvirt_generate_call_string(virNodeDeviceGetXMLDesc,
144
+ ruby_libvirt_connect_get(n),
145
+ 1, nodedevice_get(n),
146
+ ruby_libvirt_value_to_uint(flags));
134
147
  }
135
148
 
136
149
  /*
137
150
  * call-seq:
138
- * nodedevice.detach -> nil
151
+ * nodedevice.detach(driver=nil, flags=0) -> nil
139
152
  *
140
- * Call +virNodeDeviceDettach+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDettach]
153
+ * Call virNodeDeviceDettach[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDettach]
141
154
  * to detach the node device from the node.
142
155
  */
143
- static VALUE libvirt_nodedevice_detach(VALUE s) {
144
- gen_call_void(virNodeDeviceDettach, conn(s), nodedevice_get(s));
156
+ static VALUE libvirt_nodedevice_detach(int argc, VALUE *argv, VALUE n)
157
+ {
158
+ VALUE driver, flags;
159
+
160
+ rb_scan_args(argc, argv, "02", &driver, &flags);
161
+
162
+ #if HAVE_VIRNODEDEVICEDETACHFLAGS
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
+ if (ruby_libvirt_value_to_uint(flags) != 0) {
170
+ rb_raise(e_NoSupportError, "Non-zero flags not supported");
171
+ }
172
+
173
+ if (ruby_libvirt_get_cstring_or_null(driver) != NULL) {
174
+ rb_raise(e_NoSupportError, "Non-NULL driver not supported");
175
+ }
176
+
177
+ ruby_libvirt_generate_call_nil(virNodeDeviceDettach,
178
+ ruby_libvirt_connect_get(n),
179
+ nodedevice_get(n));
180
+ #endif
145
181
  }
146
182
 
147
183
  /*
148
184
  * call-seq:
149
185
  * nodedevice.reattach -> nil
150
186
  *
151
- * Call +virNodeDeviceReAttach+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReAttach]
187
+ * Call virNodeDeviceReAttach[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReAttach]
152
188
  * to reattach the node device to the node.
153
189
  */
154
- static VALUE libvirt_nodedevice_reattach(VALUE s) {
155
- gen_call_void(virNodeDeviceReAttach, conn(s), nodedevice_get(s));
190
+ static VALUE libvirt_nodedevice_reattach(VALUE n)
191
+ {
192
+ ruby_libvirt_generate_call_nil(virNodeDeviceReAttach,
193
+ ruby_libvirt_connect_get(n),
194
+ nodedevice_get(n));
156
195
  }
157
196
 
158
197
  /*
159
198
  * call-seq:
160
199
  * nodedevice.reset -> nil
161
200
  *
162
- * Call +virNodeDeviceReset+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReset]
201
+ * Call virNodeDeviceReset[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceReset]
163
202
  * to reset the node device.
164
203
  */
165
- static VALUE libvirt_nodedevice_reset(VALUE s) {
166
- gen_call_void(virNodeDeviceReset, conn(s), nodedevice_get(s));
204
+ static VALUE libvirt_nodedevice_reset(VALUE n)
205
+ {
206
+ ruby_libvirt_generate_call_nil(virNodeDeviceReset,
207
+ ruby_libvirt_connect_get(n),
208
+ nodedevice_get(n));
167
209
  }
168
210
 
169
211
  #if HAVE_VIRNODEDEVICEDESTROY
@@ -171,11 +213,14 @@ static VALUE libvirt_nodedevice_reset(VALUE s) {
171
213
  * call-seq:
172
214
  * nodedevice.destroy -> nil
173
215
  *
174
- * Call +virNodeDeviceDestroy+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDestroy]
216
+ * Call virNodeDeviceDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceDestroy]
175
217
  * to shutdown the node device.
176
218
  */
177
- static VALUE libvirt_nodedevice_destroy(VALUE s) {
178
- gen_call_void(virNodeDeviceDestroy, conn(s), nodedevice_get(s));
219
+ static VALUE libvirt_nodedevice_destroy(VALUE n)
220
+ {
221
+ ruby_libvirt_generate_call_nil(virNodeDeviceDestroy,
222
+ ruby_libvirt_connect_get(n),
223
+ nodedevice_get(n));
179
224
  }
180
225
  #endif
181
226
 
@@ -183,19 +228,49 @@ static VALUE libvirt_nodedevice_destroy(VALUE s) {
183
228
  * call-seq:
184
229
  * nodedevice.free -> nil
185
230
  *
186
- * Call +virNodeDeviceFree+[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceFree]
231
+ * Call virNodeDeviceFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceFree]
187
232
  * to free the node device object. After this call the node device object is
188
233
  * no longer valid.
189
234
  */
190
- static VALUE libvirt_nodedevice_free(VALUE s) {
191
- gen_call_free(NodeDevice, s);
235
+ static VALUE libvirt_nodedevice_free(VALUE n)
236
+ {
237
+ ruby_libvirt_generate_call_free(NodeDevice, n);
238
+ }
239
+
240
+ #if HAVE_VIRNODEDEVICELOOKUPSCSIHOSTBYWWN
241
+ /*
242
+ * call-seq:
243
+ * nodedevice.lookup_scsi_host_by_wwn(wwnn, wwpn, flags=0) -> Libvirt::NodeDevice
244
+ *
245
+ * Call virNodeDeviceLookupSCSIHostByWWN[http://www.libvirt.org/html/libvirt-libvirt.html#virNodeDeviceLookupSCSIHostByWWN]
246
+ * to look up a SCSI host by its WWNN and WWPN.
247
+ */
248
+ static VALUE libvirt_nodedevice_lookup_scsi_host_by_wwn(int argc, VALUE *argv,
249
+ VALUE n)
250
+ {
251
+ VALUE wwnn, wwpn, flags;
252
+ virNodeDevicePtr nd;
253
+
254
+ rb_scan_args(argc, argv, "21", &wwnn, &wwpn, &flags);
255
+
256
+ nd = virNodeDeviceLookupSCSIHostByWWN(ruby_libvirt_connect_get(n),
257
+ StringValueCStr(wwnn),
258
+ StringValueCStr(wwpn),
259
+ ruby_libvirt_value_to_uint(flags));
260
+ if (nd == NULL) {
261
+ return Qnil;
262
+ }
263
+
264
+ return ruby_libvirt_nodedevice_new(nd, ruby_libvirt_conn_attr(n));
192
265
  }
193
266
  #endif
194
267
 
268
+ #endif
269
+
195
270
  /*
196
271
  * Class Libvirt::NodeDevice
197
272
  */
198
- void init_nodedevice()
273
+ void ruby_libvirt_nodedevice_init(void)
199
274
  {
200
275
  #if HAVE_TYPE_VIRNODEDEVICEPTR
201
276
  c_nodedevice = rb_define_class_under(m_libvirt, "NodeDevice", rb_cObject);
@@ -209,12 +284,16 @@ void init_nodedevice()
209
284
  rb_define_method(c_nodedevice, "list_caps",
210
285
  libvirt_nodedevice_list_caps, 0);
211
286
  rb_define_method(c_nodedevice, "xml_desc", libvirt_nodedevice_xml_desc, -1);
212
- rb_define_method(c_nodedevice, "detach", libvirt_nodedevice_detach, 0);
287
+ rb_define_method(c_nodedevice, "detach", libvirt_nodedevice_detach, -1);
213
288
  rb_define_method(c_nodedevice, "reattach", libvirt_nodedevice_reattach, 0);
214
289
  rb_define_method(c_nodedevice, "reset", libvirt_nodedevice_reset, 0);
215
290
  #if HAVE_VIRNODEDEVICEDESTROY
216
291
  rb_define_method(c_nodedevice, "destroy", libvirt_nodedevice_destroy, 0);
217
292
  #endif
218
293
  rb_define_method(c_nodedevice, "free", libvirt_nodedevice_free, 0);
294
+ #if HAVE_VIRNODEDEVICELOOKUPSCSIHOSTBYWWN
295
+ rb_define_method(c_nodedevice, "lookup_scsi_host_by_wwn",
296
+ libvirt_nodedevice_lookup_scsi_host_by_wwn, -1);
297
+ #endif
219
298
  #endif
220
299
  }
@@ -1,6 +1,8 @@
1
1
  #ifndef NODEDEVICE_H
2
2
  #define NODEDEVICE_H
3
3
 
4
- void init_nodedevice();
4
+ void ruby_libvirt_nodedevice_init(void);
5
+
6
+ VALUE ruby_libvirt_nodedevice_new(virNodeDevicePtr n, VALUE conn);
5
7
 
6
8
  #endif
@@ -2,6 +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
6
  *
6
7
  * This library is free software; you can redistribute it and/or
7
8
  * modify it under the terms of the GNU Lesser General Public
@@ -28,88 +29,92 @@
28
29
  #if HAVE_TYPE_VIRNWFILTERPTR
29
30
  static VALUE c_nwfilter;
30
31
 
31
- static void nwfilter_free(void *nw) {
32
- generic_free(NWFilter, nw);
32
+ static void nwfilter_free(void *n)
33
+ {
34
+ ruby_libvirt_free_struct(NWFilter, n);
33
35
  }
34
36
 
35
- static virNWFilterPtr nwfilter_get(VALUE nw) {
36
- generic_get(NWFilter, nw);
37
+ static virNWFilterPtr nwfilter_get(VALUE n)
38
+ {
39
+ ruby_libvirt_get_struct(NWFilter, n);
37
40
  }
38
41
 
39
- VALUE nwfilter_new(virNWFilterPtr nw, VALUE conn) {
40
- return generic_new(c_nwfilter, nw, conn, nwfilter_free);
42
+ VALUE ruby_libvirt_nwfilter_new(virNWFilterPtr n, VALUE conn)
43
+ {
44
+ return ruby_libvirt_new_class(c_nwfilter, n, conn, nwfilter_free);
41
45
  }
42
46
 
43
47
  /*
44
48
  * call-seq:
45
49
  * nwfilter.undefine -> nil
46
50
  *
47
- * Call +virNWFilterUndefine+[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterUndefine]
51
+ * Call virNWFilterUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterUndefine]
48
52
  * to undefine the network filter.
49
53
  */
50
- static VALUE libvirt_nwfilter_undefine(VALUE s) {
51
- gen_call_void(virNWFilterUndefine, conn(s), nwfilter_get(s));
54
+ static VALUE libvirt_nwfilter_undefine(VALUE n)
55
+ {
56
+ ruby_libvirt_generate_call_nil(virNWFilterUndefine,
57
+ ruby_libvirt_connect_get(n),
58
+ nwfilter_get(n));
52
59
  }
53
60
 
54
61
  /*
55
62
  * call-seq:
56
63
  * nwfilter.name -> string
57
64
  *
58
- * Call +virNWFilterGetName+[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetName]
65
+ * Call virNWFilterGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetName]
59
66
  * to retrieve the network filter name.
60
67
  */
61
- static VALUE libvirt_nwfilter_name(VALUE s) {
62
- gen_call_string(virNWFilterGetName, conn(s), 0, nwfilter_get(s));
68
+ static VALUE libvirt_nwfilter_name(VALUE n)
69
+ {
70
+ ruby_libvirt_generate_call_string(virNWFilterGetName,
71
+ ruby_libvirt_connect_get(n), 0,
72
+ nwfilter_get(n));
63
73
  }
64
74
 
65
75
  /*
66
76
  * call-seq:
67
77
  * nwfilter.uuid -> string
68
78
  *
69
- * Call +virNWFilterGetUUIDString+[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetUUIDString]
79
+ * Call virNWFilterGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetUUIDString]
70
80
  * to retrieve the network filter UUID.
71
81
  */
72
- static VALUE libvirt_nwfilter_uuid(VALUE s) {
73
- virNWFilterPtr nwfilter = nwfilter_get(s);
74
- int r;
75
- char uuid[VIR_UUID_STRING_BUFLEN];
76
-
77
- r = virNWFilterGetUUIDString(nwfilter, uuid);
78
- _E(r < 0, create_error(e_RetrieveError, "virNWFilterGetUUIDString",
79
- conn(s)));
80
-
81
- return rb_str_new2((char *)uuid);
82
+ static VALUE libvirt_nwfilter_uuid(VALUE n)
83
+ {
84
+ ruby_libvirt_generate_uuid(virNWFilterGetUUIDString,
85
+ ruby_libvirt_connect_get(n), nwfilter_get(n));
82
86
  }
83
87
 
84
88
  /*
85
89
  * call-seq:
86
90
  * nwfilter.xml_desc(flags=0) -> string
87
91
  *
88
- * Call +virNWFilterGetXMLDesc+[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetXMLDesc]
92
+ * Call virNWFilterGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetXMLDesc]
89
93
  * to retrieve the XML for this network filter.
90
94
  */
91
- static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE s) {
95
+ static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
96
+ {
92
97
  VALUE flags;
93
98
 
94
99
  rb_scan_args(argc, argv, "01", &flags);
95
100
 
96
- if (NIL_P(flags))
97
- flags = INT2NUM(0);
98
-
99
- gen_call_string(virNWFilterGetXMLDesc, conn(s), 1, nwfilter_get(s),
100
- NUM2UINT(flags));
101
+ ruby_libvirt_generate_call_string(virNWFilterGetXMLDesc,
102
+ ruby_libvirt_connect_get(n), 1,
103
+ nwfilter_get(n),
104
+ ruby_libvirt_value_to_uint(flags));
101
105
  }
102
106
 
103
107
  /*
104
108
  * call-seq:
105
109
  * nwfilter.free -> nil
106
110
  *
107
- * Call +virNWFilterFree+[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterFree]
111
+ * Call virNWFilterFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterFree]
108
112
  * to free this network filter. After this call the network filter object is
109
113
  * no longer valid.
110
114
  */
111
- static VALUE libvirt_nwfilter_free(VALUE s) {
112
- gen_call_free(NWFilter, s);
115
+ static VALUE libvirt_nwfilter_free(VALUE n)
116
+ {
117
+ ruby_libvirt_generate_call_free(NWFilter, n);
113
118
  }
114
119
 
115
120
  #endif
@@ -117,7 +122,7 @@ static VALUE libvirt_nwfilter_free(VALUE s) {
117
122
  /*
118
123
  * Class Libvirt::NWFilter
119
124
  */
120
- void init_nwfilter()
125
+ void ruby_libvirt_nwfilter_init(void)
121
126
  {
122
127
  #if HAVE_TYPE_VIRNWFILTERPTR
123
128
  c_nwfilter = rb_define_class_under(m_libvirt, "NWFilter", rb_cObject);