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.
- checksums.yaml +7 -0
- data/NEWS +10 -0
- data/README +188 -21
- data/Rakefile +11 -7
- data/ext/libvirt/_libvirt.c +252 -234
- data/ext/libvirt/common.c +346 -71
- data/ext/libvirt/common.h +171 -111
- data/ext/libvirt/connect.c +1851 -798
- data/ext/libvirt/connect.h +6 -5
- data/ext/libvirt/domain.c +3903 -1060
- data/ext/libvirt/domain.h +5 -3
- data/ext/libvirt/extconf.rb +275 -41
- data/ext/libvirt/interface.c +60 -41
- data/ext/libvirt/interface.h +3 -1
- data/ext/libvirt/network.c +291 -72
- data/ext/libvirt/network.h +3 -2
- data/ext/libvirt/nodedevice.c +138 -59
- data/ext/libvirt/nodedevice.h +3 -1
- data/ext/libvirt/nwfilter.c +39 -34
- data/ext/libvirt/nwfilter.h +3 -1
- data/ext/libvirt/secret.c +122 -64
- data/ext/libvirt/secret.h +3 -1
- data/ext/libvirt/storage.c +451 -233
- data/ext/libvirt/storage.h +1 -1
- data/ext/libvirt/stream.c +120 -122
- data/ext/libvirt/stream.h +4 -2
- data/tests/test_conn.rb +214 -67
- data/tests/test_domain.rb +553 -209
- data/tests/test_interface.rb +4 -10
- data/tests/test_network.rb +21 -12
- data/tests/test_nodedevice.rb +11 -1
- data/tests/test_nwfilter.rb +4 -0
- data/tests/test_open.rb +59 -6
- data/tests/test_secret.rb +25 -0
- data/tests/test_storage.rb +132 -28
- data/tests/test_stream.rb +171 -0
- data/tests/test_utils.rb +86 -15
- metadata +43 -66
data/ext/libvirt/network.h
CHANGED
data/ext/libvirt/nodedevice.c
CHANGED
@@ -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
|
-
|
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
|
36
|
-
|
37
|
+
static virNodeDevicePtr nodedevice_get(VALUE n)
|
38
|
+
{
|
39
|
+
ruby_libvirt_get_struct(NodeDevice, n);
|
37
40
|
}
|
38
41
|
|
39
|
-
VALUE
|
40
|
-
|
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
|
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
|
-
|
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
|
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
|
-
|
63
|
-
|
64
|
-
*
|
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
|
-
|
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
|
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
|
-
|
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
|
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(
|
101
|
-
|
102
|
-
|
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
|
-
|
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
|
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
|
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
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
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
|
144
|
-
|
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
|
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
|
155
|
-
|
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
|
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
|
166
|
-
|
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
|
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
|
178
|
-
|
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
|
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
|
191
|
-
|
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
|
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,
|
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
|
}
|
data/ext/libvirt/nodedevice.h
CHANGED
data/ext/libvirt/nwfilter.c
CHANGED
@@ -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 *
|
32
|
-
|
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
|
36
|
-
|
37
|
+
static virNWFilterPtr nwfilter_get(VALUE n)
|
38
|
+
{
|
39
|
+
ruby_libvirt_get_struct(NWFilter, n);
|
37
40
|
}
|
38
41
|
|
39
|
-
VALUE
|
40
|
-
|
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
|
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
|
51
|
-
|
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
|
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
|
62
|
-
|
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
|
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
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
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
|
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
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
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
|
112
|
-
|
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
|
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);
|