ruby-libvirt 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +6 -0
- data/README +1 -1
- data/README.rdoc +1 -1
- data/Rakefile +2 -2
- data/ext/libvirt/_libvirt.c +10 -100
- data/ext/libvirt/common.c +0 -2
- data/ext/libvirt/connect.c +110 -354
- data/ext/libvirt/domain.c +258 -949
- data/ext/libvirt/extconf.h +0 -390
- data/ext/libvirt/extconf.rb +6 -454
- 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
- metadata +4 -4
data/ext/libvirt/domain.c
CHANGED
@@ -25,70 +25,26 @@
|
|
25
25
|
/* we need to include st.h since ruby 1.8 needs it for RHash */
|
26
26
|
#include <ruby/st.h>
|
27
27
|
#include <libvirt/libvirt.h>
|
28
|
-
#if HAVE_VIRDOMAINQEMUMONITORCOMMAND
|
29
28
|
#include <libvirt/libvirt-qemu.h>
|
30
|
-
#endif
|
31
|
-
#if HAVE_VIRDOMAINLXCOPENNAMESPACE
|
32
29
|
#include <libvirt/libvirt-lxc.h>
|
33
|
-
#endif
|
34
30
|
#include <libvirt/virterror.h>
|
35
31
|
#include "common.h"
|
36
32
|
#include "connect.h"
|
37
33
|
#include "extconf.h"
|
38
34
|
#include "stream.h"
|
39
35
|
|
40
|
-
#ifndef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
41
|
-
#define VIR_TYPED_PARAM_INT VIR_DOMAIN_SCHED_FIELD_INT
|
42
|
-
#define VIR_TYPED_PARAM_UINT VIR_DOMAIN_SCHED_FIELD_UINT
|
43
|
-
#define VIR_TYPED_PARAM_LLONG VIR_DOMAIN_SCHED_FIELD_LLONG
|
44
|
-
#define VIR_TYPED_PARAM_ULLONG VIR_DOMAIN_SCHED_FIELD_ULLONG
|
45
|
-
#define VIR_TYPED_PARAM_DOUBLE VIR_DOMAIN_SCHED_FIELD_DOUBLE
|
46
|
-
#define VIR_TYPED_PARAM_BOOLEAN VIR_DOMAIN_SCHED_FIELD_BOOLEAN
|
47
|
-
#define VIR_TYPED_PARAM_STRING 7
|
48
|
-
|
49
|
-
#define VIR_TYPED_PARAM_FIELD_LENGTH 80
|
50
|
-
typedef struct _virTypedParameter virTypedParameter;
|
51
|
-
struct _virTypedParameter {
|
52
|
-
char field[VIR_TYPED_PARAM_FIELD_LENGTH]; /* parameter name */
|
53
|
-
int type; /* parameter type, virTypedParameterType */
|
54
|
-
union {
|
55
|
-
int i; /* type is INT */
|
56
|
-
unsigned int ui; /* type is UINT */
|
57
|
-
long long int l; /* type is LLONG */
|
58
|
-
unsigned long long int ul; /* type is ULLONG */
|
59
|
-
double d; /* type is DOUBLE */
|
60
|
-
char b; /* type is BOOLEAN */
|
61
|
-
char *s; /* type is STRING, may not be NULL */
|
62
|
-
} value; /* parameter value */
|
63
|
-
};
|
64
|
-
typedef virTypedParameter *virTypedParameterPtr;
|
65
|
-
|
66
|
-
#endif
|
67
|
-
|
68
36
|
static VALUE c_domain;
|
69
37
|
static VALUE c_domain_info;
|
70
38
|
static VALUE c_domain_ifinfo;
|
71
39
|
VALUE c_domain_security_label;
|
72
40
|
static VALUE c_domain_block_stats;
|
73
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
74
41
|
static VALUE c_domain_block_info;
|
75
|
-
#endif
|
76
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
77
42
|
static VALUE c_domain_memory_stats;
|
78
|
-
#endif
|
79
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
80
43
|
static VALUE c_domain_snapshot;
|
81
|
-
#endif
|
82
|
-
#if HAVE_TYPE_VIRDOMAINJOBINFOPTR
|
83
44
|
static VALUE c_domain_job_info;
|
84
|
-
#endif
|
85
45
|
static VALUE c_domain_vcpuinfo;
|
86
|
-
#if HAVE_VIRDOMAINGETCONTROLINFO
|
87
46
|
static VALUE c_domain_control_info;
|
88
|
-
#endif
|
89
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKJOBINFOPTR
|
90
47
|
static VALUE c_domain_block_job_info;
|
91
|
-
#endif
|
92
48
|
|
93
49
|
static void domain_free(void *d)
|
94
50
|
{
|
@@ -129,7 +85,7 @@ static void domain_input_to_fixnum_and_flags(VALUE in, VALUE *hash, VALUE *flags
|
|
129
85
|
* call-seq:
|
130
86
|
* dom.migrate(dconn, flags=0, dname=nil, uri=nil, bandwidth=0) -> Libvirt::Domain
|
131
87
|
*
|
132
|
-
* Call virDomainMigrate[
|
88
|
+
* Call virDomainMigrate[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate]
|
133
89
|
* to migrate a domain from the host on this connection to the connection
|
134
90
|
* referenced in dconn.
|
135
91
|
*/
|
@@ -154,12 +110,11 @@ static VALUE libvirt_domain_migrate(int argc, VALUE *argv, VALUE d)
|
|
154
110
|
return ruby_libvirt_domain_new(ddom, dconn);
|
155
111
|
}
|
156
112
|
|
157
|
-
#if HAVE_VIRDOMAINMIGRATETOURI
|
158
113
|
/*
|
159
114
|
* call-seq:
|
160
115
|
* dom.migrate_to_uri(duri, flags=0, dname=nil, bandwidth=0) -> nil
|
161
116
|
*
|
162
|
-
* Call virDomainMigrateToURI[
|
117
|
+
* Call virDomainMigrateToURI[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI]
|
163
118
|
* to migrate a domain from the host on this connection to the host whose
|
164
119
|
* libvirt URI is duri.
|
165
120
|
*/
|
@@ -176,14 +131,12 @@ static VALUE libvirt_domain_migrate_to_uri(int argc, VALUE *argv, VALUE d)
|
|
176
131
|
ruby_libvirt_get_cstring_or_null(dname),
|
177
132
|
ruby_libvirt_value_to_ulong(bandwidth));
|
178
133
|
}
|
179
|
-
#endif
|
180
134
|
|
181
|
-
#if HAVE_VIRDOMAINMIGRATESETMAXDOWNTIME
|
182
135
|
/*
|
183
136
|
* call-seq:
|
184
137
|
* dom.migrate_set_max_downtime(downtime, flags=0) -> nil
|
185
138
|
*
|
186
|
-
* Call virDomainMigrateSetMaxDowntime[
|
139
|
+
* Call virDomainMigrateSetMaxDowntime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime]
|
187
140
|
* to set the maximum downtime desired for live migration. Deprecated; use
|
188
141
|
* dom.migrate_max_downtime= instead.
|
189
142
|
*/
|
@@ -205,7 +158,7 @@ static VALUE libvirt_domain_migrate_set_max_downtime(int argc, VALUE *argv,
|
|
205
158
|
* call-seq:
|
206
159
|
* dom.migrate_max_downtime = downtime,flags=0
|
207
160
|
*
|
208
|
-
* Call virDomainMigrateSetMaxDowntime[
|
161
|
+
* Call virDomainMigrateSetMaxDowntime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime]
|
209
162
|
* to set the maximum downtime desired for live migration.
|
210
163
|
*/
|
211
164
|
static VALUE libvirt_domain_migrate_max_downtime_equal(VALUE d, VALUE in)
|
@@ -220,14 +173,12 @@ static VALUE libvirt_domain_migrate_max_downtime_equal(VALUE d, VALUE in)
|
|
220
173
|
NUM2ULL(downtime),
|
221
174
|
ruby_libvirt_value_to_uint(flags));
|
222
175
|
}
|
223
|
-
#endif
|
224
176
|
|
225
|
-
#if HAVE_VIRDOMAINMIGRATE2
|
226
177
|
/*
|
227
178
|
* call-seq:
|
228
179
|
* dom.migrate2(dconn, dxml=nil, flags=0, dname=nil, uri=nil, bandwidth=0) -> Libvirt::Domain
|
229
180
|
*
|
230
|
-
* Call virDomainMigrate2[
|
181
|
+
* Call virDomainMigrate2[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate2]
|
231
182
|
* to migrate a domain from the host on this connection to the connection
|
232
183
|
* referenced in dconn.
|
233
184
|
*/
|
@@ -257,7 +208,7 @@ static VALUE libvirt_domain_migrate2(int argc, VALUE *argv, VALUE d)
|
|
257
208
|
* call-seq:
|
258
209
|
* dom.migrate_to_uri2(duri=nil, migrate_uri=nil, dxml=nil, flags=0, dname=nil, bandwidth=0) -> nil
|
259
210
|
*
|
260
|
-
* Call virDomainMigrateToURI2[
|
211
|
+
* Call virDomainMigrateToURI2[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI2]
|
261
212
|
* to migrate a domain from the host on this connection to the host whose
|
262
213
|
* libvirt URI is duri.
|
263
214
|
*/
|
@@ -283,7 +234,7 @@ static VALUE libvirt_domain_migrate_to_uri2(int argc, VALUE *argv, VALUE d)
|
|
283
234
|
* call-seq:
|
284
235
|
* dom.migrate_set_max_speed(bandwidth, flags=0) -> nil
|
285
236
|
*
|
286
|
-
* Call virDomainMigrateSetMaxSpeed[
|
237
|
+
* Call virDomainMigrateSetMaxSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed]
|
287
238
|
* to set the maximum bandwidth allowed for live migration. Deprecated; use
|
288
239
|
* dom.migrate_max_speed= instead.
|
289
240
|
*/
|
@@ -305,7 +256,7 @@ static VALUE libvirt_domain_migrate_set_max_speed(int argc, VALUE *argv,
|
|
305
256
|
* call-seq:
|
306
257
|
* dom.migrate_max_speed = bandwidth,flags=0
|
307
258
|
*
|
308
|
-
* Call virDomainMigrateSetMaxSpeed[
|
259
|
+
* Call virDomainMigrateSetMaxSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed]
|
309
260
|
* to set the maximum bandwidth allowed for live migration.
|
310
261
|
*/
|
311
262
|
static VALUE libvirt_domain_migrate_max_speed_equal(VALUE d, VALUE in)
|
@@ -320,13 +271,12 @@ static VALUE libvirt_domain_migrate_max_speed_equal(VALUE d, VALUE in)
|
|
320
271
|
NUM2ULONG(bandwidth),
|
321
272
|
ruby_libvirt_value_to_uint(flags));
|
322
273
|
}
|
323
|
-
#endif
|
324
274
|
|
325
275
|
/*
|
326
276
|
* call-seq:
|
327
277
|
* dom.shutdown(flags=0) -> nil
|
328
278
|
*
|
329
|
-
* Call virDomainShutdown[
|
279
|
+
* Call virDomainShutdown[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdown]
|
330
280
|
* to do a soft shutdown of the domain. The mechanism for doing the shutdown
|
331
281
|
* is hypervisor specific, and may require software running inside the domain
|
332
282
|
* to succeed.
|
@@ -337,27 +287,23 @@ static VALUE libvirt_domain_shutdown(int argc, VALUE *argv, VALUE d)
|
|
337
287
|
|
338
288
|
rb_scan_args(argc, argv, "01", &flags);
|
339
289
|
|
340
|
-
#if HAVE_VIRDOMAINSHUTDOWNFLAGS
|
341
|
-
ruby_libvirt_generate_call_nil(virDomainShutdownFlags,
|
342
|
-
ruby_libvirt_connect_get(d),
|
343
|
-
ruby_libvirt_domain_get(d),
|
344
|
-
ruby_libvirt_value_to_uint(flags));
|
345
|
-
#else
|
346
290
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
347
|
-
|
291
|
+
ruby_libvirt_generate_call_nil(virDomainShutdownFlags,
|
292
|
+
ruby_libvirt_connect_get(d),
|
293
|
+
ruby_libvirt_domain_get(d),
|
294
|
+
ruby_libvirt_value_to_uint(flags));
|
295
|
+
} else {
|
296
|
+
ruby_libvirt_generate_call_nil(virDomainShutdown,
|
297
|
+
ruby_libvirt_connect_get(d),
|
298
|
+
ruby_libvirt_domain_get(d));
|
348
299
|
}
|
349
|
-
|
350
|
-
ruby_libvirt_generate_call_nil(virDomainShutdown,
|
351
|
-
ruby_libvirt_connect_get(d),
|
352
|
-
ruby_libvirt_domain_get(d));
|
353
|
-
#endif
|
354
300
|
}
|
355
301
|
|
356
302
|
/*
|
357
303
|
* call-seq:
|
358
304
|
* dom.reboot(flags=0) -> nil
|
359
305
|
*
|
360
|
-
* Call virDomainReboot[
|
306
|
+
* Call virDomainReboot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot]
|
361
307
|
* to do a reboot of the domain.
|
362
308
|
*/
|
363
309
|
static VALUE libvirt_domain_reboot(int argc, VALUE *argv, VALUE d)
|
@@ -375,7 +321,7 @@ static VALUE libvirt_domain_reboot(int argc, VALUE *argv, VALUE d)
|
|
375
321
|
* call-seq:
|
376
322
|
* dom.destroy(flags=0) -> nil
|
377
323
|
*
|
378
|
-
* Call virDomainDestroy[
|
324
|
+
* Call virDomainDestroy[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroy]
|
379
325
|
* to do a hard power-off of the domain.
|
380
326
|
*/
|
381
327
|
static VALUE libvirt_domain_destroy(int argc, VALUE *argv, VALUE d)
|
@@ -384,26 +330,23 @@ static VALUE libvirt_domain_destroy(int argc, VALUE *argv, VALUE d)
|
|
384
330
|
|
385
331
|
rb_scan_args(argc, argv, "01", &flags);
|
386
332
|
|
387
|
-
#if HAVE_VIRDOMAINDESTROYFLAGS
|
388
|
-
ruby_libvirt_generate_call_nil(virDomainDestroyFlags,
|
389
|
-
ruby_libvirt_connect_get(d),
|
390
|
-
ruby_libvirt_domain_get(d),
|
391
|
-
ruby_libvirt_value_to_uint(flags));
|
392
|
-
#else
|
393
333
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
394
|
-
|
334
|
+
ruby_libvirt_generate_call_nil(virDomainDestroyFlags,
|
335
|
+
ruby_libvirt_connect_get(d),
|
336
|
+
ruby_libvirt_domain_get(d),
|
337
|
+
ruby_libvirt_value_to_uint(flags));
|
338
|
+
} else {
|
339
|
+
ruby_libvirt_generate_call_nil(virDomainDestroy,
|
340
|
+
ruby_libvirt_connect_get(d),
|
341
|
+
ruby_libvirt_domain_get(d));
|
395
342
|
}
|
396
|
-
ruby_libvirt_generate_call_nil(virDomainDestroy,
|
397
|
-
ruby_libvirt_connect_get(d),
|
398
|
-
ruby_libvirt_domain_get(d));
|
399
|
-
#endif
|
400
343
|
}
|
401
344
|
|
402
345
|
/*
|
403
346
|
* call-seq:
|
404
347
|
* dom.suspend -> nil
|
405
348
|
*
|
406
|
-
* Call virDomainSuspend[
|
349
|
+
* Call virDomainSuspend[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSuspend]
|
407
350
|
* to stop the domain from executing. The domain will still continue to
|
408
351
|
* consume memory, but will not take any CPU time.
|
409
352
|
*/
|
@@ -418,7 +361,7 @@ static VALUE libvirt_domain_suspend(VALUE d)
|
|
418
361
|
* call-seq:
|
419
362
|
* dom.resume -> nil
|
420
363
|
*
|
421
|
-
* Call virDomainResume[
|
364
|
+
* Call virDomainResume[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume]
|
422
365
|
* to resume a suspended domain. After this call the domain will start
|
423
366
|
* consuming CPU resources again.
|
424
367
|
*/
|
@@ -432,7 +375,7 @@ static VALUE libvirt_domain_resume(VALUE d)
|
|
432
375
|
* call-seq:
|
433
376
|
* dom.save(filename, dxml=nil, flags=0) -> nil
|
434
377
|
*
|
435
|
-
* Call virDomainSave[
|
378
|
+
* Call virDomainSave[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSave]
|
436
379
|
* to save the domain state to filename. After this call, the domain will no
|
437
380
|
* longer be consuming any resources.
|
438
381
|
*/
|
@@ -442,32 +385,26 @@ static VALUE libvirt_domain_save(int argc, VALUE *argv, VALUE d)
|
|
442
385
|
|
443
386
|
rb_scan_args(argc, argv, "12", &to, &dxml, &flags);
|
444
387
|
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
388
|
+
if (ruby_libvirt_value_to_uint(flags) != 0 || TYPE(dxml) != T_NIL) {
|
389
|
+
ruby_libvirt_generate_call_nil(virDomainSaveFlags,
|
390
|
+
ruby_libvirt_connect_get(d),
|
391
|
+
ruby_libvirt_domain_get(d),
|
392
|
+
StringValueCStr(to),
|
393
|
+
ruby_libvirt_get_cstring_or_null(dxml),
|
394
|
+
ruby_libvirt_value_to_uint(flags));
|
395
|
+
} else {
|
396
|
+
ruby_libvirt_generate_call_nil(virDomainSave,
|
397
|
+
ruby_libvirt_connect_get(d),
|
398
|
+
ruby_libvirt_domain_get(d),
|
399
|
+
StringValueCStr(to));
|
455
400
|
}
|
456
|
-
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
457
|
-
rb_raise(e_NoSupportError, "Non-zero flags not supported");
|
458
|
-
}
|
459
|
-
ruby_libvirt_generate_call_nil(virDomainSave, ruby_libvirt_connect_get(d),
|
460
|
-
ruby_libvirt_domain_get(d),
|
461
|
-
StringValueCStr(to));
|
462
|
-
#endif
|
463
401
|
}
|
464
402
|
|
465
|
-
#if HAVE_VIRDOMAINMANAGEDSAVE
|
466
403
|
/*
|
467
404
|
* call-seq:
|
468
405
|
* dom.managed_save(flags=0) -> nil
|
469
406
|
*
|
470
|
-
* Call virDomainManagedSave[
|
407
|
+
* Call virDomainManagedSave[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSave]
|
471
408
|
* to do a managed save of the domain. The domain will be saved to a place
|
472
409
|
* of libvirt's choosing.
|
473
410
|
*/
|
@@ -487,7 +424,7 @@ static VALUE libvirt_domain_managed_save(int argc, VALUE *argv, VALUE d)
|
|
487
424
|
* call-seq:
|
488
425
|
* dom.has_managed_save?(flags=0) -> [True|False]
|
489
426
|
*
|
490
|
-
* Call virDomainHasManagedSaveImage[
|
427
|
+
* Call virDomainHasManagedSaveImage[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasManagedSaveImage]
|
491
428
|
* to determine if a particular domain has a managed save image.
|
492
429
|
*/
|
493
430
|
static VALUE libvirt_domain_has_managed_save(int argc, VALUE *argv, VALUE d)
|
@@ -506,7 +443,7 @@ static VALUE libvirt_domain_has_managed_save(int argc, VALUE *argv, VALUE d)
|
|
506
443
|
* call-seq:
|
507
444
|
* dom.managed_save_remove(flags=0) -> nil
|
508
445
|
*
|
509
|
-
* Call virDomainManagedSaveRemove[
|
446
|
+
* Call virDomainManagedSaveRemove[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveRemove]
|
510
447
|
* to remove the managed save image for a domain.
|
511
448
|
*/
|
512
449
|
static VALUE libvirt_domain_managed_save_remove(int argc, VALUE *argv, VALUE d)
|
@@ -520,13 +457,12 @@ static VALUE libvirt_domain_managed_save_remove(int argc, VALUE *argv, VALUE d)
|
|
520
457
|
ruby_libvirt_domain_get(d),
|
521
458
|
ruby_libvirt_value_to_uint(flags));
|
522
459
|
}
|
523
|
-
#endif
|
524
460
|
|
525
461
|
/*
|
526
462
|
* call-seq:
|
527
463
|
* dom.core_dump(filename, flags=0) -> nil
|
528
464
|
*
|
529
|
-
* Call virDomainCoreDump[
|
465
|
+
* Call virDomainCoreDump[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump]
|
530
466
|
* to do a full memory dump of the domain to filename.
|
531
467
|
*/
|
532
468
|
static VALUE libvirt_domain_core_dump(int argc, VALUE *argv, VALUE d)
|
@@ -546,7 +482,7 @@ static VALUE libvirt_domain_core_dump(int argc, VALUE *argv, VALUE d)
|
|
546
482
|
* call-seq:
|
547
483
|
* Libvirt::Domain::restore(conn, filename) -> nil
|
548
484
|
*
|
549
|
-
* Call virDomainRestore[
|
485
|
+
* Call virDomainRestore[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestore]
|
550
486
|
* to restore the domain from the filename.
|
551
487
|
*/
|
552
488
|
static VALUE libvirt_domain_s_restore(VALUE RUBY_LIBVIRT_UNUSED(klass), VALUE c,
|
@@ -562,7 +498,7 @@ static VALUE libvirt_domain_s_restore(VALUE RUBY_LIBVIRT_UNUSED(klass), VALUE c,
|
|
562
498
|
* call-seq:
|
563
499
|
* dom.info -> Libvirt::Domain::Info
|
564
500
|
*
|
565
|
-
* Call virDomainGetInfo[
|
501
|
+
* Call virDomainGetInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInfo]
|
566
502
|
* to retrieve domain information.
|
567
503
|
*/
|
568
504
|
static VALUE libvirt_domain_info(VALUE d)
|
@@ -585,12 +521,11 @@ static VALUE libvirt_domain_info(VALUE d)
|
|
585
521
|
return result;
|
586
522
|
}
|
587
523
|
|
588
|
-
#if HAVE_VIRDOMAINGETSECURITYLABEL
|
589
524
|
/*
|
590
525
|
* call-seq:
|
591
526
|
* dom.security_label -> Libvirt::Domain::SecurityLabel
|
592
527
|
*
|
593
|
-
* Call virDomainGetSecurityLabel[
|
528
|
+
* Call virDomainGetSecurityLabel[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabel]
|
594
529
|
* to retrieve the security label applied to this domain.
|
595
530
|
*/
|
596
531
|
static VALUE libvirt_domain_security_label(VALUE d)
|
@@ -610,13 +545,12 @@ static VALUE libvirt_domain_security_label(VALUE d)
|
|
610
545
|
|
611
546
|
return result;
|
612
547
|
}
|
613
|
-
#endif
|
614
548
|
|
615
549
|
/*
|
616
550
|
* call-seq:
|
617
551
|
* dom.block_stats(path) -> Libvirt::Domain::BlockStats
|
618
552
|
*
|
619
|
-
* Call virDomainBlockStats[
|
553
|
+
* Call virDomainBlockStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStats]
|
620
554
|
* to retrieve statistics about domain block device path.
|
621
555
|
*/
|
622
556
|
static VALUE libvirt_domain_block_stats(VALUE d, VALUE path)
|
@@ -640,12 +574,11 @@ static VALUE libvirt_domain_block_stats(VALUE d, VALUE path)
|
|
640
574
|
return result;
|
641
575
|
}
|
642
576
|
|
643
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
644
577
|
/*
|
645
578
|
* call-seq:
|
646
579
|
* dom.memory_stats(flags=0) -> [ Libvirt::Domain::MemoryStats ]
|
647
580
|
*
|
648
|
-
* Call virDomainMemoryStats[
|
581
|
+
* Call virDomainMemoryStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryStats]
|
649
582
|
* to retrieve statistics about the amount of memory consumed by a domain.
|
650
583
|
*/
|
651
584
|
static VALUE libvirt_domain_memory_stats(int argc, VALUE *argv, VALUE d)
|
@@ -682,14 +615,12 @@ static VALUE libvirt_domain_memory_stats(int argc, VALUE *argv, VALUE d)
|
|
682
615
|
|
683
616
|
return result;
|
684
617
|
}
|
685
|
-
#endif
|
686
618
|
|
687
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
688
619
|
/*
|
689
620
|
* call-seq:
|
690
621
|
* dom.blockinfo(path, flags=0) -> Libvirt::Domain::BlockInfo
|
691
622
|
*
|
692
|
-
* Call virDomainGetBlockInfo[
|
623
|
+
* Call virDomainGetBlockInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockInfo]
|
693
624
|
* to retrieve information about the backing file path for the domain.
|
694
625
|
*/
|
695
626
|
static VALUE libvirt_domain_block_info(int argc, VALUE *argv, VALUE d)
|
@@ -713,14 +644,12 @@ static VALUE libvirt_domain_block_info(int argc, VALUE *argv, VALUE d)
|
|
713
644
|
|
714
645
|
return result;
|
715
646
|
}
|
716
|
-
#endif
|
717
647
|
|
718
|
-
#if HAVE_VIRDOMAINBLOCKPEEK
|
719
648
|
/*
|
720
649
|
* call-seq:
|
721
650
|
* dom.block_peek(path, offset, size, flags=0) -> String
|
722
651
|
*
|
723
|
-
* Call virDomainBlockPeek[
|
652
|
+
* Call virDomainBlockPeek[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPeek]
|
724
653
|
* to read size number of bytes, starting at offset offset from domain backing
|
725
654
|
* file path. Due to limitations of the libvirt remote protocol, the user
|
726
655
|
* should never request more than 64k bytes.
|
@@ -743,14 +672,12 @@ static VALUE libvirt_domain_block_peek(int argc, VALUE *argv, VALUE d)
|
|
743
672
|
|
744
673
|
return rb_str_new(buffer, NUM2UINT(size));
|
745
674
|
}
|
746
|
-
#endif
|
747
675
|
|
748
|
-
#if HAVE_VIRDOMAINMEMORYPEEK
|
749
676
|
/*
|
750
677
|
* call-seq:
|
751
678
|
* dom.memory_peek(start, size, flags=Libvirt::Domain::MEMORY_VIRTUAL) -> String
|
752
679
|
*
|
753
|
-
* Call virDomainMemoryPeek[
|
680
|
+
* Call virDomainMemoryPeek[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryPeek]
|
754
681
|
* to read size number of bytes from offset start from the domain memory.
|
755
682
|
* Due to limitations of the libvirt remote protocol, the user
|
756
683
|
* should never request more than 64k bytes.
|
@@ -776,12 +703,11 @@ static VALUE libvirt_domain_memory_peek(int argc, VALUE *argv, VALUE d)
|
|
776
703
|
|
777
704
|
return rb_str_new(buffer, NUM2UINT(size));
|
778
705
|
}
|
779
|
-
#endif
|
780
706
|
|
781
707
|
/* call-seq:
|
782
708
|
* dom.vcpus -> [ Libvirt::Domain::VCPUInfo ]
|
783
709
|
*
|
784
|
-
* Call virDomainGetVcpus[
|
710
|
+
* Call virDomainGetVcpus[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpus]
|
785
711
|
* to retrieve detailed information about the state of a domain's virtual CPUs.
|
786
712
|
*/
|
787
713
|
static VALUE libvirt_domain_vcpus(VALUE d)
|
@@ -808,7 +734,6 @@ static VALUE libvirt_domain_vcpus(VALUE d)
|
|
808
734
|
r = virDomainGetVcpus(ruby_libvirt_domain_get(d), cpuinfo,
|
809
735
|
dominfo.nrVirtCpu, cpumap, cpumaplen);
|
810
736
|
if (r < 0) {
|
811
|
-
#if HAVE_VIRDOMAINGETVCPUPININFO
|
812
737
|
/* if the domain is not shutoff, then this is an error */
|
813
738
|
ruby_libvirt_raise_error_if(dominfo.state != VIR_DOMAIN_SHUTOFF,
|
814
739
|
e_RetrieveError, "virDomainGetVcpus",
|
@@ -823,11 +748,6 @@ static VALUE libvirt_domain_vcpus(VALUE d)
|
|
823
748
|
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError,
|
824
749
|
"virDomainGetVcpuPinInfo",
|
825
750
|
ruby_libvirt_connect_get(d));
|
826
|
-
|
827
|
-
#else
|
828
|
-
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virDomainGetVcpus",
|
829
|
-
ruby_libvirt_connect_get(d));
|
830
|
-
#endif
|
831
751
|
}
|
832
752
|
|
833
753
|
result = rb_ary_new();
|
@@ -861,12 +781,11 @@ static VALUE libvirt_domain_vcpus(VALUE d)
|
|
861
781
|
return result;
|
862
782
|
}
|
863
783
|
|
864
|
-
#if HAVE_VIRDOMAINISACTIVE
|
865
784
|
/*
|
866
785
|
* call-seq:
|
867
786
|
* dom.active? -> [true|false]
|
868
787
|
*
|
869
|
-
* Call virDomainIsActive[
|
788
|
+
* Call virDomainIsActive[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive]
|
870
789
|
* to determine if this domain is currently active.
|
871
790
|
*/
|
872
791
|
static VALUE libvirt_domain_active_p(VALUE d)
|
@@ -875,14 +794,12 @@ static VALUE libvirt_domain_active_p(VALUE d)
|
|
875
794
|
ruby_libvirt_connect_get(d),
|
876
795
|
ruby_libvirt_domain_get(d));
|
877
796
|
}
|
878
|
-
#endif
|
879
797
|
|
880
|
-
#if HAVE_VIRDOMAINISPERSISTENT
|
881
798
|
/*
|
882
799
|
* call-seq:
|
883
800
|
* dom.persistent? -> [true|false]
|
884
801
|
*
|
885
|
-
* Call virDomainIsPersistent[
|
802
|
+
* Call virDomainIsPersistent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsPersistent]
|
886
803
|
* to determine if this is a persistent domain.
|
887
804
|
*/
|
888
805
|
static VALUE libvirt_domain_persistent_p(VALUE d)
|
@@ -891,13 +808,12 @@ static VALUE libvirt_domain_persistent_p(VALUE d)
|
|
891
808
|
ruby_libvirt_connect_get(d),
|
892
809
|
ruby_libvirt_domain_get(d));
|
893
810
|
}
|
894
|
-
#endif
|
895
811
|
|
896
812
|
/*
|
897
813
|
* call-seq:
|
898
814
|
* dom.ifinfo(if) -> Libvirt::Domain::IfInfo
|
899
815
|
*
|
900
|
-
* Call virDomainInterfaceStats[
|
816
|
+
* Call virDomainInterfaceStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceStats]
|
901
817
|
* to retrieve statistics about domain interface if.
|
902
818
|
*/
|
903
819
|
static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
|
@@ -931,7 +847,7 @@ static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
|
|
931
847
|
* call-seq:
|
932
848
|
* dom.name -> String
|
933
849
|
*
|
934
|
-
* Call virDomainGetName[
|
850
|
+
* Call virDomainGetName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName]
|
935
851
|
* to retrieve the name of this domain.
|
936
852
|
*/
|
937
853
|
static VALUE libvirt_domain_name(VALUE d)
|
@@ -945,7 +861,7 @@ static VALUE libvirt_domain_name(VALUE d)
|
|
945
861
|
* call-seq:
|
946
862
|
* dom.id -> Fixnum
|
947
863
|
*
|
948
|
-
* Call virDomainGetID[
|
864
|
+
* Call virDomainGetID[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetID]
|
949
865
|
* to retrieve the ID of this domain. If the domain isn't running, this will
|
950
866
|
* be -1.
|
951
867
|
*/
|
@@ -970,7 +886,7 @@ static VALUE libvirt_domain_id(VALUE d)
|
|
970
886
|
* call-seq:
|
971
887
|
* dom.uuid -> String
|
972
888
|
*
|
973
|
-
* Call virDomainGetUUIDString[
|
889
|
+
* Call virDomainGetUUIDString[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString]
|
974
890
|
* to retrieve the UUID of this domain.
|
975
891
|
*/
|
976
892
|
static VALUE libvirt_domain_uuid(VALUE d)
|
@@ -984,7 +900,7 @@ static VALUE libvirt_domain_uuid(VALUE d)
|
|
984
900
|
* call-seq:
|
985
901
|
* dom.os_type -> String
|
986
902
|
*
|
987
|
-
* Call virDomainGetOSType[
|
903
|
+
* Call virDomainGetOSType[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType]
|
988
904
|
* to retrieve the os_type of this domain. In libvirt terms, os_type determines
|
989
905
|
* whether this domain is fully virtualized, paravirtualized, or a container.
|
990
906
|
*/
|
@@ -999,7 +915,7 @@ static VALUE libvirt_domain_os_type(VALUE d)
|
|
999
915
|
* call-seq:
|
1000
916
|
* dom.max_memory -> Fixnum
|
1001
917
|
*
|
1002
|
-
* Call virDomainGetMaxMemory[
|
918
|
+
* Call virDomainGetMaxMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxMemory]
|
1003
919
|
* to retrieve the maximum amount of memory this domain is allowed to access.
|
1004
920
|
* Note that the current amount of memory this domain is allowed to access may
|
1005
921
|
* be different (see dom.memory_set).
|
@@ -1020,7 +936,7 @@ static VALUE libvirt_domain_max_memory(VALUE d)
|
|
1020
936
|
* call-seq:
|
1021
937
|
* dom.max_memory = Fixnum
|
1022
938
|
*
|
1023
|
-
* Call virDomainSetMaxMemory[
|
939
|
+
* Call virDomainSetMaxMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMaxMemory]
|
1024
940
|
* to set the maximum amount of memory (in kilobytes) this domain should be
|
1025
941
|
* allowed to access.
|
1026
942
|
*/
|
@@ -1041,7 +957,7 @@ static VALUE libvirt_domain_max_memory_equal(VALUE d, VALUE max_memory)
|
|
1041
957
|
* call-seq:
|
1042
958
|
* dom.memory = Fixnum,flags=0
|
1043
959
|
*
|
1044
|
-
* Call virDomainSetMemory[
|
960
|
+
* Call virDomainSetMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory]
|
1045
961
|
* to set the amount of memory (in kilobytes) this domain should currently
|
1046
962
|
* have. Note this will only succeed if both the hypervisor and the domain on
|
1047
963
|
* this connection support ballooning.
|
@@ -1053,15 +969,14 @@ static VALUE libvirt_domain_memory_equal(VALUE d, VALUE in)
|
|
1053
969
|
|
1054
970
|
domain_input_to_fixnum_and_flags(in, &memory, &flags);
|
1055
971
|
|
1056
|
-
#if HAVE_VIRDOMAINSETMEMORYFLAGS
|
1057
|
-
r = virDomainSetMemoryFlags(ruby_libvirt_domain_get(d), NUM2ULONG(memory),
|
1058
|
-
ruby_libvirt_value_to_uint(flags));
|
1059
|
-
#else
|
1060
972
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1061
|
-
|
973
|
+
r = virDomainSetMemoryFlags(ruby_libvirt_domain_get(d),
|
974
|
+
NUM2ULONG(memory),
|
975
|
+
ruby_libvirt_value_to_uint(flags));
|
976
|
+
} else {
|
977
|
+
r = virDomainSetMemory(ruby_libvirt_domain_get(d),
|
978
|
+
NUM2ULONG(memory));
|
1062
979
|
}
|
1063
|
-
r = virDomainSetMemory(ruby_libvirt_domain_get(d), NUM2ULONG(memory));
|
1064
|
-
#endif
|
1065
980
|
|
1066
981
|
ruby_libvirt_raise_error_if(r < 0, e_DefinitionError, "virDomainSetMemory",
|
1067
982
|
ruby_libvirt_connect_get(d));
|
@@ -1073,7 +988,7 @@ static VALUE libvirt_domain_memory_equal(VALUE d, VALUE in)
|
|
1073
988
|
* call-seq:
|
1074
989
|
* dom.max_vcpus -> Fixnum
|
1075
990
|
*
|
1076
|
-
* Call virDomainGetMaxVcpus[
|
991
|
+
* Call virDomainGetMaxVcpus[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus]
|
1077
992
|
* to retrieve the maximum number of virtual CPUs this domain can use.
|
1078
993
|
*/
|
1079
994
|
static VALUE libvirt_domain_max_vcpus(VALUE d)
|
@@ -1083,11 +998,10 @@ static VALUE libvirt_domain_max_vcpus(VALUE d)
|
|
1083
998
|
ruby_libvirt_domain_get(d));
|
1084
999
|
}
|
1085
1000
|
|
1086
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
1087
1001
|
/* call-seq:
|
1088
1002
|
* dom.num_vcpus(flags) -> Fixnum
|
1089
1003
|
*
|
1090
|
-
* Call virDomainGetVcpusFlags[
|
1004
|
+
* Call virDomainGetVcpusFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags]
|
1091
1005
|
* to retrieve the number of virtual CPUs assigned to this domain.
|
1092
1006
|
*/
|
1093
1007
|
static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
|
@@ -1097,13 +1011,12 @@ static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
|
|
1097
1011
|
ruby_libvirt_domain_get(d),
|
1098
1012
|
ruby_libvirt_value_to_uint(flags));
|
1099
1013
|
}
|
1100
|
-
#endif
|
1101
1014
|
|
1102
1015
|
/*
|
1103
1016
|
* call-seq:
|
1104
1017
|
* dom.vcpus = Fixnum,flags=0
|
1105
1018
|
*
|
1106
|
-
* Call virDomainSetVcpus[
|
1019
|
+
* Call virDomainSetVcpus[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpus]
|
1107
1020
|
* to set the current number of virtual CPUs this domain should have. Note
|
1108
1021
|
* that this will only work if both the hypervisor and domain on this
|
1109
1022
|
* connection support virtual CPU hotplug/hot-unplug.
|
@@ -1114,46 +1027,34 @@ static VALUE libvirt_domain_vcpus_equal(VALUE d, VALUE in)
|
|
1114
1027
|
|
1115
1028
|
if (TYPE(in) == T_FIXNUM) {
|
1116
1029
|
nvcpus = in;
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1030
|
+
ruby_libvirt_generate_call_nil(virDomainSetVcpus,
|
1031
|
+
ruby_libvirt_connect_get(d),
|
1032
|
+
ruby_libvirt_domain_get(d),
|
1033
|
+
NUM2UINT(nvcpus));
|
1034
|
+
} else if (TYPE(in) == T_ARRAY) {
|
1121
1035
|
if (RARRAY_LEN(in) != 2) {
|
1122
1036
|
rb_raise(rb_eArgError, "wrong number of arguments (%ld for 2)",
|
1123
1037
|
RARRAY_LEN(in));
|
1124
1038
|
}
|
1125
1039
|
nvcpus = rb_ary_entry(in, 0);
|
1126
1040
|
flags = rb_ary_entry(in, 1);
|
1127
|
-
|
1128
|
-
|
1041
|
+
ruby_libvirt_generate_call_nil(virDomainSetVcpusFlags,
|
1042
|
+
ruby_libvirt_connect_get(d),
|
1043
|
+
ruby_libvirt_domain_get(d),
|
1044
|
+
NUM2UINT(nvcpus),
|
1045
|
+
NUM2UINT(flags));
|
1046
|
+
} else {
|
1129
1047
|
rb_raise(rb_eTypeError,
|
1130
1048
|
"wrong argument type (expected Number or Array)");
|
1131
1049
|
}
|
1132
|
-
|
1133
|
-
ruby_libvirt_generate_call_nil(virDomainSetVcpusFlags,
|
1134
|
-
ruby_libvirt_connect_get(d),
|
1135
|
-
ruby_libvirt_domain_get(d), NUM2UINT(nvcpus),
|
1136
|
-
NUM2UINT(flags));
|
1137
|
-
#else
|
1138
|
-
|
1139
|
-
if (NUM2UINT(flags) != 0) {
|
1140
|
-
rb_raise(e_NoSupportError, "Non-zero flags not supported");
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
ruby_libvirt_generate_call_nil(virDomainSetVcpus,
|
1144
|
-
ruby_libvirt_connect_get(d),
|
1145
|
-
ruby_libvirt_domain_get(d),
|
1146
|
-
NUM2UINT(nvcpus));
|
1147
|
-
#endif
|
1148
1050
|
}
|
1149
1051
|
|
1150
|
-
#if HAVE_VIRDOMAINSETVCPUSFLAGS
|
1151
1052
|
/*
|
1152
1053
|
* call-seq:
|
1153
1054
|
* dom.vcpus_flags = Fixnum,flags=0
|
1154
1055
|
*
|
1155
1056
|
|
1156
|
-
* Call virDomainSetVcpusFlags[
|
1057
|
+
* Call virDomainSetVcpusFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpusFlags]
|
1157
1058
|
* to set the current number of virtual CPUs this domain should have. The
|
1158
1059
|
* flags parameter controls whether the change is made to the running domain
|
1159
1060
|
* the domain configuration, or both, and must not be 0. Deprecated;
|
@@ -1170,13 +1071,12 @@ static VALUE libvirt_domain_vcpus_flags_equal(VALUE d, VALUE in)
|
|
1170
1071
|
ruby_libvirt_domain_get(d), NUM2UINT(nvcpus),
|
1171
1072
|
NUM2UINT(flags));
|
1172
1073
|
}
|
1173
|
-
#endif
|
1174
1074
|
|
1175
1075
|
/*
|
1176
1076
|
* call-seq:
|
1177
1077
|
* dom.pin_vcpu(vcpu, cpulist, flags=0) -> nil
|
1178
1078
|
*
|
1179
|
-
* Call virDomainPinVcpu[
|
1079
|
+
* Call virDomainPinVcpu[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
|
1180
1080
|
* to pin a particular virtual CPU to a range of physical processors. The
|
1181
1081
|
* cpulist should be an array of Fixnums representing the physical processors
|
1182
1082
|
* this virtual CPU should be allowed to be scheduled on.
|
@@ -1203,29 +1103,28 @@ static VALUE libvirt_domain_pin_vcpu(int argc, VALUE *argv, VALUE d)
|
|
1203
1103
|
VIR_USE_CPU(cpumap, NUM2UINT(e));
|
1204
1104
|
}
|
1205
1105
|
|
1206
|
-
#if HAVE_VIRDOMAINPINVCPUFLAGS
|
1207
|
-
ruby_libvirt_generate_call_nil(virDomainPinVcpuFlags,
|
1208
|
-
ruby_libvirt_connect_get(d),
|
1209
|
-
ruby_libvirt_domain_get(d),
|
1210
|
-
NUM2UINT(vcpu), cpumap, cpumaplen,
|
1211
|
-
ruby_libvirt_value_to_uint(flags));
|
1212
|
-
#else
|
1213
1106
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1214
|
-
|
1107
|
+
ruby_libvirt_generate_call_nil(virDomainPinVcpuFlags,
|
1108
|
+
ruby_libvirt_connect_get(d),
|
1109
|
+
ruby_libvirt_domain_get(d),
|
1110
|
+
NUM2UINT(vcpu),
|
1111
|
+
cpumap,
|
1112
|
+
cpumaplen,
|
1113
|
+
ruby_libvirt_value_to_uint(flags));
|
1114
|
+
} else {
|
1115
|
+
ruby_libvirt_generate_call_nil(virDomainPinVcpu,
|
1116
|
+
ruby_libvirt_connect_get(d),
|
1117
|
+
ruby_libvirt_domain_get(d),
|
1118
|
+
NUM2UINT(vcpu),
|
1119
|
+
cpumap, cpumaplen);
|
1215
1120
|
}
|
1216
|
-
|
1217
|
-
ruby_libvirt_generate_call_nil(virDomainPinVcpu,
|
1218
|
-
ruby_libvirt_connect_get(d),
|
1219
|
-
ruby_libvirt_domain_get(d), NUM2UINT(vcpu),
|
1220
|
-
cpumap, cpumaplen);
|
1221
|
-
#endif
|
1222
1121
|
}
|
1223
1122
|
|
1224
1123
|
/*
|
1225
1124
|
* call-seq:
|
1226
1125
|
* dom.xml_desc(flags=0) -> String
|
1227
1126
|
*
|
1228
|
-
* Call virDomainGetXMLDesc[
|
1127
|
+
* Call virDomainGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc]
|
1229
1128
|
* to retrieve the XML describing this domain.
|
1230
1129
|
*/
|
1231
1130
|
static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
|
@@ -1244,7 +1143,7 @@ static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
|
|
1244
1143
|
* call-seq:
|
1245
1144
|
* dom.undefine(flags=0) -> nil
|
1246
1145
|
*
|
1247
|
-
* Call virDomainUndefine[
|
1146
|
+
* Call virDomainUndefine[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefine]
|
1248
1147
|
* to undefine the domain. After this call, the domain object is no longer
|
1249
1148
|
* valid.
|
1250
1149
|
*/
|
@@ -1254,27 +1153,23 @@ static VALUE libvirt_domain_undefine(int argc, VALUE *argv, VALUE d)
|
|
1254
1153
|
|
1255
1154
|
rb_scan_args(argc, argv, "01", &flags);
|
1256
1155
|
|
1257
|
-
#if HAVE_VIRDOMAINUNDEFINEFLAGS
|
1258
|
-
ruby_libvirt_generate_call_nil(virDomainUndefineFlags,
|
1259
|
-
ruby_libvirt_connect_get(d),
|
1260
|
-
ruby_libvirt_domain_get(d),
|
1261
|
-
ruby_libvirt_value_to_uint(flags));
|
1262
|
-
#else
|
1263
1156
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1264
|
-
|
1157
|
+
ruby_libvirt_generate_call_nil(virDomainUndefineFlags,
|
1158
|
+
ruby_libvirt_connect_get(d),
|
1159
|
+
ruby_libvirt_domain_get(d),
|
1160
|
+
ruby_libvirt_value_to_uint(flags));
|
1161
|
+
} else {
|
1162
|
+
ruby_libvirt_generate_call_nil(virDomainUndefine,
|
1163
|
+
ruby_libvirt_connect_get(d),
|
1164
|
+
ruby_libvirt_domain_get(d));
|
1265
1165
|
}
|
1266
|
-
|
1267
|
-
ruby_libvirt_generate_call_nil(virDomainUndefine,
|
1268
|
-
ruby_libvirt_connect_get(d),
|
1269
|
-
ruby_libvirt_domain_get(d));
|
1270
|
-
#endif
|
1271
1166
|
}
|
1272
1167
|
|
1273
1168
|
/*
|
1274
1169
|
* call-seq:
|
1275
1170
|
* dom.create(flags=0) -> nil
|
1276
1171
|
*
|
1277
|
-
* Call virDomainCreate[
|
1172
|
+
* Call virDomainCreate[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreate]
|
1278
1173
|
* to start an already defined domain.
|
1279
1174
|
*/
|
1280
1175
|
static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
|
@@ -1283,25 +1178,23 @@ static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
|
|
1283
1178
|
|
1284
1179
|
rb_scan_args(argc, argv, "01", &flags);
|
1285
1180
|
|
1286
|
-
#if HAVE_VIRDOMAINCREATEWITHFLAGS
|
1287
|
-
ruby_libvirt_generate_call_nil(virDomainCreateWithFlags,
|
1288
|
-
ruby_libvirt_connect_get(d),
|
1289
|
-
ruby_libvirt_domain_get(d),
|
1290
|
-
ruby_libvirt_value_to_uint(flags));
|
1291
|
-
#else
|
1292
1181
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1293
|
-
|
1182
|
+
ruby_libvirt_generate_call_nil(virDomainCreateWithFlags,
|
1183
|
+
ruby_libvirt_connect_get(d),
|
1184
|
+
ruby_libvirt_domain_get(d),
|
1185
|
+
ruby_libvirt_value_to_uint(flags));
|
1186
|
+
} else {
|
1187
|
+
ruby_libvirt_generate_call_nil(virDomainCreate,
|
1188
|
+
ruby_libvirt_connect_get(d),
|
1189
|
+
ruby_libvirt_domain_get(d));
|
1294
1190
|
}
|
1295
|
-
ruby_libvirt_generate_call_nil(virDomainCreate, ruby_libvirt_connect_get(d),
|
1296
|
-
ruby_libvirt_domain_get(d));
|
1297
|
-
#endif
|
1298
1191
|
}
|
1299
1192
|
|
1300
1193
|
/*
|
1301
1194
|
* call-seq:
|
1302
1195
|
* dom.autostart -> [true|false]
|
1303
1196
|
*
|
1304
|
-
* Call virDomainGetAutostart[
|
1197
|
+
* Call virDomainGetAutostart[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetAutostart]
|
1305
1198
|
* to find out the state of the autostart flag for a domain.
|
1306
1199
|
*/
|
1307
1200
|
static VALUE libvirt_domain_autostart(VALUE d)
|
@@ -1319,7 +1212,7 @@ static VALUE libvirt_domain_autostart(VALUE d)
|
|
1319
1212
|
* call-seq:
|
1320
1213
|
* dom.autostart = [true|false]
|
1321
1214
|
*
|
1322
|
-
* Call virDomainSetAutostart[
|
1215
|
+
* Call virDomainSetAutostart[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetAutostart]
|
1323
1216
|
* to make this domain autostart when libvirtd starts up.
|
1324
1217
|
*/
|
1325
1218
|
static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
|
@@ -1339,7 +1232,7 @@ static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
|
|
1339
1232
|
* call-seq:
|
1340
1233
|
* dom.attach_device(device_xml, flags=0) -> nil
|
1341
1234
|
*
|
1342
|
-
* Call virDomainAttachDevice[
|
1235
|
+
* Call virDomainAttachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice]
|
1343
1236
|
* to attach the device described by the device_xml to the domain.
|
1344
1237
|
*/
|
1345
1238
|
static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
|
@@ -1348,28 +1241,25 @@ static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
|
|
1348
1241
|
|
1349
1242
|
rb_scan_args(argc, argv, "11", &xml, &flags);
|
1350
1243
|
|
1351
|
-
#if HAVE_VIRDOMAINATTACHDEVICEFLAGS
|
1352
|
-
ruby_libvirt_generate_call_nil(virDomainAttachDeviceFlags,
|
1353
|
-
ruby_libvirt_connect_get(d),
|
1354
|
-
ruby_libvirt_domain_get(d),
|
1355
|
-
StringValueCStr(xml),
|
1356
|
-
ruby_libvirt_value_to_uint(flags));
|
1357
|
-
#else
|
1358
1244
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1359
|
-
|
1245
|
+
ruby_libvirt_generate_call_nil(virDomainAttachDeviceFlags,
|
1246
|
+
ruby_libvirt_connect_get(d),
|
1247
|
+
ruby_libvirt_domain_get(d),
|
1248
|
+
StringValueCStr(xml),
|
1249
|
+
ruby_libvirt_value_to_uint(flags));
|
1250
|
+
} else {
|
1251
|
+
ruby_libvirt_generate_call_nil(virDomainAttachDevice,
|
1252
|
+
ruby_libvirt_connect_get(d),
|
1253
|
+
ruby_libvirt_domain_get(d),
|
1254
|
+
StringValueCStr(xml));
|
1360
1255
|
}
|
1361
|
-
ruby_libvirt_generate_call_nil(virDomainAttachDevice,
|
1362
|
-
ruby_libvirt_connect_get(d),
|
1363
|
-
ruby_libvirt_domain_get(d),
|
1364
|
-
StringValueCStr(xml));
|
1365
|
-
#endif
|
1366
1256
|
}
|
1367
1257
|
|
1368
1258
|
/*
|
1369
1259
|
* call-seq:
|
1370
1260
|
* dom.detach_device(device_xml, flags=0) -> nil
|
1371
1261
|
*
|
1372
|
-
* Call virDomainDetachDevice[
|
1262
|
+
* Call virDomainDetachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice]
|
1373
1263
|
* to detach the device described by the device_xml from the domain.
|
1374
1264
|
*/
|
1375
1265
|
static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
|
@@ -1378,29 +1268,25 @@ static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
|
|
1378
1268
|
|
1379
1269
|
rb_scan_args(argc, argv, "11", &xml, &flags);
|
1380
1270
|
|
1381
|
-
#if HAVE_VIRDOMAINDETACHDEVICEFLAGS
|
1382
|
-
ruby_libvirt_generate_call_nil(virDomainDetachDeviceFlags,
|
1383
|
-
ruby_libvirt_connect_get(d),
|
1384
|
-
ruby_libvirt_domain_get(d),
|
1385
|
-
StringValueCStr(xml),
|
1386
|
-
ruby_libvirt_value_to_uint(flags));
|
1387
|
-
#else
|
1388
1271
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1389
|
-
|
1272
|
+
ruby_libvirt_generate_call_nil(virDomainDetachDeviceFlags,
|
1273
|
+
ruby_libvirt_connect_get(d),
|
1274
|
+
ruby_libvirt_domain_get(d),
|
1275
|
+
StringValueCStr(xml),
|
1276
|
+
ruby_libvirt_value_to_uint(flags));
|
1277
|
+
} else {
|
1278
|
+
ruby_libvirt_generate_call_nil(virDomainDetachDevice,
|
1279
|
+
ruby_libvirt_connect_get(d),
|
1280
|
+
ruby_libvirt_domain_get(d),
|
1281
|
+
StringValueCStr(xml));
|
1390
1282
|
}
|
1391
|
-
ruby_libvirt_generate_call_nil(virDomainDetachDevice,
|
1392
|
-
ruby_libvirt_connect_get(d),
|
1393
|
-
ruby_libvirt_domain_get(d),
|
1394
|
-
StringValueCStr(xml));
|
1395
|
-
#endif
|
1396
1283
|
}
|
1397
1284
|
|
1398
|
-
#if HAVE_VIRDOMAINUPDATEDEVICEFLAGS
|
1399
1285
|
/*
|
1400
1286
|
* call-seq:
|
1401
1287
|
* dom.update_device(device_xml, flags=0) -> nil
|
1402
1288
|
*
|
1403
|
-
* Call virDomainUpdateDeviceFlags[
|
1289
|
+
* Call virDomainUpdateDeviceFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags]
|
1404
1290
|
* to update the device described by the device_xml.
|
1405
1291
|
*/
|
1406
1292
|
static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
|
@@ -1415,13 +1301,12 @@ static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
|
|
1415
1301
|
StringValueCStr(xml),
|
1416
1302
|
ruby_libvirt_value_to_uint(flags));
|
1417
1303
|
}
|
1418
|
-
#endif
|
1419
1304
|
|
1420
1305
|
/*
|
1421
1306
|
* call-seq:
|
1422
1307
|
* dom.free -> nil
|
1423
1308
|
*
|
1424
|
-
* Call virDomainFree[
|
1309
|
+
* Call virDomainFree[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFree]
|
1425
1310
|
* to free a domain object.
|
1426
1311
|
*/
|
1427
1312
|
static VALUE libvirt_domain_free(VALUE d)
|
@@ -1429,7 +1314,6 @@ static VALUE libvirt_domain_free(VALUE d)
|
|
1429
1314
|
ruby_libvirt_generate_call_free(Domain, d);
|
1430
1315
|
}
|
1431
1316
|
|
1432
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
1433
1317
|
static void domain_snapshot_free(void *d)
|
1434
1318
|
{
|
1435
1319
|
ruby_libvirt_free_struct(DomainSnapshot, d);
|
@@ -1456,7 +1340,7 @@ static virDomainSnapshotPtr domain_snapshot_get(VALUE d)
|
|
1456
1340
|
* call-seq:
|
1457
1341
|
* dom.snapshot_create_xml(snapshot_xml, flags=0) -> Libvirt::Domain::Snapshot
|
1458
1342
|
*
|
1459
|
-
* Call virDomainSnapshotCreateXML[
|
1343
|
+
* Call virDomainSnapshotCreateXML[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotCreateXML]
|
1460
1344
|
* to create a new snapshot based on snapshot_xml.
|
1461
1345
|
*/
|
1462
1346
|
static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
|
@@ -1481,7 +1365,7 @@ static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
|
|
1481
1365
|
* call-seq:
|
1482
1366
|
* dom.num_of_snapshots(flags=0) -> Fixnum
|
1483
1367
|
*
|
1484
|
-
* Call virDomainSnapshotNum[
|
1368
|
+
* Call virDomainSnapshotNum[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNum]
|
1485
1369
|
* to retrieve the number of available snapshots for this domain.
|
1486
1370
|
*/
|
1487
1371
|
static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -1500,7 +1384,7 @@ static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
|
|
1500
1384
|
* call-seq:
|
1501
1385
|
* dom.list_snapshots(flags=0) -> list
|
1502
1386
|
*
|
1503
|
-
* Call virDomainSnapshotListNames[
|
1387
|
+
* Call virDomainSnapshotListNames[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListNames]
|
1504
1388
|
* to retrieve a list of snapshot names available for this domain.
|
1505
1389
|
*/
|
1506
1390
|
static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -1540,7 +1424,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
|
|
1540
1424
|
* call-seq:
|
1541
1425
|
* dom.lookup_snapshot_by_name(name, flags=0) -> Libvirt::Domain::Snapshot
|
1542
1426
|
*
|
1543
|
-
* Call virDomainSnapshotLookupByName[
|
1427
|
+
* Call virDomainSnapshotLookupByName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotLookupByName]
|
1544
1428
|
* to retrieve a snapshot object corresponding to snapshot name.
|
1545
1429
|
*/
|
1546
1430
|
static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
|
@@ -1565,7 +1449,7 @@ static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
|
|
1565
1449
|
* call-seq:
|
1566
1450
|
* dom.has_current_snapshot?(flags=0) -> [true|false]
|
1567
1451
|
*
|
1568
|
-
* Call virDomainHasCurrentSnapshot[
|
1452
|
+
* Call virDomainHasCurrentSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasCurrentSnapshot]
|
1569
1453
|
* to find out if this domain has a snapshot active.
|
1570
1454
|
*/
|
1571
1455
|
static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
|
@@ -1585,7 +1469,7 @@ static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
|
|
1585
1469
|
* call-seq:
|
1586
1470
|
* dom.revert_to_snapshot(snapshot_object, flags=0) -> nil
|
1587
1471
|
*
|
1588
|
-
* Call virDomainRevertToSnapshot[
|
1472
|
+
* Call virDomainRevertToSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRevertToSnapshot]
|
1589
1473
|
* to restore this domain to a previously saved snapshot.
|
1590
1474
|
*/
|
1591
1475
|
static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
|
@@ -1604,7 +1488,7 @@ static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
|
|
1604
1488
|
* call-seq:
|
1605
1489
|
* dom.current_snapshot(flags=0) -> Libvirt::Domain::Snapshot
|
1606
1490
|
*
|
1607
|
-
* Call virDomainCurrentSnapshot[
|
1491
|
+
* Call virDomainCurrentSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCurrentSnapshot]
|
1608
1492
|
* to retrieve the current snapshot for this domain (if any).
|
1609
1493
|
*/
|
1610
1494
|
static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
|
@@ -1627,7 +1511,7 @@ static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
|
|
1627
1511
|
* call-seq:
|
1628
1512
|
* snapshot.xml_desc(flags=0) -> String
|
1629
1513
|
*
|
1630
|
-
* Call virDomainSnapshotGetXMLDesc[
|
1514
|
+
* Call virDomainSnapshotGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetXMLDesc]
|
1631
1515
|
* to retrieve the xml description for this snapshot.
|
1632
1516
|
*/
|
1633
1517
|
static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
|
@@ -1646,7 +1530,7 @@ static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
|
|
1646
1530
|
* call-seq:
|
1647
1531
|
* snapshot.delete(flags=0) -> nil
|
1648
1532
|
*
|
1649
|
-
* Call virDomainSnapshotDelete[
|
1533
|
+
* Call virDomainSnapshotDelete[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotDelete]
|
1650
1534
|
* to delete this snapshot.
|
1651
1535
|
*/
|
1652
1536
|
static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
|
@@ -1665,7 +1549,7 @@ static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
|
|
1665
1549
|
* call-seq:
|
1666
1550
|
* snapshot.free -> nil
|
1667
1551
|
*
|
1668
|
-
* Call virDomainSnapshotFree[
|
1552
|
+
* Call virDomainSnapshotFree[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotFree]
|
1669
1553
|
* to free up the snapshot object. After this call the snapshot object is
|
1670
1554
|
* no longer valid.
|
1671
1555
|
*/
|
@@ -1674,14 +1558,12 @@ static VALUE libvirt_domain_snapshot_free(VALUE s)
|
|
1674
1558
|
ruby_libvirt_generate_call_free(DomainSnapshot, s);
|
1675
1559
|
}
|
1676
1560
|
|
1677
|
-
#endif
|
1678
1561
|
|
1679
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETNAME
|
1680
1562
|
/*
|
1681
1563
|
* call-seq:
|
1682
1564
|
* snapshot.name -> String
|
1683
1565
|
*
|
1684
|
-
* Call virDomainSnapshotGetName[
|
1566
|
+
* Call virDomainSnapshotGetName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetName]
|
1685
1567
|
* to get the name associated with a snapshot.
|
1686
1568
|
*/
|
1687
1569
|
static VALUE libvirt_domain_snapshot_name(VALUE s)
|
@@ -1690,15 +1572,13 @@ static VALUE libvirt_domain_snapshot_name(VALUE s)
|
|
1690
1572
|
ruby_libvirt_connect_get(s),
|
1691
1573
|
0, domain_snapshot_get(s));
|
1692
1574
|
}
|
1693
|
-
#endif
|
1694
1575
|
|
1695
1576
|
|
1696
|
-
#if HAVE_TYPE_VIRDOMAINJOBINFOPTR
|
1697
1577
|
/*
|
1698
1578
|
* call-seq:
|
1699
1579
|
* dom.job_info -> Libvirt::Domain::JobInfo
|
1700
1580
|
*
|
1701
|
-
* Call virDomainGetJobInfo[
|
1581
|
+
* Call virDomainGetJobInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo]
|
1702
1582
|
* to retrieve the current state of the running domain job.
|
1703
1583
|
*/
|
1704
1584
|
static VALUE libvirt_domain_job_info(VALUE d)
|
@@ -1732,7 +1612,7 @@ static VALUE libvirt_domain_job_info(VALUE d)
|
|
1732
1612
|
* call-seq:
|
1733
1613
|
* dom.abort_job -> nil
|
1734
1614
|
*
|
1735
|
-
* Call virDomainAbortJob[
|
1615
|
+
* Call virDomainAbortJob[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob]
|
1736
1616
|
* to abort the currently running job on this domain.
|
1737
1617
|
*/
|
1738
1618
|
static VALUE libvirt_domain_abort_job(VALUE d)
|
@@ -1742,7 +1622,6 @@ static VALUE libvirt_domain_abort_job(VALUE d)
|
|
1742
1622
|
ruby_libvirt_domain_get(d));
|
1743
1623
|
}
|
1744
1624
|
|
1745
|
-
#endif
|
1746
1625
|
|
1747
1626
|
struct create_sched_type_args {
|
1748
1627
|
char *type;
|
@@ -1767,7 +1646,7 @@ static VALUE create_sched_type_array(VALUE input)
|
|
1767
1646
|
* call-seq:
|
1768
1647
|
* dom.scheduler_type -> [type, #params]
|
1769
1648
|
*
|
1770
|
-
* Call virDomainGetSchedulerType[
|
1649
|
+
* Call virDomainGetSchedulerType[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerType]
|
1771
1650
|
* to retrieve the scheduler type used on this domain.
|
1772
1651
|
*/
|
1773
1652
|
static VALUE libvirt_domain_scheduler_type(VALUE d)
|
@@ -1794,7 +1673,6 @@ static VALUE libvirt_domain_scheduler_type(VALUE d)
|
|
1794
1673
|
return result;
|
1795
1674
|
}
|
1796
1675
|
|
1797
|
-
#if HAVE_VIRDOMAINQEMUMONITORCOMMAND
|
1798
1676
|
/*
|
1799
1677
|
* call-seq:
|
1800
1678
|
* dom.qemu_monitor_command(cmd, flags=0) -> String
|
@@ -1842,14 +1720,12 @@ static VALUE libvirt_domain_qemu_monitor_command(int argc, VALUE *argv, VALUE d)
|
|
1842
1720
|
|
1843
1721
|
return ret;
|
1844
1722
|
}
|
1845
|
-
#endif
|
1846
1723
|
|
1847
|
-
#if HAVE_VIRDOMAINISUPDATED
|
1848
1724
|
/*
|
1849
1725
|
* call-seq:
|
1850
1726
|
* dom.updated? -> [True|False]
|
1851
1727
|
*
|
1852
|
-
* Call virDomainIsUpdated[
|
1728
|
+
* Call virDomainIsUpdated[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsUpdated]
|
1853
1729
|
* to determine whether the definition for this domain has been updated.
|
1854
1730
|
*/
|
1855
1731
|
static VALUE libvirt_domain_is_updated(VALUE d)
|
@@ -1858,7 +1734,6 @@ static VALUE libvirt_domain_is_updated(VALUE d)
|
|
1858
1734
|
ruby_libvirt_connect_get(d),
|
1859
1735
|
ruby_libvirt_domain_get(d));
|
1860
1736
|
}
|
1861
|
-
#endif
|
1862
1737
|
|
1863
1738
|
static const char *scheduler_nparams(VALUE d,
|
1864
1739
|
unsigned int RUBY_LIBVIRT_UNUSED(flags),
|
@@ -1883,21 +1758,17 @@ static const char *scheduler_get(VALUE d, unsigned int flags, void *voidparams,
|
|
1883
1758
|
{
|
1884
1759
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
1885
1760
|
|
1886
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
1887
|
-
if (virDomainGetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1888
|
-
nparams, flags) < 0) {
|
1889
|
-
return "virDomainGetSchedulerParameters";
|
1890
|
-
}
|
1891
|
-
#else
|
1892
1761
|
if (flags != 0) {
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1762
|
+
if (virDomainGetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1763
|
+
nparams, flags) < 0) {
|
1764
|
+
return "virDomainGetSchedulerParameters";
|
1765
|
+
}
|
1766
|
+
} else {
|
1767
|
+
if (virDomainGetSchedulerParameters(ruby_libvirt_domain_get(d),
|
1768
|
+
params, nparams) < 0) {
|
1769
|
+
return "virDomainGetSchedulerParameters";
|
1770
|
+
}
|
1899
1771
|
}
|
1900
|
-
#endif
|
1901
1772
|
|
1902
1773
|
return NULL;
|
1903
1774
|
}
|
@@ -1906,21 +1777,17 @@ static const char *scheduler_set(VALUE d, unsigned int flags,
|
|
1906
1777
|
virTypedParameterPtr params, int nparams,
|
1907
1778
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
1908
1779
|
{
|
1909
|
-
#if HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
1910
|
-
if (virDomainSetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1911
|
-
nparams, flags) < 0) {
|
1912
|
-
return "virDomainSetSchedulerParameters";
|
1913
|
-
}
|
1914
|
-
#else
|
1915
1780
|
if (flags != 0) {
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1781
|
+
if (virDomainSetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1782
|
+
nparams, flags) < 0) {
|
1783
|
+
return "virDomainSetSchedulerParameters";
|
1784
|
+
}
|
1785
|
+
} else {
|
1786
|
+
if (virDomainSetSchedulerParameters(ruby_libvirt_domain_get(d),
|
1787
|
+
params, nparams) < 0) {
|
1788
|
+
return "virDomainSetSchedulerParameters";
|
1789
|
+
}
|
1922
1790
|
}
|
1923
|
-
#endif
|
1924
1791
|
|
1925
1792
|
return NULL;
|
1926
1793
|
}
|
@@ -1929,7 +1796,7 @@ static const char *scheduler_set(VALUE d, unsigned int flags,
|
|
1929
1796
|
* call-seq:
|
1930
1797
|
* dom.scheduler_parameters(flags=0) -> Hash
|
1931
1798
|
*
|
1932
|
-
* Call virDomainGetSchedulerParameters[
|
1799
|
+
* Call virDomainGetSchedulerParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParameters]
|
1933
1800
|
* to retrieve all of the scheduler parameters for this domain. The keys and
|
1934
1801
|
* values in the hash that is returned are hypervisor specific.
|
1935
1802
|
*/
|
@@ -1962,7 +1829,7 @@ static struct ruby_libvirt_typed_param domain_scheduler_allowed[] = {
|
|
1962
1829
|
* call-seq:
|
1963
1830
|
* dom.scheduler_parameters = Hash
|
1964
1831
|
*
|
1965
|
-
* Call virDomainSetSchedulerParameters[
|
1832
|
+
* Call virDomainSetSchedulerParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters]
|
1966
1833
|
* to set the scheduler parameters for this domain. The keys and values in
|
1967
1834
|
* the input hash are hypervisor specific. If an empty hash is given, no
|
1968
1835
|
* changes are made (and no error is raised).
|
@@ -1979,7 +1846,6 @@ static VALUE libvirt_domain_scheduler_parameters_equal(VALUE d, VALUE input)
|
|
1979
1846
|
scheduler_set);
|
1980
1847
|
}
|
1981
1848
|
|
1982
|
-
#if HAVE_VIRDOMAINSETMEMORYPARAMETERS
|
1983
1849
|
static const char *memory_nparams(VALUE d, unsigned int flags,
|
1984
1850
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
1985
1851
|
int *nparams)
|
@@ -1997,14 +1863,8 @@ static const char *memory_get(VALUE d, unsigned int flags, void *voidparams,
|
|
1997
1863
|
{
|
1998
1864
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
1999
1865
|
|
2000
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2001
1866
|
if (virDomainGetMemoryParameters(ruby_libvirt_domain_get(d), params,
|
2002
1867
|
nparams, flags) < 0) {
|
2003
|
-
#else
|
2004
|
-
if (virDomainGetMemoryParameters(ruby_libvirt_domain_get(d),
|
2005
|
-
(virMemoryParameterPtr)params, nparams,
|
2006
|
-
flags) < 0) {
|
2007
|
-
#endif
|
2008
1868
|
return "virDomainGetMemoryParameters";
|
2009
1869
|
}
|
2010
1870
|
|
@@ -2015,14 +1875,8 @@ static const char *memory_set(VALUE d, unsigned int flags,
|
|
2015
1875
|
virTypedParameterPtr params, int nparams,
|
2016
1876
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
2017
1877
|
{
|
2018
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2019
1878
|
if (virDomainSetMemoryParameters(ruby_libvirt_domain_get(d), params,
|
2020
1879
|
nparams, flags) < 0) {
|
2021
|
-
#else
|
2022
|
-
if (virDomainSetMemoryParameters(ruby_libvirt_domain_get(d),
|
2023
|
-
(virMemoryParameterPtr)params, nparams,
|
2024
|
-
flags) < 0) {
|
2025
|
-
#endif
|
2026
1880
|
return "virDomainSetMemoryParameters";
|
2027
1881
|
}
|
2028
1882
|
|
@@ -2033,7 +1887,7 @@ static const char *memory_set(VALUE d, unsigned int flags,
|
|
2033
1887
|
* call-seq:
|
2034
1888
|
* dom.memory_parameters(flags=0) -> Hash
|
2035
1889
|
*
|
2036
|
-
* Call virDomainGetMemoryParameters[
|
1890
|
+
* Call virDomainGetMemoryParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMemoryParameters]
|
2037
1891
|
* to retrieve all of the memory parameters for this domain. The keys and
|
2038
1892
|
* values in the hash that is returned are hypervisor specific.
|
2039
1893
|
*/
|
@@ -2059,7 +1913,7 @@ static struct ruby_libvirt_typed_param domain_memory_allowed[] = {
|
|
2059
1913
|
* call-seq:
|
2060
1914
|
* dom.memory_parameters = Hash,flags=0
|
2061
1915
|
*
|
2062
|
-
* Call virDomainSetMemoryParameters[
|
1916
|
+
* Call virDomainSetMemoryParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryParameters]
|
2063
1917
|
* to set the memory parameters for this domain. The keys and values in
|
2064
1918
|
* the input hash are hypervisor specific.
|
2065
1919
|
*/
|
@@ -2074,9 +1928,7 @@ static VALUE libvirt_domain_memory_parameters_equal(VALUE d, VALUE in)
|
|
2074
1928
|
ARRAY_SIZE(domain_memory_allowed),
|
2075
1929
|
memory_set);
|
2076
1930
|
}
|
2077
|
-
#endif
|
2078
1931
|
|
2079
|
-
#if HAVE_VIRDOMAINSETBLKIOPARAMETERS
|
2080
1932
|
static const char *blkio_nparams(VALUE d, unsigned int flags,
|
2081
1933
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
2082
1934
|
int *nparams)
|
@@ -2094,14 +1946,8 @@ static const char *blkio_get(VALUE d, unsigned int flags, void *voidparams,
|
|
2094
1946
|
{
|
2095
1947
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
2096
1948
|
|
2097
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2098
1949
|
if (virDomainGetBlkioParameters(ruby_libvirt_domain_get(d), params, nparams,
|
2099
1950
|
flags) < 0) {
|
2100
|
-
#else
|
2101
|
-
if (virDomainGetBlkioParameters(ruby_libvirt_domain_get(d),
|
2102
|
-
(virBlkioParameterPtr)params, nparams,
|
2103
|
-
flags) < 0) {
|
2104
|
-
#endif
|
2105
1951
|
return "virDomainGetBlkioParameters";
|
2106
1952
|
}
|
2107
1953
|
|
@@ -2112,14 +1958,8 @@ static const char *blkio_set(VALUE d, unsigned int flags,
|
|
2112
1958
|
virTypedParameterPtr params, int nparams,
|
2113
1959
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
2114
1960
|
{
|
2115
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2116
1961
|
if (virDomainSetBlkioParameters(ruby_libvirt_domain_get(d), params, nparams,
|
2117
1962
|
flags) < 0) {
|
2118
|
-
#else
|
2119
|
-
if (virDomainSetBlkioParameters(ruby_libvirt_domain_get(d),
|
2120
|
-
(virBlkioParameterPtr)params, nparams,
|
2121
|
-
flags) < 0) {
|
2122
|
-
#endif
|
2123
1963
|
return "virDomainSetBlkioParameters";
|
2124
1964
|
}
|
2125
1965
|
|
@@ -2130,7 +1970,7 @@ static const char *blkio_set(VALUE d, unsigned int flags,
|
|
2130
1970
|
* call-seq:
|
2131
1971
|
* dom.blkio_parameters(flags=0) -> Hash
|
2132
1972
|
*
|
2133
|
-
* Call virDomainGetBlkioParameters[
|
1973
|
+
* Call virDomainGetBlkioParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters]
|
2134
1974
|
* to retrieve all of the blkio parameters for this domain. The keys and
|
2135
1975
|
* values in the hash that is returned are hypervisor specific.
|
2136
1976
|
*/
|
@@ -2154,7 +1994,7 @@ static struct ruby_libvirt_typed_param blkio_allowed[] = {
|
|
2154
1994
|
* call-seq:
|
2155
1995
|
* dom.blkio_parameters = Hash,flags=0
|
2156
1996
|
*
|
2157
|
-
* Call virDomainSetBlkioParameters[
|
1997
|
+
* Call virDomainSetBlkioParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters]
|
2158
1998
|
* to set the blkio parameters for this domain. The keys and values in
|
2159
1999
|
* the input hash are hypervisor specific.
|
2160
2000
|
*/
|
@@ -2169,14 +2009,12 @@ static VALUE libvirt_domain_blkio_parameters_equal(VALUE d, VALUE in)
|
|
2169
2009
|
ARRAY_SIZE(blkio_allowed),
|
2170
2010
|
blkio_set);
|
2171
2011
|
}
|
2172
|
-
#endif
|
2173
2012
|
|
2174
|
-
#if HAVE_VIRDOMAINGETSTATE
|
2175
2013
|
/*
|
2176
2014
|
* call-seq:
|
2177
2015
|
* dom.state(flags=0) -> state, reason
|
2178
2016
|
*
|
2179
|
-
* Call virDomainGetState[
|
2017
|
+
* Call virDomainGetState[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState]
|
2180
2018
|
* to get the current state of the domain.
|
2181
2019
|
*/
|
2182
2020
|
static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
|
@@ -2198,14 +2036,12 @@ static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
|
|
2198
2036
|
|
2199
2037
|
return result;
|
2200
2038
|
}
|
2201
|
-
#endif
|
2202
2039
|
|
2203
|
-
#if HAVE_VIRDOMAINOPENCONSOLE
|
2204
2040
|
/*
|
2205
2041
|
* call-seq:
|
2206
2042
|
* dom.open_console(device, stream, flags=0) -> nil
|
2207
2043
|
*
|
2208
|
-
* Call virDomainOpenConsole[
|
2044
|
+
* Call virDomainOpenConsole[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenConsole]
|
2209
2045
|
* to open up a console to device over stream.
|
2210
2046
|
*/
|
2211
2047
|
static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
|
@@ -2221,14 +2057,12 @@ static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
|
|
2221
2057
|
StringValueCStr(dev),
|
2222
2058
|
ruby_libvirt_stream_get(st), NUM2INT(flags));
|
2223
2059
|
}
|
2224
|
-
#endif
|
2225
2060
|
|
2226
|
-
#if HAVE_VIRDOMAINSCREENSHOT
|
2227
2061
|
/*
|
2228
2062
|
* call-seq:
|
2229
2063
|
* dom.screenshot(stream, screen, flags=0) -> nil
|
2230
2064
|
*
|
2231
|
-
* Call virDomainScreenshot[
|
2065
|
+
* Call virDomainScreenshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainScreenshot]
|
2232
2066
|
* to take a screenshot of the domain console as a stream.
|
2233
2067
|
*/
|
2234
2068
|
static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
|
@@ -2244,14 +2078,12 @@ static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
|
|
2244
2078
|
NUM2UINT(screen),
|
2245
2079
|
ruby_libvirt_value_to_uint(flags));
|
2246
2080
|
}
|
2247
|
-
#endif
|
2248
2081
|
|
2249
|
-
#if HAVE_VIRDOMAININJECTNMI
|
2250
2082
|
/*
|
2251
2083
|
* call-seq:
|
2252
2084
|
* dom.inject_nmi(flags=0) -> nil
|
2253
2085
|
*
|
2254
|
-
* Call virDomainInjectNMI[
|
2086
|
+
* Call virDomainInjectNMI[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI]
|
2255
2087
|
* to send an NMI to the guest.
|
2256
2088
|
*/
|
2257
2089
|
static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
|
@@ -2265,14 +2097,12 @@ static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
|
|
2265
2097
|
ruby_libvirt_domain_get(d),
|
2266
2098
|
ruby_libvirt_value_to_uint(flags));
|
2267
2099
|
}
|
2268
|
-
#endif
|
2269
2100
|
|
2270
|
-
#if HAVE_VIRDOMAINGETCONTROLINFO
|
2271
2101
|
/*
|
2272
2102
|
* call-seq:
|
2273
2103
|
* dom.control_info(flags=0) -> Libvirt::Domain::ControlInfo
|
2274
2104
|
*
|
2275
|
-
* Call virDomainGetControlInfo[
|
2105
|
+
* Call virDomainGetControlInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetControlInfo]
|
2276
2106
|
* to retrieve domain control interface information.
|
2277
2107
|
*/
|
2278
2108
|
static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
|
@@ -2296,14 +2126,12 @@ static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
|
|
2296
2126
|
|
2297
2127
|
return result;
|
2298
2128
|
}
|
2299
|
-
#endif
|
2300
2129
|
|
2301
|
-
#if HAVE_VIRDOMAINSENDKEY
|
2302
2130
|
/*
|
2303
2131
|
* call-seq:
|
2304
2132
|
* dom.send_key(codeset, holdtime, keycodes)
|
2305
2133
|
*
|
2306
|
-
* Call virDomainSendKey[
|
2134
|
+
* Call virDomainSendKey[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey]
|
2307
2135
|
* to send key(s) to the domain. Keycodes has to be an array of keys to send.
|
2308
2136
|
*/
|
2309
2137
|
VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
|
@@ -2326,14 +2154,12 @@ VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
|
|
2326
2154
|
NUM2UINT(codeset), NUM2UINT(holdtime), codes,
|
2327
2155
|
RARRAY_LEN(keycodes), 0);
|
2328
2156
|
}
|
2329
|
-
#endif
|
2330
2157
|
|
2331
|
-
#if HAVE_VIRDOMAINMIGRATEGETMAXSPEED
|
2332
2158
|
/*
|
2333
2159
|
* call-seq:
|
2334
2160
|
* dom.migrate_max_speed(flags=0) -> Fixnum
|
2335
2161
|
*
|
2336
|
-
* Call virDomainMigrateGetMaxSpeed[
|
2162
|
+
* Call virDomainMigrateGetMaxSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxSpeed]
|
2337
2163
|
* to retrieve the maximum speed a migration can use.
|
2338
2164
|
*/
|
2339
2165
|
static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
|
@@ -2352,14 +2178,12 @@ static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
|
|
2352
2178
|
|
2353
2179
|
return ULONG2NUM(bandwidth);
|
2354
2180
|
}
|
2355
|
-
#endif
|
2356
2181
|
|
2357
|
-
#if HAVE_VIRDOMAINRESET
|
2358
2182
|
/*
|
2359
2183
|
* call-seq:
|
2360
2184
|
* dom.reset(flags=0) -> nil
|
2361
2185
|
*
|
2362
|
-
* Call virDomainReset[
|
2186
|
+
* Call virDomainReset[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset]
|
2363
2187
|
* to reset a domain immediately.
|
2364
2188
|
*/
|
2365
2189
|
static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
|
@@ -2372,14 +2196,12 @@ static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
|
|
2372
2196
|
ruby_libvirt_domain_get(d),
|
2373
2197
|
ruby_libvirt_value_to_uint(flags));
|
2374
2198
|
}
|
2375
|
-
#endif
|
2376
2199
|
|
2377
|
-
#if HAVE_VIRDOMAINGETHOSTNAME
|
2378
2200
|
/*
|
2379
2201
|
* call-seq:
|
2380
2202
|
* dom.hostname(flags=0) -> nil
|
2381
2203
|
*
|
2382
|
-
* Call virDomainGetHostname[
|
2204
|
+
* Call virDomainGetHostname[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname]
|
2383
2205
|
* to get the hostname from a domain.
|
2384
2206
|
*/
|
2385
2207
|
static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
|
@@ -2393,14 +2215,12 @@ static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
|
|
2393
2215
|
ruby_libvirt_domain_get(d),
|
2394
2216
|
ruby_libvirt_value_to_uint(flags));
|
2395
2217
|
}
|
2396
|
-
#endif
|
2397
2218
|
|
2398
|
-
#if HAVE_VIRDOMAINGETMETADATA
|
2399
2219
|
/*
|
2400
2220
|
* call-seq:
|
2401
2221
|
* dom.metadata(type, uri=nil, flags=0) -> String
|
2402
2222
|
*
|
2403
|
-
* Call virDomainGetMetadata[
|
2223
|
+
* Call virDomainGetMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata]
|
2404
2224
|
* to get the metadata from a domain.
|
2405
2225
|
*/
|
2406
2226
|
static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
|
@@ -2415,14 +2235,12 @@ static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
|
|
2415
2235
|
ruby_libvirt_get_cstring_or_null(uri),
|
2416
2236
|
ruby_libvirt_value_to_uint(flags));
|
2417
2237
|
}
|
2418
|
-
#endif
|
2419
2238
|
|
2420
|
-
#if HAVE_VIRDOMAINSETMETADATA
|
2421
2239
|
/*
|
2422
2240
|
* call-seq:
|
2423
2241
|
* dom.metadata = Fixnum,string/nil,key=nil,uri=nil,flags=0 -> nil
|
2424
2242
|
*
|
2425
|
-
* Call virDomainSetMetadata[
|
2243
|
+
* Call virDomainSetMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata]
|
2426
2244
|
* to set the metadata for a domain.
|
2427
2245
|
*/
|
2428
2246
|
static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
|
@@ -2461,14 +2279,12 @@ static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
|
|
2461
2279
|
ruby_libvirt_get_cstring_or_null(uri),
|
2462
2280
|
ruby_libvirt_value_to_uint(flags));
|
2463
2281
|
}
|
2464
|
-
#endif
|
2465
2282
|
|
2466
|
-
#if HAVE_VIRDOMAINSENDPROCESSSIGNAL
|
2467
2283
|
/*
|
2468
2284
|
* call-seq:
|
2469
2285
|
* dom.send_process_signal(pid, signum, flags=0) -> nil
|
2470
2286
|
*
|
2471
|
-
* Call virDomainSendProcessSignal[
|
2287
|
+
* Call virDomainSendProcessSignal[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal]
|
2472
2288
|
* to send a signal to a process inside the domain.
|
2473
2289
|
*/
|
2474
2290
|
static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
|
@@ -2483,14 +2299,12 @@ static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
|
|
2483
2299
|
NUM2UINT(signum),
|
2484
2300
|
ruby_libvirt_value_to_uint(flags));
|
2485
2301
|
}
|
2486
|
-
#endif
|
2487
2302
|
|
2488
|
-
#if HAVE_VIRDOMAINLISTALLSNAPSHOTS
|
2489
2303
|
/*
|
2490
2304
|
* call-seq:
|
2491
2305
|
* dom.list_all_snapshots(flags=0) -> Array
|
2492
2306
|
*
|
2493
|
-
* Call virDomainListAllSnapshots[
|
2307
|
+
* Call virDomainListAllSnapshots[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainListAllSnapshots]
|
2494
2308
|
* to get an array of snapshot objects for all snapshots.
|
2495
2309
|
*/
|
2496
2310
|
static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -2501,14 +2315,12 @@ static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
|
|
2501
2315
|
domain_snapshot_new,
|
2502
2316
|
virDomainSnapshotFree);
|
2503
2317
|
}
|
2504
|
-
#endif
|
2505
2318
|
|
2506
|
-
#if HAVE_VIRDOMAINSNAPSHOTNUMCHILDREN
|
2507
2319
|
/*
|
2508
2320
|
* call-seq:
|
2509
2321
|
* snapshot.num_children(flags=0) -> Fixnum
|
2510
2322
|
*
|
2511
|
-
* Call virDomainSnapshotNumChildren[
|
2323
|
+
* Call virDomainSnapshotNumChildren[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNumChildren]
|
2512
2324
|
* to get the number of children snapshots of this snapshot.
|
2513
2325
|
*/
|
2514
2326
|
static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
|
@@ -2523,14 +2335,12 @@ static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
|
|
2523
2335
|
domain_snapshot_get(s),
|
2524
2336
|
ruby_libvirt_value_to_uint(flags));
|
2525
2337
|
}
|
2526
|
-
#endif
|
2527
2338
|
|
2528
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTCHILDRENNAMES
|
2529
2339
|
/*
|
2530
2340
|
* call-seq:
|
2531
2341
|
* snapshot.list_children_names(flags=0) -> Array
|
2532
2342
|
*
|
2533
|
-
* Call virDomainSnapshotListChildrenNames[
|
2343
|
+
* Call virDomainSnapshotListChildrenNames[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListChildrenNames]
|
2534
2344
|
* to get an array of strings representing the children of this snapshot.
|
2535
2345
|
*/
|
2536
2346
|
static VALUE libvirt_domain_snapshot_list_children_names(int argc, VALUE *argv,
|
@@ -2587,14 +2397,12 @@ error:
|
|
2587
2397
|
/* not necessary, just to shut the compiler up */
|
2588
2398
|
return Qnil;
|
2589
2399
|
}
|
2590
|
-
#endif
|
2591
2400
|
|
2592
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTALLCHILDREN
|
2593
2401
|
/*
|
2594
2402
|
* call-seq:
|
2595
2403
|
* snapshot.list_all_children(flags=0) -> Array
|
2596
2404
|
*
|
2597
|
-
* Call virDomainSnapshotListAllChildren[
|
2405
|
+
* Call virDomainSnapshotListAllChildren[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListAllChildren]
|
2598
2406
|
* to get an array of snapshot objects that are children of this snapshot.
|
2599
2407
|
*/
|
2600
2408
|
static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
|
@@ -2606,14 +2414,12 @@ static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
|
|
2606
2414
|
domain_snapshot_new,
|
2607
2415
|
virDomainSnapshotFree);
|
2608
2416
|
}
|
2609
|
-
#endif
|
2610
2417
|
|
2611
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETPARENT
|
2612
2418
|
/*
|
2613
2419
|
* call-seq:
|
2614
2420
|
* snapshot.parent(flags=0) -> [Libvirt::Domain::Snapshot|nil]
|
2615
2421
|
*
|
2616
|
-
* Call virDomainSnapshotGetParent[
|
2422
|
+
* Call virDomainSnapshotGetParent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetParent]
|
2617
2423
|
* to get the parent of this snapshot (nil will be returned if this is a root
|
2618
2424
|
* snapshot).
|
2619
2425
|
*/
|
@@ -2643,14 +2449,12 @@ static VALUE libvirt_domain_snapshot_parent(int argc, VALUE *argv, VALUE s)
|
|
2643
2449
|
|
2644
2450
|
return domain_snapshot_new(snap, s);
|
2645
2451
|
}
|
2646
|
-
#endif
|
2647
2452
|
|
2648
|
-
#if HAVE_VIRDOMAINSNAPSHOTISCURRENT
|
2649
2453
|
/*
|
2650
2454
|
* call-seq:
|
2651
2455
|
* snapshot.current?(flags=0) -> [true|false]
|
2652
2456
|
*
|
2653
|
-
* Call virDomainSnapshotIsCurrent[
|
2457
|
+
* Call virDomainSnapshotIsCurrent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotIsCurrent]
|
2654
2458
|
* to determine if the snapshot is the domain's current snapshot.
|
2655
2459
|
*/
|
2656
2460
|
static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
|
@@ -2664,14 +2468,12 @@ static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
|
|
2664
2468
|
domain_snapshot_get(s),
|
2665
2469
|
ruby_libvirt_value_to_uint(flags));
|
2666
2470
|
}
|
2667
|
-
#endif
|
2668
2471
|
|
2669
|
-
#if HAVE_VIRDOMAINSNAPSHOTHASMETADATA
|
2670
2472
|
/*
|
2671
2473
|
* call-seq:
|
2672
2474
|
* snapshot.has_metadata?(flags=0) -> [true|false]
|
2673
2475
|
*
|
2674
|
-
* Call virDomainSnapshotHasMetadata[
|
2476
|
+
* Call virDomainSnapshotHasMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotHasMetadata]
|
2675
2477
|
* to determine if the snapshot is associated with libvirt metadata.
|
2676
2478
|
*/
|
2677
2479
|
static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
|
@@ -2686,14 +2488,12 @@ static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
|
|
2686
2488
|
domain_snapshot_get(s),
|
2687
2489
|
ruby_libvirt_value_to_uint(flags));
|
2688
2490
|
}
|
2689
|
-
#endif
|
2690
2491
|
|
2691
|
-
#if HAVE_VIRDOMAINSETMEMORYSTATSPERIOD
|
2692
2492
|
/*
|
2693
2493
|
* call-seq:
|
2694
2494
|
* dom.memory_stats_period = Fixnum,flags=0
|
2695
2495
|
*
|
2696
|
-
* Call virDomainSetMemoryStatsPeriod[
|
2496
|
+
* Call virDomainSetMemoryStatsPeriod[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod]
|
2697
2497
|
* to set the memory statistics collection period.
|
2698
2498
|
*/
|
2699
2499
|
static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
|
@@ -2708,14 +2508,12 @@ static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
|
|
2708
2508
|
NUM2INT(period),
|
2709
2509
|
ruby_libvirt_value_to_uint(flags));
|
2710
2510
|
}
|
2711
|
-
#endif
|
2712
2511
|
|
2713
|
-
#if HAVE_VIRDOMAINFSTRIM
|
2714
2512
|
/*
|
2715
2513
|
* call-seq:
|
2716
2514
|
* dom.fstrim(mountpoint=nil, minimum=0, flags=0) -> nil
|
2717
2515
|
*
|
2718
|
-
* Call virDomainFSTrim[
|
2516
|
+
* Call virDomainFSTrim[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim]
|
2719
2517
|
* to call FITRIM within the guest.
|
2720
2518
|
*/
|
2721
2519
|
static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
|
@@ -2730,14 +2528,12 @@ static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
|
|
2730
2528
|
ruby_libvirt_value_to_ulonglong(minimum),
|
2731
2529
|
ruby_libvirt_value_to_uint(flags));
|
2732
2530
|
}
|
2733
|
-
#endif
|
2734
2531
|
|
2735
|
-
#if HAVE_VIRDOMAINBLOCKREBASE
|
2736
2532
|
/*
|
2737
2533
|
* call-seq:
|
2738
2534
|
* dom.block_rebase(disk, base=nil, bandwidth=0, flags=0) -> nil
|
2739
2535
|
*
|
2740
|
-
* Call virDomainBlockRebase[
|
2536
|
+
* Call virDomainBlockRebase[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase]
|
2741
2537
|
* to populate a disk image with data from its backing image chain.
|
2742
2538
|
*/
|
2743
2539
|
static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
|
@@ -2754,14 +2550,12 @@ static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
|
|
2754
2550
|
ruby_libvirt_value_to_ulong(bandwidth),
|
2755
2551
|
ruby_libvirt_value_to_uint(flags));
|
2756
2552
|
}
|
2757
|
-
#endif
|
2758
2553
|
|
2759
|
-
#if HAVE_VIRDOMAINOPENCHANNEL
|
2760
2554
|
/*
|
2761
2555
|
* call-seq:
|
2762
2556
|
* dom.open_channel(name, stream, flags=0) -> nil
|
2763
2557
|
*
|
2764
|
-
* Call virDomainOpenChannel[
|
2558
|
+
* Call virDomainOpenChannel[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenChannel]
|
2765
2559
|
* to open a channel on a guest. Note that name may be nil, in which case the
|
2766
2560
|
* first channel on the guest is opened.
|
2767
2561
|
*/
|
@@ -2778,14 +2572,12 @@ static VALUE libvirt_domain_open_channel(int argc, VALUE *argv, VALUE d)
|
|
2778
2572
|
ruby_libvirt_stream_get(st),
|
2779
2573
|
ruby_libvirt_value_to_uint(flags));
|
2780
2574
|
}
|
2781
|
-
#endif
|
2782
2575
|
|
2783
|
-
#if HAVE_VIRDOMAINCREATEWITHFILES
|
2784
2576
|
/*
|
2785
2577
|
* call-seq:
|
2786
2578
|
* dom.create_with_files(fds=nil, flags=0) -> nil
|
2787
2579
|
*
|
2788
|
-
* Call virDomainCreateWithFiles[
|
2580
|
+
* Call virDomainCreateWithFiles[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFiles]
|
2789
2581
|
* to launch a defined domain with a set of open file descriptors.
|
2790
2582
|
*/
|
2791
2583
|
static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
|
@@ -2817,14 +2609,12 @@ static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
|
|
2817
2609
|
numfiles, files,
|
2818
2610
|
ruby_libvirt_value_to_uint(flags));
|
2819
2611
|
}
|
2820
|
-
#endif
|
2821
2612
|
|
2822
|
-
#if HAVE_VIRDOMAINOPENGRAPHICS
|
2823
2613
|
/*
|
2824
2614
|
* call-seq:
|
2825
2615
|
* dom.open_graphics(fd, idx=0, flags=0) -> nil
|
2826
2616
|
*
|
2827
|
-
* Call virDomainOpenGraphics[
|
2617
|
+
* Call virDomainOpenGraphics[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphics]
|
2828
2618
|
* to connect a file descriptor to the graphics backend of the domain.
|
2829
2619
|
*/
|
2830
2620
|
static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
|
@@ -2839,14 +2629,12 @@ static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
|
|
2839
2629
|
ruby_libvirt_value_to_uint(idx), NUM2INT(fd),
|
2840
2630
|
ruby_libvirt_value_to_uint(flags));
|
2841
2631
|
}
|
2842
|
-
#endif
|
2843
2632
|
|
2844
|
-
#if HAVE_VIRDOMAINPMWAKEUP
|
2845
2633
|
/*
|
2846
2634
|
* call-seq:
|
2847
2635
|
* dom.pmwakeup(flags=0) -> nil
|
2848
2636
|
*
|
2849
|
-
* Call virDomainPMWakeup[
|
2637
|
+
* Call virDomainPMWakeup[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup]
|
2850
2638
|
* to inject a wakeup into the guest.
|
2851
2639
|
*/
|
2852
2640
|
static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
|
@@ -2860,14 +2648,12 @@ static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
|
|
2860
2648
|
ruby_libvirt_domain_get(d),
|
2861
2649
|
ruby_libvirt_value_to_uint(flags));
|
2862
2650
|
}
|
2863
|
-
#endif
|
2864
2651
|
|
2865
|
-
#if HAVE_VIRDOMAINBLOCKRESIZE
|
2866
2652
|
/*
|
2867
2653
|
* call-seq:
|
2868
2654
|
* dom.block_resize(disk, size, flags=0) -> nil
|
2869
2655
|
*
|
2870
|
-
* Call virDomainBlockResize[
|
2656
|
+
* Call virDomainBlockResize[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize]
|
2871
2657
|
* to resize a block device of domain.
|
2872
2658
|
*/
|
2873
2659
|
static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
|
@@ -2882,14 +2668,12 @@ static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
|
|
2882
2668
|
StringValueCStr(disk), NUM2ULL(size),
|
2883
2669
|
ruby_libvirt_value_to_uint(flags));
|
2884
2670
|
}
|
2885
|
-
#endif
|
2886
2671
|
|
2887
|
-
#if HAVE_VIRDOMAINPMSUSPENDFORDURATION
|
2888
2672
|
/*
|
2889
2673
|
* call-seq:
|
2890
2674
|
* dom.pmsuspend_for_duration(target, duration, flags=0) -> nil
|
2891
2675
|
*
|
2892
|
-
* Call virDomainPMSuspendForDuration[
|
2676
|
+
* Call virDomainPMSuspendForDuration[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMSuspendForDuration]
|
2893
2677
|
* to have the domain enter the target power management suspend level.
|
2894
2678
|
*/
|
2895
2679
|
static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
|
@@ -2905,14 +2689,12 @@ static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
|
|
2905
2689
|
NUM2UINT(target), NUM2ULL(duration),
|
2906
2690
|
ruby_libvirt_value_to_uint(flags));
|
2907
2691
|
}
|
2908
|
-
#endif
|
2909
2692
|
|
2910
|
-
#if HAVE_VIRDOMAINMIGRATEGETCOMPRESSIONCACHE
|
2911
2693
|
/*
|
2912
2694
|
* call-seq:
|
2913
2695
|
* dom.migrate_compression_cache(flags=0) -> Fixnum
|
2914
2696
|
*
|
2915
|
-
* Call virDomainMigrateGetCompressionCache[
|
2697
|
+
* Call virDomainMigrateGetCompressionCache[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache]
|
2916
2698
|
* to get the current size of the migration cache.
|
2917
2699
|
*/
|
2918
2700
|
static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
|
@@ -2933,14 +2715,12 @@ static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
|
|
2933
2715
|
|
2934
2716
|
return ULL2NUM(cachesize);
|
2935
2717
|
}
|
2936
|
-
#endif
|
2937
2718
|
|
2938
|
-
#if HAVE_VIRDOMAINMIGRATESETCOMPRESSIONCACHE
|
2939
2719
|
/*
|
2940
2720
|
* call-seq:
|
2941
2721
|
* dom.migrate_compression_cache = Fixnum,flags=0
|
2942
2722
|
*
|
2943
|
-
* Call virDomainMigrateSetCompressionCache[
|
2723
|
+
* Call virDomainMigrateSetCompressionCache[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache]
|
2944
2724
|
* to set the current size of the migration cache.
|
2945
2725
|
*/
|
2946
2726
|
static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
|
@@ -2955,14 +2735,12 @@ static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
|
|
2955
2735
|
NUM2ULL(cachesize),
|
2956
2736
|
ruby_libvirt_value_to_uint(flags));
|
2957
2737
|
}
|
2958
|
-
#endif
|
2959
2738
|
|
2960
|
-
#if HAVE_VIRDOMAINGETDISKERRORS
|
2961
2739
|
/*
|
2962
2740
|
* call-seq:
|
2963
2741
|
* dom.disk_errors(flags=0) -> Hash
|
2964
2742
|
*
|
2965
|
-
* Call virDomainGetDiskErrors[
|
2743
|
+
* Call virDomainGetDiskErrors[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors]
|
2966
2744
|
* to get errors on disks in the domain.
|
2967
2745
|
*/
|
2968
2746
|
static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
|
@@ -2996,14 +2774,12 @@ static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
|
|
2996
2774
|
|
2997
2775
|
return hash;
|
2998
2776
|
}
|
2999
|
-
#endif
|
3000
2777
|
|
3001
|
-
#if HAVE_VIRDOMAINGETEMULATORPININFO
|
3002
2778
|
/*
|
3003
2779
|
* call-seq:
|
3004
2780
|
* dom.emulator_pin_info(flags=0) -> Array
|
3005
2781
|
*
|
3006
|
-
* Call virDomainGetEmulatorPinInfo[
|
2782
|
+
* Call virDomainGetEmulatorPinInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo]
|
3007
2783
|
* to an array representing the mapping of emulator threads to physical CPUs.
|
3008
2784
|
* For each physical CPU in the machine, the array offset corresponding to that
|
3009
2785
|
* CPU is 'true' if an emulator thread is running on that CPU, and 'false'
|
@@ -3040,14 +2816,12 @@ static VALUE libvirt_domain_emulator_pin_info(int argc, VALUE *argv, VALUE d)
|
|
3040
2816
|
|
3041
2817
|
return emulator2cpumap;
|
3042
2818
|
}
|
3043
|
-
#endif
|
3044
2819
|
|
3045
|
-
#if HAVE_VIRDOMAINPINEMULATOR
|
3046
2820
|
/*
|
3047
2821
|
* call-seq:
|
3048
2822
|
* dom.pin_emulator(cpulist, flags=0) -> nil
|
3049
2823
|
*
|
3050
|
-
* Call virDomainPinVcpu[
|
2824
|
+
* Call virDomainPinVcpu[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
|
3051
2825
|
* to pin the emulator to a range of physical processors. The cpulist should
|
3052
2826
|
* be an array of Fixnums representing the physical processors this domain's
|
3053
2827
|
* emulator should be allowed to be scheduled on.
|
@@ -3080,14 +2854,12 @@ static VALUE libvirt_domain_pin_emulator(int argc, VALUE *argv, VALUE d)
|
|
3080
2854
|
cpumaplen,
|
3081
2855
|
ruby_libvirt_value_to_uint(flags));
|
3082
2856
|
}
|
3083
|
-
#endif
|
3084
2857
|
|
3085
|
-
#if HAVE_VIRDOMAINGETSECURITYLABELLIST
|
3086
2858
|
/*
|
3087
2859
|
* call-seq:
|
3088
2860
|
* dom.security_label_list -> [ Libvirt::Domain::SecurityLabel ]
|
3089
2861
|
*
|
3090
|
-
* Call virDomainGetSecurityLabelList[
|
2862
|
+
* Call virDomainGetSecurityLabelList[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabelList]
|
3091
2863
|
* to retrieve the security labels applied to this domain.
|
3092
2864
|
*/
|
3093
2865
|
static VALUE libvirt_domain_security_label_list(VALUE d)
|
@@ -3113,9 +2885,7 @@ static VALUE libvirt_domain_security_label_list(VALUE d)
|
|
3113
2885
|
|
3114
2886
|
return result;
|
3115
2887
|
}
|
3116
|
-
#endif
|
3117
2888
|
|
3118
|
-
#if HAVE_VIRDOMAINGETJOBSTATS
|
3119
2889
|
struct params_to_hash_arg {
|
3120
2890
|
virTypedParameterPtr params;
|
3121
2891
|
int nparams;
|
@@ -3138,7 +2908,7 @@ static VALUE params_to_hash(VALUE in)
|
|
3138
2908
|
* call-seq:
|
3139
2909
|
* dom.job_stats -> Hash
|
3140
2910
|
*
|
3141
|
-
* Call virDomainGetJobStats[
|
2911
|
+
* Call virDomainGetJobStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats]
|
3142
2912
|
* to retrieve information about progress of a background job on a domain.
|
3143
2913
|
*/
|
3144
2914
|
static VALUE libvirt_domain_job_stats(int argc, VALUE *argv, VALUE d)
|
@@ -3184,9 +2954,7 @@ static VALUE libvirt_domain_job_stats(int argc, VALUE *argv, VALUE d)
|
|
3184
2954
|
|
3185
2955
|
return result;
|
3186
2956
|
}
|
3187
|
-
#endif
|
3188
2957
|
|
3189
|
-
#if HAVE_VIRDOMAINGETBLOCKIOTUNE
|
3190
2958
|
static const char *iotune_nparams(VALUE d, unsigned int flags, void *opaque,
|
3191
2959
|
int *nparams)
|
3192
2960
|
{
|
@@ -3234,7 +3002,7 @@ static const char *iotune_set(VALUE d, unsigned int flags,
|
|
3234
3002
|
* call-seq:
|
3235
3003
|
* dom.block_iotune(disk=nil, flags=0) -> Hash
|
3236
3004
|
*
|
3237
|
-
* Call virDomainGetBlockIoTune[
|
3005
|
+
* Call virDomainGetBlockIoTune[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockIoTune]
|
3238
3006
|
* to retrieve all of the block IO tune parameters for this domain. The keys
|
3239
3007
|
* and values in the hash that is returned are hypervisor specific.
|
3240
3008
|
*/
|
@@ -3249,9 +3017,7 @@ static VALUE libvirt_domain_block_iotune(int argc, VALUE *argv, VALUE d)
|
|
3249
3017
|
(void *)disk, iotune_nparams,
|
3250
3018
|
iotune_get);
|
3251
3019
|
}
|
3252
|
-
#endif
|
3253
3020
|
|
3254
|
-
#if HAVE_VIRDOMAINSETBLOCKIOTUNE
|
3255
3021
|
static struct ruby_libvirt_typed_param iotune_allowed[] = {
|
3256
3022
|
{VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC, VIR_TYPED_PARAM_ULLONG},
|
3257
3023
|
{VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC, VIR_TYPED_PARAM_ULLONG},
|
@@ -3266,7 +3032,7 @@ static struct ruby_libvirt_typed_param iotune_allowed[] = {
|
|
3266
3032
|
* call-seq:
|
3267
3033
|
* dom.block_iotune = disk,Hash,flags=0
|
3268
3034
|
*
|
3269
|
-
* Call virDomainSetBlockIoTune[
|
3035
|
+
* Call virDomainSetBlockIoTune[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune]
|
3270
3036
|
* to set the block IO tune parameters for the supplied disk on this domain.
|
3271
3037
|
* The keys and values in the input hash are hypervisor specific.
|
3272
3038
|
*/
|
@@ -3296,14 +3062,12 @@ static VALUE libvirt_domain_block_iotune_equal(VALUE d, VALUE in)
|
|
3296
3062
|
ARRAY_SIZE(iotune_allowed),
|
3297
3063
|
iotune_set);
|
3298
3064
|
}
|
3299
|
-
#endif
|
3300
3065
|
|
3301
|
-
#if HAVE_VIRDOMAINBLOCKCOMMIT
|
3302
3066
|
/*
|
3303
3067
|
* call-seq:
|
3304
3068
|
* dom.block_commit(disk, base=nil, top=nil, bandwidth=0, flags=0) -> nil
|
3305
3069
|
*
|
3306
|
-
* Call virDomainBlockCommit[
|
3070
|
+
* Call virDomainBlockCommit[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit]
|
3307
3071
|
* to commit changes from a top-level backing file into a lower level base file.
|
3308
3072
|
*/
|
3309
3073
|
static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
|
@@ -3321,14 +3085,12 @@ static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
|
|
3321
3085
|
ruby_libvirt_value_to_ulong(bandwidth),
|
3322
3086
|
ruby_libvirt_value_to_uint(flags));
|
3323
3087
|
}
|
3324
|
-
#endif
|
3325
3088
|
|
3326
|
-
#if HAVE_VIRDOMAINBLOCKPULL
|
3327
3089
|
/*
|
3328
3090
|
* call-seq:
|
3329
3091
|
* dom.block_pull(disk, bandwidth=0, flags=0) -> nil
|
3330
3092
|
*
|
3331
|
-
* Call virDomainBlockPull[
|
3093
|
+
* Call virDomainBlockPull[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull]
|
3332
3094
|
* to pull changes from a backing file into a disk image.
|
3333
3095
|
*/
|
3334
3096
|
static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
|
@@ -3344,14 +3106,12 @@ static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
|
|
3344
3106
|
ruby_libvirt_value_to_ulong(bandwidth),
|
3345
3107
|
ruby_libvirt_value_to_uint(flags));
|
3346
3108
|
}
|
3347
|
-
#endif
|
3348
3109
|
|
3349
|
-
#if HAVE_VIRDOMAINBLOCKJOBSETSPEED
|
3350
3110
|
/*
|
3351
3111
|
* call-seq:
|
3352
3112
|
* dom.block_job_speed = disk,bandwidth=0,flags=0
|
3353
3113
|
*
|
3354
|
-
* Call virDomainBlockJobSetSpeed[
|
3114
|
+
* Call virDomainBlockJobSetSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobSetSpeed]
|
3355
3115
|
* to set the maximum allowable bandwidth a block job may consume.
|
3356
3116
|
*/
|
3357
3117
|
static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
|
@@ -3390,14 +3150,12 @@ static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
|
|
3390
3150
|
StringValueCStr(disk),
|
3391
3151
|
NUM2UINT(bandwidth), NUM2UINT(flags));
|
3392
3152
|
}
|
3393
|
-
#endif
|
3394
3153
|
|
3395
|
-
#if HAVE_VIRDOMAINGETBLOCKJOBINFO
|
3396
3154
|
/*
|
3397
3155
|
* call-seq:
|
3398
3156
|
* dom.block_job_info(disk, flags=0) -> Libvirt::Domain::BlockJobInfo
|
3399
3157
|
*
|
3400
|
-
* Call virDomainGetBlockJobInfo[
|
3158
|
+
* Call virDomainGetBlockJobInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo]
|
3401
3159
|
* to get block job information for a given disk.
|
3402
3160
|
*/
|
3403
3161
|
static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
|
@@ -3425,14 +3183,12 @@ static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
|
|
3425
3183
|
|
3426
3184
|
return result;
|
3427
3185
|
}
|
3428
|
-
#endif
|
3429
3186
|
|
3430
|
-
#if HAVE_VIRDOMAINBLOCKJOBABORT
|
3431
3187
|
/*
|
3432
3188
|
* call-seq:
|
3433
3189
|
* dom.block_job_abort(disk, flags=0) -> nil
|
3434
3190
|
*
|
3435
|
-
* Call virDomainBlockJobAbort[
|
3191
|
+
* Call virDomainBlockJobAbort[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbort]
|
3436
3192
|
* to cancel an active block job on the given disk.
|
3437
3193
|
*/
|
3438
3194
|
static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
|
@@ -3447,9 +3203,7 @@ static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
|
|
3447
3203
|
StringValueCStr(disk),
|
3448
3204
|
ruby_libvirt_value_to_uint(flags));
|
3449
3205
|
}
|
3450
|
-
#endif
|
3451
3206
|
|
3452
|
-
#if HAVE_VIRDOMAINGETINTERFACEPARAMETERS
|
3453
3207
|
static const char *interface_nparams(VALUE d, unsigned int flags, void *opaque,
|
3454
3208
|
int *nparams)
|
3455
3209
|
{
|
@@ -3497,7 +3251,7 @@ static const char *interface_set(VALUE d, unsigned int flags,
|
|
3497
3251
|
* call-seq:
|
3498
3252
|
* dom.interface_parameters(interface, flags=0) -> Hash
|
3499
3253
|
*
|
3500
|
-
* Call virDomainGetInterfaceParameters[
|
3254
|
+
* Call virDomainGetInterfaceParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters]
|
3501
3255
|
* to retrieve the interface parameters for the given interface on this domain.
|
3502
3256
|
* The keys and values in the hash that is returned are hypervisor specific.
|
3503
3257
|
*/
|
@@ -3528,7 +3282,7 @@ static struct ruby_libvirt_typed_param interface_allowed[] = {
|
|
3528
3282
|
* call-seq:
|
3529
3283
|
* dom.interface_parameters = device,Hash,flags=0
|
3530
3284
|
*
|
3531
|
-
* Call virDomainSetInterfaceParameters[
|
3285
|
+
* Call virDomainSetInterfaceParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters]
|
3532
3286
|
* to set the interface parameters for the supplied device on this domain.
|
3533
3287
|
* The keys and values in the input hash are hypervisor specific.
|
3534
3288
|
*/
|
@@ -3559,9 +3313,7 @@ static VALUE libvirt_domain_interface_parameters_equal(VALUE d, VALUE in)
|
|
3559
3313
|
ARRAY_SIZE(interface_allowed),
|
3560
3314
|
interface_set);
|
3561
3315
|
}
|
3562
|
-
#endif
|
3563
3316
|
|
3564
|
-
#if HAVE_VIRDOMAINBLOCKSTATSFLAGS
|
3565
3317
|
static const char *block_stats_nparams(VALUE d, unsigned int flags,
|
3566
3318
|
void *opaque, int *nparams)
|
3567
3319
|
{
|
@@ -3594,7 +3346,7 @@ static const char *block_stats_get(VALUE d, unsigned int flags,
|
|
3594
3346
|
* call-seq:
|
3595
3347
|
* dom.block_stats_flags(disk, flags=0) -> Hash
|
3596
3348
|
*
|
3597
|
-
* Call virDomainGetBlockStatsFlags[
|
3349
|
+
* Call virDomainGetBlockStatsFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockStatsFlags]
|
3598
3350
|
* to retrieve the block statistics for the given disk on this domain.
|
3599
3351
|
* The keys and values in the hash that is returned are hypervisor specific.
|
3600
3352
|
*/
|
@@ -3612,9 +3364,7 @@ static VALUE libvirt_domain_block_stats_flags(int argc, VALUE *argv, VALUE d)
|
|
3612
3364
|
block_stats_nparams,
|
3613
3365
|
block_stats_get);
|
3614
3366
|
}
|
3615
|
-
#endif
|
3616
3367
|
|
3617
|
-
#if HAVE_VIRDOMAINGETNUMAPARAMETERS
|
3618
3368
|
static const char *numa_nparams(VALUE d, unsigned int flags,
|
3619
3369
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
3620
3370
|
int *nparams)
|
@@ -3655,7 +3405,7 @@ static const char *numa_set(VALUE d, unsigned int flags,
|
|
3655
3405
|
* call-seq:
|
3656
3406
|
* dom.numa_parameters(flags=0) -> Hash
|
3657
3407
|
*
|
3658
|
-
* Call virDomainGetNumaParameters[
|
3408
|
+
* Call virDomainGetNumaParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters]
|
3659
3409
|
* to retrieve the numa parameters for this domain. The keys and values in
|
3660
3410
|
* the hash that is returned are hypervisor specific.
|
3661
3411
|
*/
|
@@ -3679,7 +3429,7 @@ static struct ruby_libvirt_typed_param numa_allowed[] = {
|
|
3679
3429
|
* call-seq:
|
3680
3430
|
* dom.numa_parameters = Hash,flags=0
|
3681
3431
|
*
|
3682
|
-
* Call virDomainSetNumaParameters[
|
3432
|
+
* Call virDomainSetNumaParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetNumaParameters]
|
3683
3433
|
* to set the numa parameters for this domain. The keys and values in the input
|
3684
3434
|
* hash are hypervisor specific.
|
3685
3435
|
*/
|
@@ -3695,14 +3445,12 @@ static VALUE libvirt_domain_numa_parameters_equal(VALUE d, VALUE in)
|
|
3695
3445
|
ARRAY_SIZE(numa_allowed),
|
3696
3446
|
numa_set);
|
3697
3447
|
}
|
3698
|
-
#endif
|
3699
3448
|
|
3700
|
-
#if HAVE_VIRDOMAINLXCOPENNAMESPACE
|
3701
3449
|
/*
|
3702
3450
|
* call-seq:
|
3703
3451
|
* dom.lxc_open_namespace(flags=0) -> Array
|
3704
3452
|
*
|
3705
|
-
* Call virDomainLxcOpenNamespace[
|
3453
|
+
* Call virDomainLxcOpenNamespace[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcOpenNamespace]
|
3706
3454
|
* to open an LXC namespace. Note that this will only work on connections to
|
3707
3455
|
* the LXC driver. The call will return an array of open file descriptors;
|
3708
3456
|
* these should be closed when use of them is finished.
|
@@ -3752,14 +3500,12 @@ error:
|
|
3752
3500
|
free(fdlist);
|
3753
3501
|
rb_jump_tag(exception);
|
3754
3502
|
}
|
3755
|
-
#endif
|
3756
3503
|
|
3757
|
-
#if HAVE_VIRDOMAINQEMUAGENTCOMMAND
|
3758
3504
|
/*
|
3759
3505
|
* call-seq:
|
3760
3506
|
* dom.qemu_agent_command(command, timeout=0, flags=0) -> String
|
3761
3507
|
*
|
3762
|
-
* Call virDomainQemuAgentCommand[
|
3508
|
+
* Call virDomainQemuAgentCommand[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainQemuAgentCommand]
|
3763
3509
|
* to run an arbitrary command on the Qemu Agent.
|
3764
3510
|
*/
|
3765
3511
|
static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
|
@@ -3790,14 +3536,12 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
|
|
3790
3536
|
|
3791
3537
|
return result;
|
3792
3538
|
}
|
3793
|
-
#endif
|
3794
3539
|
|
3795
|
-
#if HAVE_VIRDOMAINLXCENTERNAMESPACE
|
3796
3540
|
/*
|
3797
3541
|
* call-seq:
|
3798
3542
|
* dom.lxc_enter_namespace(fds, flags=0) -> Array
|
3799
3543
|
*
|
3800
|
-
* Call virDomainLxcEnterNamespace[
|
3544
|
+
* Call virDomainLxcEnterNamespace[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcEnterNamespace]
|
3801
3545
|
* to attach the process to the namespaces associated with the file descriptors
|
3802
3546
|
* in the fds array. Note that this call does not actually enter the namespace;
|
3803
3547
|
* the next call to fork will do that. Also note that this function will return
|
@@ -3856,9 +3600,7 @@ static VALUE libvirt_domain_lxc_enter_namespace(int argc, VALUE *argv, VALUE d)
|
|
3856
3600
|
|
3857
3601
|
return result;
|
3858
3602
|
}
|
3859
|
-
#endif
|
3860
3603
|
|
3861
|
-
#if HAVE_VIRDOMAINMIGRATE3
|
3862
3604
|
static struct ruby_libvirt_typed_param migrate3_allowed[] = {
|
3863
3605
|
{VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING},
|
3864
3606
|
{VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING},
|
@@ -3872,7 +3614,7 @@ static struct ruby_libvirt_typed_param migrate3_allowed[] = {
|
|
3872
3614
|
* call-seq:
|
3873
3615
|
* dom.migrate3(dconn, Hash=nil, flags=0) -> Libvirt::Domain
|
3874
3616
|
*
|
3875
|
-
* Call virDomainMigrate3[
|
3617
|
+
* Call virDomainMigrate3[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3]
|
3876
3618
|
* to migrate a domain from the host on this connection to the connection
|
3877
3619
|
* referenced in dconn.
|
3878
3620
|
*/
|
@@ -3916,7 +3658,7 @@ static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
|
|
3916
3658
|
* call-seq:
|
3917
3659
|
* dom.migrate_to_uri3(duri=nil, Hash=nil, flags=0) -> nil
|
3918
3660
|
*
|
3919
|
-
* Call virDomainMigrateToURI3[
|
3661
|
+
* Call virDomainMigrateToURI3[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3]
|
3920
3662
|
* to migrate a domain from the host on this connection to the host whose
|
3921
3663
|
* libvirt URI is duri.
|
3922
3664
|
*/
|
@@ -3952,14 +3694,12 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
|
|
3952
3694
|
args.params, args.i,
|
3953
3695
|
ruby_libvirt_value_to_ulong(flags));
|
3954
3696
|
}
|
3955
|
-
#endif
|
3956
3697
|
|
3957
|
-
#if HAVE_VIRDOMAINGETCPUSTATS
|
3958
3698
|
/*
|
3959
3699
|
* call-seq:
|
3960
3700
|
* dom.cpu_stats(start_cpu=-1, numcpus=1, flags=0) -> Hash
|
3961
3701
|
*
|
3962
|
-
* Call virDomainGetCPUStats[
|
3702
|
+
* Call virDomainGetCPUStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetCPUStats]
|
3963
3703
|
* to get statistics about CPU usage attributable to a single domain. If
|
3964
3704
|
* start_cpu is -1, then numcpus must be 1 and statistics attributable to the
|
3965
3705
|
* entire domain is returned. If start_cpu is any positive number, then it
|
@@ -4045,13 +3785,11 @@ static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
|
|
4045
3785
|
|
4046
3786
|
return result;
|
4047
3787
|
}
|
4048
|
-
#endif
|
4049
3788
|
|
4050
|
-
#if HAVE_VIRDOMAINGETTIME
|
4051
3789
|
/*
|
4052
3790
|
* call-seq:
|
4053
3791
|
* dom.time(flags=0) -> Hash
|
4054
|
-
* Call virDomainGetTime[
|
3792
|
+
* Call virDomainGetTime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime]
|
4055
3793
|
* to get information about the guest time.
|
4056
3794
|
*/
|
4057
3795
|
static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
|
@@ -4074,13 +3812,11 @@ static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
|
|
4074
3812
|
|
4075
3813
|
return result;
|
4076
3814
|
}
|
4077
|
-
#endif
|
4078
3815
|
|
4079
|
-
#if HAVE_VIRDOMAINSETTIME
|
4080
3816
|
/*
|
4081
3817
|
* call-seq:
|
4082
3818
|
* dom.time = Hash,flags=0
|
4083
|
-
* Call virDomainSetTime[
|
3819
|
+
* Call virDomainSetTime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetTime]
|
4084
3820
|
* to set guest time.
|
4085
3821
|
*/
|
4086
3822
|
static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
|
@@ -4098,14 +3834,12 @@ static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
|
|
4098
3834
|
NUM2LL(seconds), NUM2UINT(nseconds),
|
4099
3835
|
NUM2UINT(flags));
|
4100
3836
|
}
|
4101
|
-
#endif
|
4102
3837
|
|
4103
|
-
#if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
|
4104
3838
|
/*
|
4105
3839
|
* call-seq:
|
4106
3840
|
* dom.core_dump_with_format(filename, dumpformat, flags=0) -> nil
|
4107
3841
|
*
|
4108
|
-
* Call virDomainCoreDumpWithFormat[
|
3842
|
+
* Call virDomainCoreDumpWithFormat[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump]
|
4109
3843
|
* to do a full memory dump of the domain to filename.
|
4110
3844
|
*/
|
4111
3845
|
static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d)
|
@@ -4121,14 +3855,12 @@ static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d
|
|
4121
3855
|
NUM2UINT(dumpformat),
|
4122
3856
|
ruby_libvirt_value_to_uint(flags));
|
4123
3857
|
}
|
4124
|
-
#endif
|
4125
3858
|
|
4126
|
-
#if HAVE_VIRDOMAINFSFREEZE
|
4127
3859
|
/*
|
4128
3860
|
* call-seq:
|
4129
3861
|
* dom.fs_freeze(mountpoints=nil, flags=0) -> Fixnum
|
4130
3862
|
*
|
4131
|
-
* Call virDomainFSFreeze[
|
3863
|
+
* Call virDomainFSFreeze[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSFreeze]
|
4132
3864
|
* to freeze the specified filesystems within the guest.
|
4133
3865
|
*/
|
4134
3866
|
static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
|
@@ -4162,14 +3894,12 @@ static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
|
|
4162
3894
|
mnt, nmountpoints,
|
4163
3895
|
ruby_libvirt_value_to_uint(flags));
|
4164
3896
|
}
|
4165
|
-
#endif
|
4166
3897
|
|
4167
|
-
#if HAVE_VIRDOMAINFSTHAW
|
4168
3898
|
/*
|
4169
3899
|
* call-seq:
|
4170
3900
|
* dom.fs_thaw(mountpoints=nil, flags=0) -> Fixnum
|
4171
3901
|
*
|
4172
|
-
* Call virDomainFSThaw[
|
3902
|
+
* Call virDomainFSThaw[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw]
|
4173
3903
|
* to thaw the specified filesystems within the guest.
|
4174
3904
|
*/
|
4175
3905
|
static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
|
@@ -4203,9 +3933,7 @@ static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
|
|
4203
3933
|
mnt, nmountpoints,
|
4204
3934
|
ruby_libvirt_value_to_uint(flags));
|
4205
3935
|
}
|
4206
|
-
#endif
|
4207
3936
|
|
4208
|
-
#if HAVE_VIRDOMAINGETFSINFO
|
4209
3937
|
struct fs_info_arg {
|
4210
3938
|
virDomainFSInfoPtr *info;
|
4211
3939
|
int ninfo;
|
@@ -4244,7 +3972,7 @@ static VALUE fs_info_wrap(VALUE arg)
|
|
4244
3972
|
* call-seq:
|
4245
3973
|
* dom.fs_info(flags=0) -> [Hash]
|
4246
3974
|
*
|
4247
|
-
* Call virDomainGetFSInfo[
|
3975
|
+
* Call virDomainGetFSInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetFSInfo]
|
4248
3976
|
* to get information about the guest filesystems.
|
4249
3977
|
*/
|
4250
3978
|
static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
|
@@ -4276,14 +4004,12 @@ static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
|
|
4276
4004
|
|
4277
4005
|
return result;
|
4278
4006
|
}
|
4279
|
-
#endif
|
4280
4007
|
|
4281
|
-
#if HAVE_VIRDOMAINRENAME
|
4282
4008
|
/*
|
4283
4009
|
* call-seq:
|
4284
4010
|
* dom.rename(name, flags=0) -> nil
|
4285
4011
|
*
|
4286
|
-
* Call virDomainRename[
|
4012
|
+
* Call virDomainRename[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRename]
|
4287
4013
|
* to rename a domain.
|
4288
4014
|
*/
|
4289
4015
|
static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
|
@@ -4298,14 +4024,12 @@ static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
|
|
4298
4024
|
StringValueCStr(name),
|
4299
4025
|
ruby_libvirt_value_to_uint(flags));
|
4300
4026
|
}
|
4301
|
-
#endif
|
4302
4027
|
|
4303
|
-
#if HAVE_VIRDOMAINSETUSERPASSWORD
|
4304
4028
|
/*
|
4305
4029
|
* call-seq:
|
4306
4030
|
* dom.user_password = user,password,flags=0 -> nil
|
4307
4031
|
*
|
4308
|
-
* Call virDomainSetUserPassword[
|
4032
|
+
* Call virDomainSetUserPassword[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword]
|
4309
4033
|
* to set the user password on a domain.
|
4310
4034
|
*/
|
4311
4035
|
static VALUE libvirt_domain_user_password_equal(VALUE d, VALUE in)
|
@@ -4336,7 +4060,6 @@ static VALUE libvirt_domain_user_password_equal(VALUE d, VALUE in)
|
|
4336
4060
|
StringValueCStr(password),
|
4337
4061
|
ruby_libvirt_value_to_uint(flags));
|
4338
4062
|
}
|
4339
|
-
#endif
|
4340
4063
|
|
4341
4064
|
/*
|
4342
4065
|
* Class Libvirt::Domain
|
@@ -4352,67 +4075,35 @@ void ruby_libvirt_domain_init(void)
|
|
4352
4075
|
rb_define_const(c_domain, "SHUTDOWN", INT2NUM(VIR_DOMAIN_SHUTDOWN));
|
4353
4076
|
rb_define_const(c_domain, "SHUTOFF", INT2NUM(VIR_DOMAIN_SHUTOFF));
|
4354
4077
|
rb_define_const(c_domain, "CRASHED", INT2NUM(VIR_DOMAIN_CRASHED));
|
4355
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED
|
4356
4078
|
rb_define_const(c_domain, "PMSUSPENDED", INT2NUM(VIR_DOMAIN_PMSUSPENDED));
|
4357
|
-
#endif
|
4358
4079
|
|
4359
4080
|
/* virDomainMigrateFlags */
|
4360
|
-
#if HAVE_CONST_VIR_MIGRATE_LIVE
|
4361
4081
|
rb_define_const(c_domain, "MIGRATE_LIVE", INT2NUM(VIR_MIGRATE_LIVE));
|
4362
|
-
#endif
|
4363
|
-
#if HAVE_CONST_VIR_MIGRATE_PEER2PEER
|
4364
4082
|
rb_define_const(c_domain, "MIGRATE_PEER2PEER",
|
4365
4083
|
INT2NUM(VIR_MIGRATE_PEER2PEER));
|
4366
|
-
#endif
|
4367
|
-
#if HAVE_CONST_VIR_MIGRATE_TUNNELLED
|
4368
4084
|
rb_define_const(c_domain, "MIGRATE_TUNNELLED",
|
4369
4085
|
INT2NUM(VIR_MIGRATE_TUNNELLED));
|
4370
|
-
#endif
|
4371
|
-
#if HAVE_CONST_VIR_MIGRATE_PERSIST_DEST
|
4372
4086
|
rb_define_const(c_domain, "MIGRATE_PERSIST_DEST",
|
4373
4087
|
INT2NUM(VIR_MIGRATE_PERSIST_DEST));
|
4374
|
-
#endif
|
4375
|
-
#if HAVE_CONST_VIR_MIGRATE_UNDEFINE_SOURCE
|
4376
4088
|
rb_define_const(c_domain, "MIGRATE_UNDEFINE_SOURCE",
|
4377
4089
|
INT2NUM(VIR_MIGRATE_UNDEFINE_SOURCE));
|
4378
|
-
#endif
|
4379
|
-
#if HAVE_CONST_VIR_MIGRATE_PAUSED
|
4380
4090
|
rb_define_const(c_domain, "MIGRATE_PAUSED", INT2NUM(VIR_MIGRATE_PAUSED));
|
4381
|
-
#endif
|
4382
|
-
#if HAVE_CONST_VIR_MIGRATE_NON_SHARED_DISK
|
4383
4091
|
rb_define_const(c_domain, "MIGRATE_NON_SHARED_DISK",
|
4384
4092
|
INT2NUM(VIR_MIGRATE_NON_SHARED_DISK));
|
4385
|
-
#endif
|
4386
|
-
#if HAVE_CONST_VIR_MIGRATE_NON_SHARED_INC
|
4387
4093
|
rb_define_const(c_domain, "MIGRATE_NON_SHARED_INC",
|
4388
4094
|
INT2NUM(VIR_MIGRATE_NON_SHARED_INC));
|
4389
|
-
#endif
|
4390
|
-
#if HAVE_CONST_VIR_MIGRATE_CHANGE_PROTECTION
|
4391
4095
|
rb_define_const(c_domain, "MIGRATE_CHANGE_PROTECTION",
|
4392
4096
|
INT2NUM(VIR_MIGRATE_CHANGE_PROTECTION));
|
4393
|
-
#endif
|
4394
|
-
#if HAVE_CONST_VIR_MIGRATE_UNSAFE
|
4395
4097
|
rb_define_const(c_domain, "MIGRATE_UNSAFE", INT2NUM(VIR_MIGRATE_UNSAFE));
|
4396
|
-
#endif
|
4397
|
-
#if HAVE_CONST_VIR_MIGRATE_OFFLINE
|
4398
4098
|
rb_define_const(c_domain, "MIGRATE_OFFLINE", INT2NUM(VIR_MIGRATE_OFFLINE));
|
4399
|
-
#endif
|
4400
|
-
#if HAVE_CONST_VIR_MIGRATE_COMPRESSED
|
4401
4099
|
rb_define_const(c_domain, "MIGRATE_COMPRESSED",
|
4402
4100
|
INT2NUM(VIR_MIGRATE_COMPRESSED));
|
4403
|
-
#endif
|
4404
|
-
#if HAVE_CONST_VIR_MIGRATE_ABORT_ON_ERROR
|
4405
4101
|
rb_define_const(c_domain, "MIGRATE_ABORT_ON_ERROR",
|
4406
4102
|
INT2NUM(VIR_MIGRATE_ABORT_ON_ERROR));
|
4407
|
-
#endif
|
4408
|
-
#if HAVE_CONST_VIR_MIGRATE_AUTO_CONVERGE
|
4409
4103
|
rb_define_const(c_domain, "MIGRATE_AUTO_CONVERGE",
|
4410
4104
|
INT2NUM(VIR_MIGRATE_AUTO_CONVERGE));
|
4411
|
-
#endif
|
4412
|
-
#if HAVE_CONST_VIR_MIGRATE_RDMA_PIN_ALL
|
4413
4105
|
rb_define_const(c_domain, "MIGRATE_RDMA_PIN_ALL",
|
4414
4106
|
INT2NUM(VIR_MIGRATE_RDMA_PIN_ALL));
|
4415
|
-
#endif
|
4416
4107
|
|
4417
4108
|
/* Ideally we would just have the "XML_SECURE" constant. Unfortunately
|
4418
4109
|
* we screwed up long ago, and we have to leave "DOMAIN_XML_SECURE" for
|
@@ -4428,7 +4119,6 @@ void ruby_libvirt_domain_init(void)
|
|
4428
4119
|
rb_define_const(c_domain, "XML_INACTIVE", INT2NUM(VIR_DOMAIN_XML_INACTIVE));
|
4429
4120
|
rb_define_const(c_domain, "DOMAIN_XML_INACTIVE",
|
4430
4121
|
INT2NUM(VIR_DOMAIN_XML_INACTIVE));
|
4431
|
-
#if HAVE_CONST_VIR_DOMAIN_XML_UPDATE_CPU
|
4432
4122
|
/* Ideally we would just have the "XML_UPDATE_CPU" constant. Unfortunately
|
4433
4123
|
* we screwed up long ago, and we have to leave "DOMAIN_XML_UPDATE_CPU" for
|
4434
4124
|
* backwards compatibility.
|
@@ -4437,77 +4127,39 @@ void ruby_libvirt_domain_init(void)
|
|
4437
4127
|
INT2NUM(VIR_DOMAIN_XML_UPDATE_CPU));
|
4438
4128
|
rb_define_const(c_domain, "DOMAIN_XML_UPDATE_CPU",
|
4439
4129
|
INT2NUM(VIR_DOMAIN_XML_UPDATE_CPU));
|
4440
|
-
#endif
|
4441
|
-
#if HAVE_CONST_VIR_DOMAIN_XML_MIGRATABLE
|
4442
4130
|
rb_define_const(c_domain, "XML_MIGRATABLE",
|
4443
4131
|
INT2NUM(VIR_DOMAIN_XML_MIGRATABLE));
|
4444
|
-
#endif
|
4445
|
-
#if HAVE_VIRDOMAINMEMORYPEEK
|
4446
4132
|
rb_define_const(c_domain, "MEMORY_VIRTUAL", INT2NUM(VIR_MEMORY_VIRTUAL));
|
4447
|
-
#endif
|
4448
|
-
#if HAVE_CONST_VIR_MEMORY_PHYSICAL
|
4449
4133
|
rb_define_const(c_domain, "MEMORY_PHYSICAL", INT2NUM(VIR_MEMORY_PHYSICAL));
|
4450
|
-
#endif
|
4451
4134
|
|
4452
|
-
#if HAVE_CONST_VIR_DOMAIN_START_PAUSED
|
4453
4135
|
rb_define_const(c_domain, "START_PAUSED", INT2NUM(VIR_DOMAIN_START_PAUSED));
|
4454
|
-
#endif
|
4455
4136
|
|
4456
|
-
#if HAVE_CONST_VIR_DOMAIN_START_AUTODESTROY
|
4457
4137
|
rb_define_const(c_domain, "START_AUTODESTROY",
|
4458
4138
|
INT2NUM(VIR_DOMAIN_START_AUTODESTROY));
|
4459
|
-
#endif
|
4460
|
-
|
4461
|
-
#if HAVE_CONST_VIR_DOMAIN_START_BYPASS_CACHE
|
4462
4139
|
rb_define_const(c_domain, "START_BYPASS_CACHE",
|
4463
4140
|
INT2NUM(VIR_DOMAIN_START_BYPASS_CACHE));
|
4464
|
-
#endif
|
4465
|
-
|
4466
|
-
#if HAVE_CONST_VIR_DOMAIN_START_FORCE_BOOT
|
4467
4141
|
rb_define_const(c_domain, "START_FORCE_BOOT",
|
4468
4142
|
INT2NUM(VIR_DOMAIN_START_FORCE_BOOT));
|
4469
|
-
#endif
|
4470
4143
|
|
4471
|
-
#if HAVE_CONST_VIR_DUMP_CRASH
|
4472
4144
|
rb_define_const(c_domain, "DUMP_CRASH", INT2NUM(VIR_DUMP_CRASH));
|
4473
|
-
#endif
|
4474
|
-
#if HAVE_CONST_VIR_DUMP_LIVE
|
4475
4145
|
rb_define_const(c_domain, "DUMP_LIVE", INT2NUM(VIR_DUMP_LIVE));
|
4476
|
-
#endif
|
4477
|
-
#if HAVE_CONST_VIR_DUMP_BYPASS_CACHE
|
4478
4146
|
rb_define_const(c_domain, "BYPASS_CACHE", INT2NUM(VIR_DUMP_BYPASS_CACHE));
|
4479
|
-
#endif
|
4480
|
-
#if HAVE_CONST_VIR_DUMP_RESET
|
4481
4147
|
rb_define_const(c_domain, "RESET", INT2NUM(VIR_DUMP_RESET));
|
4482
|
-
#endif
|
4483
|
-
#if HAVE_CONST_VIR_DUMP_MEMORY_ONLY
|
4484
4148
|
rb_define_const(c_domain, "MEMORY_ONLY", INT2NUM(VIR_DUMP_MEMORY_ONLY));
|
4485
|
-
#endif
|
4486
4149
|
|
4487
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
4488
4150
|
rb_define_const(c_domain, "VCPU_LIVE", INT2NUM(VIR_DOMAIN_VCPU_LIVE));
|
4489
4151
|
rb_define_const(c_domain, "VCPU_CONFIG", INT2NUM(VIR_DOMAIN_VCPU_CONFIG));
|
4490
4152
|
rb_define_const(c_domain, "VCPU_MAXIMUM", INT2NUM(VIR_DOMAIN_VCPU_MAXIMUM));
|
4491
|
-
#endif
|
4492
|
-
#if HAVE_CONST_VIR_DOMAIN_VCPU_CURRENT
|
4493
4153
|
rb_define_const(c_domain, "VCPU_CURRENT", INT2NUM(VIR_DOMAIN_VCPU_CURRENT));
|
4494
|
-
#endif
|
4495
|
-
#if HAVE_CONST_VIR_DOMAIN_VCPU_GUEST
|
4496
4154
|
rb_define_const(c_domain, "VCPU_GUEST", INT2NUM(VIR_DOMAIN_VCPU_GUEST));
|
4497
|
-
#endif
|
4498
4155
|
|
4499
4156
|
rb_define_method(c_domain, "migrate", libvirt_domain_migrate, -1);
|
4500
|
-
#if HAVE_VIRDOMAINMIGRATETOURI
|
4501
4157
|
rb_define_method(c_domain, "migrate_to_uri",
|
4502
4158
|
libvirt_domain_migrate_to_uri, -1);
|
4503
|
-
#endif
|
4504
|
-
#if HAVE_VIRDOMAINMIGRATESETMAXDOWNTIME
|
4505
4159
|
rb_define_method(c_domain, "migrate_set_max_downtime",
|
4506
4160
|
libvirt_domain_migrate_set_max_downtime, -1);
|
4507
4161
|
rb_define_method(c_domain, "migrate_max_downtime=",
|
4508
4162
|
libvirt_domain_migrate_max_downtime_equal, 1);
|
4509
|
-
#endif
|
4510
|
-
#if HAVE_VIRDOMAINMIGRATE2
|
4511
4163
|
rb_define_method(c_domain, "migrate2", libvirt_domain_migrate2, -1);
|
4512
4164
|
rb_define_method(c_domain, "migrate_to_uri2",
|
4513
4165
|
libvirt_domain_migrate_to_uri2, -1);
|
@@ -4515,92 +4167,60 @@ void ruby_libvirt_domain_init(void)
|
|
4515
4167
|
libvirt_domain_migrate_set_max_speed, -1);
|
4516
4168
|
rb_define_method(c_domain, "migrate_max_speed=",
|
4517
4169
|
libvirt_domain_migrate_max_speed_equal, 1);
|
4518
|
-
#endif
|
4519
4170
|
|
4520
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_BYPASS_CACHE
|
4521
4171
|
rb_define_const(c_domain, "SAVE_BYPASS_CACHE",
|
4522
4172
|
INT2NUM(VIR_DOMAIN_SAVE_BYPASS_CACHE));
|
4523
|
-
#endif
|
4524
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_RUNNING
|
4525
4173
|
rb_define_const(c_domain, "SAVE_RUNNING", INT2NUM(VIR_DOMAIN_SAVE_RUNNING));
|
4526
|
-
#endif
|
4527
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_PAUSED
|
4528
4174
|
rb_define_const(c_domain, "SAVE_PAUSED", INT2NUM(VIR_DOMAIN_SAVE_PAUSED));
|
4529
|
-
#endif
|
4530
4175
|
|
4531
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
|
4532
4176
|
rb_define_const(c_domain, "UNDEFINE_MANAGED_SAVE",
|
4533
4177
|
INT2NUM(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE));
|
4534
|
-
#endif
|
4535
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA
|
4536
4178
|
rb_define_const(c_domain, "UNDEFINE_SNAPSHOTS_METADATA",
|
4537
4179
|
INT2NUM(VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA));
|
4538
|
-
#endif
|
4539
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_NVRAM
|
4540
4180
|
rb_define_const(c_domain, "UNDEFINE_NVRAM",
|
4541
4181
|
INT2NUM(VIR_DOMAIN_UNDEFINE_NVRAM));
|
4182
|
+
#if LIBVIR_CHECK_VERSION(2, 3, 0)
|
4183
|
+
rb_define_const(c_domain, "UNDEFINE_KEEP_NVRAM",
|
4184
|
+
INT2NUM(VIR_DOMAIN_UNDEFINE_KEEP_NVRAM));
|
4185
|
+
#endif
|
4186
|
+
#if LIBVIR_CHECK_VERSION(5, 6, 0)
|
4187
|
+
rb_define_const(c_domain, "UNDEFINE_CHECKPOINTS_METADATA",
|
4188
|
+
INT2NUM(VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA));
|
4542
4189
|
#endif
|
4543
4190
|
rb_define_attr(c_domain, "connection", 1, 0);
|
4544
4191
|
|
4545
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_DEFAULT
|
4546
4192
|
rb_define_const(c_domain, "SHUTDOWN_DEFAULT",
|
4547
4193
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_DEFAULT));
|
4548
|
-
#endif
|
4549
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN
|
4550
4194
|
rb_define_const(c_domain, "SHUTDOWN_ACPI_POWER_BTN",
|
4551
4195
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN));
|
4552
|
-
#endif
|
4553
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_GUEST_AGENT
|
4554
4196
|
rb_define_const(c_domain, "SHUTDOWN_GUEST_AGENT",
|
4555
4197
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_GUEST_AGENT));
|
4556
|
-
#endif
|
4557
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_INITCTL
|
4558
4198
|
rb_define_const(c_domain, "SHUTDOWN_INITCTL",
|
4559
4199
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_INITCTL));
|
4560
|
-
#endif
|
4561
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_SIGNAL
|
4562
4200
|
rb_define_const(c_domain, "SHUTDOWN_SIGNAL",
|
4563
4201
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_SIGNAL));
|
4564
|
-
#endif
|
4565
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_PARAVIRT
|
4566
4202
|
rb_define_const(c_domain, "SHUTDOWN_PARAVIRT",
|
4567
4203
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_PARAVIRT));
|
4568
|
-
#endif
|
4569
4204
|
rb_define_method(c_domain, "shutdown", libvirt_domain_shutdown, -1);
|
4570
4205
|
|
4571
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_DEFAULT
|
4572
4206
|
rb_define_const(c_domain, "REBOOT_DEFAULT",
|
4573
4207
|
INT2NUM(VIR_DOMAIN_REBOOT_DEFAULT));
|
4574
|
-
#endif
|
4575
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_ACPI_POWER_BTN
|
4576
4208
|
rb_define_const(c_domain, "REBOOT_ACPI_POWER_BTN",
|
4577
4209
|
INT2NUM(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN));
|
4578
|
-
#endif
|
4579
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_GUEST_AGENT
|
4580
4210
|
rb_define_const(c_domain, "REBOOT_GUEST_AGENT",
|
4581
4211
|
INT2NUM(VIR_DOMAIN_REBOOT_GUEST_AGENT));
|
4582
|
-
#endif
|
4583
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_INITCTL
|
4584
4212
|
rb_define_const(c_domain, "REBOOT_INITCTL",
|
4585
4213
|
INT2NUM(VIR_DOMAIN_REBOOT_INITCTL));
|
4586
|
-
#endif
|
4587
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_SIGNAL
|
4588
4214
|
rb_define_const(c_domain, "REBOOT_SIGNAL",
|
4589
4215
|
INT2NUM(VIR_DOMAIN_REBOOT_SIGNAL));
|
4590
|
-
#endif
|
4591
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_PARAVIRT
|
4592
4216
|
rb_define_const(c_domain, "REBOOT_PARAVIRT",
|
4593
4217
|
INT2NUM(VIR_DOMAIN_REBOOT_PARAVIRT));
|
4594
|
-
#endif
|
4595
4218
|
rb_define_method(c_domain, "reboot", libvirt_domain_reboot, -1);
|
4596
|
-
|
4219
|
+
|
4597
4220
|
rb_define_const(c_domain, "DESTROY_DEFAULT",
|
4598
4221
|
INT2NUM(VIR_DOMAIN_DESTROY_DEFAULT));
|
4599
|
-
#endif
|
4600
|
-
#if HAVE_CONST_VIR_DOMAIN_DESTROY_GRACEFUL
|
4601
4222
|
rb_define_const(c_domain, "DESTROY_GRACEFUL",
|
4602
4223
|
INT2NUM(VIR_DOMAIN_DESTROY_GRACEFUL));
|
4603
|
-
#endif
|
4604
4224
|
rb_define_method(c_domain, "destroy", libvirt_domain_destroy, -1);
|
4605
4225
|
rb_define_method(c_domain, "suspend", libvirt_domain_suspend, 0);
|
4606
4226
|
rb_define_method(c_domain, "resume", libvirt_domain_resume, 0);
|
@@ -4620,10 +4240,8 @@ void ruby_libvirt_domain_init(void)
|
|
4620
4240
|
rb_define_method(c_domain, "memory=", libvirt_domain_memory_equal, 1);
|
4621
4241
|
rb_define_method(c_domain, "max_vcpus", libvirt_domain_max_vcpus, 0);
|
4622
4242
|
rb_define_method(c_domain, "vcpus=", libvirt_domain_vcpus_equal, 1);
|
4623
|
-
#if HAVE_VIRDOMAINSETVCPUSFLAGS
|
4624
4243
|
rb_define_method(c_domain, "vcpus_flags=", libvirt_domain_vcpus_flags_equal,
|
4625
4244
|
1);
|
4626
|
-
#endif
|
4627
4245
|
rb_define_method(c_domain, "pin_vcpu", libvirt_domain_pin_vcpu, -1);
|
4628
4246
|
rb_define_method(c_domain, "xml_desc", libvirt_domain_xml_desc, -1);
|
4629
4247
|
rb_define_method(c_domain, "undefine", libvirt_domain_undefine, -1);
|
@@ -4633,67 +4251,41 @@ void ruby_libvirt_domain_init(void)
|
|
4633
4251
|
rb_define_method(c_domain, "autostart=", libvirt_domain_autostart_equal, 1);
|
4634
4252
|
rb_define_method(c_domain, "free", libvirt_domain_free, 0);
|
4635
4253
|
|
4636
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_CURRENT
|
4637
4254
|
rb_define_const(c_domain, "DEVICE_MODIFY_CURRENT",
|
4638
4255
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_CURRENT));
|
4639
|
-
#endif
|
4640
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_LIVE
|
4641
4256
|
rb_define_const(c_domain, "DEVICE_MODIFY_LIVE",
|
4642
4257
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_LIVE));
|
4643
|
-
#endif
|
4644
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_CONFIG
|
4645
4258
|
rb_define_const(c_domain, "DEVICE_MODIFY_CONFIG",
|
4646
4259
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_CONFIG));
|
4647
|
-
#endif
|
4648
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_FORCE
|
4649
4260
|
rb_define_const(c_domain, "DEVICE_MODIFY_FORCE",
|
4650
4261
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_FORCE));
|
4651
|
-
|
4262
|
+
|
4652
4263
|
rb_define_method(c_domain, "attach_device", libvirt_domain_attach_device,
|
4653
4264
|
-1);
|
4654
4265
|
rb_define_method(c_domain, "detach_device", libvirt_domain_detach_device,
|
4655
4266
|
-1);
|
4656
|
-
#if HAVE_VIRDOMAINUPDATEDEVICEFLAGS
|
4657
4267
|
rb_define_method(c_domain, "update_device", libvirt_domain_update_device,
|
4658
4268
|
-1);
|
4659
|
-
#endif
|
4660
4269
|
|
4661
4270
|
rb_define_method(c_domain, "scheduler_type", libvirt_domain_scheduler_type,
|
4662
4271
|
0);
|
4663
4272
|
|
4664
|
-
#if HAVE_VIRDOMAINMANAGEDSAVE
|
4665
4273
|
rb_define_method(c_domain, "managed_save", libvirt_domain_managed_save, -1);
|
4666
4274
|
rb_define_method(c_domain, "has_managed_save?",
|
4667
4275
|
libvirt_domain_has_managed_save, -1);
|
4668
4276
|
rb_define_method(c_domain, "managed_save_remove",
|
4669
4277
|
libvirt_domain_managed_save_remove, -1);
|
4670
|
-
#endif
|
4671
|
-
#if HAVE_VIRDOMAINGETSECURITYLABEL
|
4672
4278
|
rb_define_method(c_domain, "security_label",
|
4673
4279
|
libvirt_domain_security_label, 0);
|
4674
|
-
#endif
|
4675
4280
|
rb_define_method(c_domain, "block_stats", libvirt_domain_block_stats, 1);
|
4676
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
4677
4281
|
rb_define_method(c_domain, "memory_stats", libvirt_domain_memory_stats, -1);
|
4678
|
-
#endif
|
4679
|
-
#if HAVE_VIRDOMAINBLOCKPEEK
|
4680
4282
|
rb_define_method(c_domain, "block_peek", libvirt_domain_block_peek, -1);
|
4681
|
-
#endif
|
4682
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
4683
4283
|
rb_define_method(c_domain, "blockinfo", libvirt_domain_block_info, -1);
|
4684
|
-
#endif
|
4685
|
-
#if HAVE_VIRDOMAINMEMORYPEEK
|
4686
4284
|
rb_define_method(c_domain, "memory_peek", libvirt_domain_memory_peek, -1);
|
4687
|
-
#endif
|
4688
4285
|
rb_define_method(c_domain, "vcpus", libvirt_domain_vcpus, 0);
|
4689
4286
|
rb_define_alias(c_domain, "get_vcpus", "vcpus");
|
4690
|
-
#if HAVE_VIRDOMAINISACTIVE
|
4691
4287
|
rb_define_method(c_domain, "active?", libvirt_domain_active_p, 0);
|
4692
|
-
#endif
|
4693
|
-
#if HAVE_VIRDOMAINISPERSISTENT
|
4694
4288
|
rb_define_method(c_domain, "persistent?", libvirt_domain_persistent_p, 0);
|
4695
|
-
#endif
|
4696
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
4697
4289
|
rb_define_method(c_domain, "snapshot_create_xml",
|
4698
4290
|
libvirt_domain_snapshot_create_xml, -1);
|
4699
4291
|
rb_define_method(c_domain, "num_of_snapshots",
|
@@ -4708,7 +4300,6 @@ void ruby_libvirt_domain_init(void)
|
|
4708
4300
|
libvirt_domain_revert_to_snapshot, -1);
|
4709
4301
|
rb_define_method(c_domain, "current_snapshot",
|
4710
4302
|
libvirt_domain_current_snapshot, -1);
|
4711
|
-
#endif
|
4712
4303
|
|
4713
4304
|
/*
|
4714
4305
|
* Class Libvirt::Domain::Info
|
@@ -4753,7 +4344,6 @@ void ruby_libvirt_domain_init(void)
|
|
4753
4344
|
rb_define_attr(c_domain_block_stats, "wr_bytes", 1, 0);
|
4754
4345
|
rb_define_attr(c_domain_block_stats, "errs", 1, 0);
|
4755
4346
|
|
4756
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKJOBINFOPTR
|
4757
4347
|
/*
|
4758
4348
|
* Class Libvirt::Domain::BlockJobInfo
|
4759
4349
|
*/
|
@@ -4763,9 +4353,7 @@ void ruby_libvirt_domain_init(void)
|
|
4763
4353
|
rb_define_attr(c_domain_block_job_info, "bandwidth", 1, 0);
|
4764
4354
|
rb_define_attr(c_domain_block_job_info, "cur", 1, 0);
|
4765
4355
|
rb_define_attr(c_domain_block_job_info, "end", 1, 0);
|
4766
|
-
#endif
|
4767
4356
|
|
4768
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
4769
4357
|
/*
|
4770
4358
|
* Class Libvirt::Domain::MemoryStats
|
4771
4359
|
*/
|
@@ -4786,17 +4374,11 @@ void ruby_libvirt_domain_init(void)
|
|
4786
4374
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_UNUSED));
|
4787
4375
|
rb_define_const(c_domain_memory_stats, "AVAILABLE",
|
4788
4376
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_AVAILABLE));
|
4789
|
-
#if HAVE_CONST_VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON
|
4790
4377
|
rb_define_const(c_domain_memory_stats, "ACTUAL_BALLOON",
|
4791
4378
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON));
|
4792
|
-
#endif
|
4793
|
-
#if HAVE_CONST_VIR_DOMAIN_MEMORY_STATE_RSS
|
4794
4379
|
rb_define_const(c_domain_memory_stats, "RSS",
|
4795
4380
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_RSS));
|
4796
|
-
#endif
|
4797
|
-
#endif
|
4798
4381
|
|
4799
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
4800
4382
|
/*
|
4801
4383
|
* Class Libvirt::Domain::BlockInfo
|
4802
4384
|
*/
|
@@ -4805,9 +4387,7 @@ void ruby_libvirt_domain_init(void)
|
|
4805
4387
|
rb_define_attr(c_domain_block_info, "capacity", 1, 0);
|
4806
4388
|
rb_define_attr(c_domain_block_info, "allocation", 1, 0);
|
4807
4389
|
rb_define_attr(c_domain_block_info, "physical", 1, 0);
|
4808
|
-
#endif
|
4809
4390
|
|
4810
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
4811
4391
|
/*
|
4812
4392
|
* Class Libvirt::Domain::Snapshot
|
4813
4393
|
*/
|
@@ -4820,20 +4400,13 @@ void ruby_libvirt_domain_init(void)
|
|
4820
4400
|
libvirt_domain_snapshot_delete, -1);
|
4821
4401
|
rb_define_method(c_domain_snapshot, "free", libvirt_domain_snapshot_free,
|
4822
4402
|
0);
|
4823
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY
|
4824
4403
|
rb_define_const(c_domain_snapshot, "DELETE_METADATA_ONLY",
|
4825
4404
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY));
|
4826
|
-
#endif
|
4827
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY
|
4828
4405
|
rb_define_const(c_domain_snapshot, "DELETE_CHILDREN_ONLY",
|
4829
4406
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY));
|
4830
|
-
#endif
|
4831
4407
|
|
4832
|
-
#endif
|
4833
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETNAME
|
4834
4408
|
rb_define_method(c_domain_snapshot, "name", libvirt_domain_snapshot_name,
|
4835
4409
|
0);
|
4836
|
-
#endif
|
4837
4410
|
|
4838
4411
|
/*
|
4839
4412
|
* Class Libvirt::Domain::VCPUInfo
|
@@ -4848,7 +4421,6 @@ void ruby_libvirt_domain_init(void)
|
|
4848
4421
|
rb_define_attr(c_domain_vcpuinfo, "cpu", 1, 0);
|
4849
4422
|
rb_define_attr(c_domain_vcpuinfo, "cpumap", 1, 0);
|
4850
4423
|
|
4851
|
-
#if HAVE_TYPE_VIRDOMAINJOBINFOPTR
|
4852
4424
|
/*
|
4853
4425
|
* Class Libvirt::Domain::JobInfo
|
4854
4426
|
*/
|
@@ -4879,27 +4451,17 @@ void ruby_libvirt_domain_init(void)
|
|
4879
4451
|
|
4880
4452
|
rb_define_method(c_domain, "job_info", libvirt_domain_job_info, 0);
|
4881
4453
|
rb_define_method(c_domain, "abort_job", libvirt_domain_abort_job, 0);
|
4882
|
-
#endif
|
4883
4454
|
|
4884
|
-
#if HAVE_VIRDOMAINQEMUMONITORCOMMAND
|
4885
4455
|
rb_define_method(c_domain, "qemu_monitor_command",
|
4886
4456
|
libvirt_domain_qemu_monitor_command, -1);
|
4887
|
-
#endif
|
4888
4457
|
|
4889
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
4890
4458
|
rb_define_method(c_domain, "num_vcpus", libvirt_domain_num_vcpus, 1);
|
4891
|
-
#endif
|
4892
4459
|
|
4893
|
-
#if HAVE_VIRDOMAINISUPDATED
|
4894
4460
|
rb_define_method(c_domain, "updated?", libvirt_domain_is_updated, 0);
|
4895
|
-
#endif
|
4896
4461
|
|
4897
|
-
#ifdef VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
|
4898
4462
|
rb_define_const(c_domain, "MEMORY_PARAM_UNLIMITED",
|
4899
4463
|
LL2NUM(VIR_DOMAIN_MEMORY_PARAM_UNLIMITED));
|
4900
|
-
#endif
|
4901
4464
|
|
4902
|
-
#if HAVE_VIRDOMAINSETMEMORYFLAGS
|
4903
4465
|
/* Ideally we would just have the "MEM_LIVE" constant. Unfortunately
|
4904
4466
|
* we screwed up long ago, and we have to leave "DOMAIN_MEM_LIVE" for
|
4905
4467
|
* backwards compatibility.
|
@@ -4913,8 +4475,7 @@ void ruby_libvirt_domain_init(void)
|
|
4913
4475
|
rb_define_const(c_domain, "MEM_CONFIG", INT2NUM(VIR_DOMAIN_MEM_CONFIG));
|
4914
4476
|
rb_define_const(c_domain, "DOMAIN_MEM_CONFIG",
|
4915
4477
|
INT2NUM(VIR_DOMAIN_MEM_CONFIG));
|
4916
|
-
|
4917
|
-
#if HAVE_CONST_VIR_DOMAIN_MEM_CURRENT
|
4478
|
+
|
4918
4479
|
/* Ideally we would just have the "MEM_CURRENT" constant. Unfortunately
|
4919
4480
|
* we screwed up long ago, and we have to leave "DOMAIN_MEM_CURRENT" for
|
4920
4481
|
* backwards compatibility.
|
@@ -4929,28 +4490,22 @@ void ruby_libvirt_domain_init(void)
|
|
4929
4490
|
rb_define_const(c_domain, "MEM_MAXIMUM", INT2NUM(VIR_DOMAIN_MEM_MAXIMUM));
|
4930
4491
|
rb_define_const(c_domain, "DOMAIN_MEM_MAXIMUM",
|
4931
4492
|
INT2NUM(VIR_DOMAIN_MEM_MAXIMUM));
|
4932
|
-
#endif
|
4933
4493
|
|
4934
4494
|
rb_define_method(c_domain, "scheduler_parameters",
|
4935
4495
|
libvirt_domain_scheduler_parameters, -1);
|
4936
4496
|
rb_define_method(c_domain, "scheduler_parameters=",
|
4937
4497
|
libvirt_domain_scheduler_parameters_equal, 1);
|
4938
4498
|
|
4939
|
-
#if HAVE_VIRDOMAINSETMEMORYPARAMETERS
|
4940
4499
|
rb_define_method(c_domain, "memory_parameters",
|
4941
4500
|
libvirt_domain_memory_parameters, -1);
|
4942
4501
|
rb_define_method(c_domain, "memory_parameters=",
|
4943
4502
|
libvirt_domain_memory_parameters_equal, 1);
|
4944
|
-
#endif
|
4945
4503
|
|
4946
|
-
#if HAVE_VIRDOMAINSETBLKIOPARAMETERS
|
4947
4504
|
rb_define_method(c_domain, "blkio_parameters",
|
4948
4505
|
libvirt_domain_blkio_parameters, -1);
|
4949
4506
|
rb_define_method(c_domain, "blkio_parameters=",
|
4950
4507
|
libvirt_domain_blkio_parameters_equal, 1);
|
4951
|
-
#endif
|
4952
4508
|
|
4953
|
-
#if HAVE_VIRDOMAINGETSTATE
|
4954
4509
|
/* Ideally we would just have the "RUNNING_UNKNOWN" constant. Unfortunately
|
4955
4510
|
* we screwed up long ago, and we have to leave "DOMAIN_RUNNING_UNKNOWN"
|
4956
4511
|
* for backwards compatibility.
|
@@ -5015,7 +4570,6 @@ void ruby_libvirt_domain_init(void)
|
|
5015
4570
|
INT2NUM(VIR_DOMAIN_RUNNING_SAVE_CANCELED));
|
5016
4571
|
rb_define_const(c_domain, "DOMAIN_RUNNING_SAVE_CANCELED",
|
5017
4572
|
INT2NUM(VIR_DOMAIN_RUNNING_SAVE_CANCELED));
|
5018
|
-
#if HAVE_CONST_VIR_DOMAIN_RUNNING_WAKEUP
|
5019
4573
|
/* Ideally we would just have the "RUNNING_WAKEUP" constant. Unfortunately
|
5020
4574
|
* we screwed up long ago, and we have to leave "DOMAIN_RUNNING_WAKEUP"
|
5021
4575
|
* for backwards compatibility.
|
@@ -5024,7 +4578,6 @@ void ruby_libvirt_domain_init(void)
|
|
5024
4578
|
INT2NUM(VIR_DOMAIN_RUNNING_WAKEUP));
|
5025
4579
|
rb_define_const(c_domain, "DOMAIN_RUNNING_WAKEUP",
|
5026
4580
|
INT2NUM(VIR_DOMAIN_RUNNING_WAKEUP));
|
5027
|
-
#endif
|
5028
4581
|
/* Ideally we would just have the "BLOCKED_UNKNOWN" constant. Unfortunately
|
5029
4582
|
* we screwed up long ago, and we have to leave "DOMAIN_BLOCKED_UNKNOWN"
|
5030
4583
|
* for backwards compatibility.
|
@@ -5097,7 +4650,6 @@ void ruby_libvirt_domain_init(void)
|
|
5097
4650
|
INT2NUM(VIR_DOMAIN_PAUSED_FROM_SNAPSHOT));
|
5098
4651
|
rb_define_const(c_domain, "DOMAIN_PAUSED_FROM_SNAPSHOT",
|
5099
4652
|
INT2NUM(VIR_DOMAIN_PAUSED_FROM_SNAPSHOT));
|
5100
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_SHUTTING_DOWN
|
5101
4653
|
/* Ideally we would just have the "PAUSED_SHUTTING_DOWN" constant.
|
5102
4654
|
* Unfortunately we screwed up long ago, and we have to leave
|
5103
4655
|
* "DOMAIN_PAUSED_SHUTTING_DOWN" for backwards compatibility.
|
@@ -5106,8 +4658,6 @@ void ruby_libvirt_domain_init(void)
|
|
5106
4658
|
INT2NUM(VIR_DOMAIN_PAUSED_SHUTTING_DOWN));
|
5107
4659
|
rb_define_const(c_domain, "DOMAIN_PAUSED_SHUTTING_DOWN",
|
5108
4660
|
INT2NUM(VIR_DOMAIN_PAUSED_SHUTTING_DOWN));
|
5109
|
-
#endif
|
5110
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_SNAPSHOT
|
5111
4661
|
/* Ideally we would just have the "PAUSED_SNAPSHOT" constant. Unfortunately
|
5112
4662
|
* we screwed up long ago, and we have to leave "DOMAIN_PAUSED_SNAPSHOT"
|
5113
4663
|
* for backwards compatibility.
|
@@ -5116,7 +4666,6 @@ void ruby_libvirt_domain_init(void)
|
|
5116
4666
|
INT2NUM(VIR_DOMAIN_PAUSED_SNAPSHOT));
|
5117
4667
|
rb_define_const(c_domain, "DOMAIN_PAUSED_SNAPSHOT",
|
5118
4668
|
INT2NUM(VIR_DOMAIN_PAUSED_SNAPSHOT));
|
5119
|
-
#endif
|
5120
4669
|
/* Ideally we would just have the "SHUTDOWN_UNKNOWN" constant.
|
5121
4670
|
* Unfortunately we screwed up long ago, and we have to leave
|
5122
4671
|
* "DOMAIN_SHUTDOWN_UNKNOWN" for backwards compatibility.
|
@@ -5205,7 +4754,6 @@ void ruby_libvirt_domain_init(void)
|
|
5205
4754
|
INT2NUM(VIR_DOMAIN_CRASHED_UNKNOWN));
|
5206
4755
|
rb_define_const(c_domain, "DOMAIN_CRASHED_UNKNOWN",
|
5207
4756
|
INT2NUM(VIR_DOMAIN_CRASHED_UNKNOWN));
|
5208
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED_UNKNOWN
|
5209
4757
|
/* Ideally we would just have the "PMSUSPENDED_UNKNOWN" constant.
|
5210
4758
|
* Unfortunately we screwed up long ago, and we have to leave
|
5211
4759
|
* "DOMAIN_PMSUSPENDED_UNKNOWN" for backwards compatibility.
|
@@ -5214,8 +4762,6 @@ void ruby_libvirt_domain_init(void)
|
|
5214
4762
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_UNKNOWN));
|
5215
4763
|
rb_define_const(c_domain, "DOMAIN_PMSUSPENDED_UNKNOWN",
|
5216
4764
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_UNKNOWN));
|
5217
|
-
#endif
|
5218
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN
|
5219
4765
|
/* Ideally we would just have the "PMSUSPENDED_DISK_UNKNOWN" constant.
|
5220
4766
|
* Unfortunately we screwed up long ago, and we have to leave
|
5221
4767
|
* "DOMAIN_PMSUSPENDED_DISK_UNKNOWN" for backwards compatibility.
|
@@ -5224,28 +4770,17 @@ void ruby_libvirt_domain_init(void)
|
|
5224
4770
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN));
|
5225
4771
|
rb_define_const(c_domain, "DOMAIN_PMSUSPENDED_DISK_UNKNOWN",
|
5226
4772
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN));
|
5227
|
-
#endif
|
5228
|
-
#if HAVE_CONST_VIR_DOMAIN_RUNNING_CRASHED
|
5229
4773
|
rb_define_const(c_domain, "RUNNING_CRASHED",
|
5230
4774
|
INT2NUM(VIR_DOMAIN_RUNNING_CRASHED));
|
5231
|
-
#endif
|
5232
|
-
#if HAVE_CONST_VIR_DOMAIN_NOSTATE_UNKNOWN
|
5233
4775
|
rb_define_const(c_domain, "NOSTATE_UNKNOWN",
|
5234
4776
|
INT2NUM(VIR_DOMAIN_NOSTATE_UNKNOWN));
|
5235
|
-
#endif
|
5236
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_CRASHED
|
5237
4777
|
rb_define_const(c_domain, "PAUSED_CRASHED",
|
5238
4778
|
INT2NUM(VIR_DOMAIN_PAUSED_CRASHED));
|
5239
|
-
#endif
|
5240
|
-
#if HAVE_CONST_VIR_DOMAIN_CRASHED_PANICKED
|
5241
4779
|
rb_define_const(c_domain, "CRASHED_PANICKED",
|
5242
4780
|
INT2NUM(VIR_DOMAIN_CRASHED_PANICKED));
|
5243
|
-
#endif
|
5244
4781
|
|
5245
4782
|
rb_define_method(c_domain, "state", libvirt_domain_state, -1);
|
5246
|
-
#endif
|
5247
4783
|
|
5248
|
-
#if HAVE_CONST_VIR_DOMAIN_AFFECT_CURRENT
|
5249
4784
|
/* Ideally we would just have the "AFFECT_CURRENT" constant. Unfortunately
|
5250
4785
|
* we screwed up long ago, and we have to leave "DOMAIN_AFFECT_CURRENT" for
|
5251
4786
|
* backwards compatibility.
|
@@ -5270,29 +4805,17 @@ void ruby_libvirt_domain_init(void)
|
|
5270
4805
|
INT2NUM(VIR_DOMAIN_AFFECT_CONFIG));
|
5271
4806
|
rb_define_const(c_domain, "DOMAIN_AFFECT_CONFIG",
|
5272
4807
|
INT2NUM(VIR_DOMAIN_AFFECT_CONFIG));
|
5273
|
-
#endif
|
5274
4808
|
|
5275
|
-
#if HAVE_CONST_VIR_DOMAIN_CONSOLE_FORCE
|
5276
4809
|
rb_define_const(c_domain, "CONSOLE_FORCE",
|
5277
4810
|
INT2NUM(VIR_DOMAIN_CONSOLE_FORCE));
|
5278
|
-
#endif
|
5279
|
-
#if HAVE_CONST_VIR_DOMAIN_CONSOLE_SAFE
|
5280
4811
|
rb_define_const(c_domain, "CONSOLE_SAFE", INT2NUM(VIR_DOMAIN_CONSOLE_SAFE));
|
5281
|
-
#endif
|
5282
4812
|
|
5283
|
-
#if HAVE_VIRDOMAINOPENCONSOLE
|
5284
4813
|
rb_define_method(c_domain, "open_console", libvirt_domain_open_console, -1);
|
5285
|
-
#endif
|
5286
4814
|
|
5287
|
-
#if HAVE_VIRDOMAINSCREENSHOT
|
5288
4815
|
rb_define_method(c_domain, "screenshot", libvirt_domain_screenshot, -1);
|
5289
|
-
#endif
|
5290
4816
|
|
5291
|
-
#if HAVE_VIRDOMAININJECTNMI
|
5292
4817
|
rb_define_method(c_domain, "inject_nmi", libvirt_domain_inject_nmi, -1);
|
5293
|
-
#endif
|
5294
4818
|
|
5295
|
-
#if HAVE_VIRDOMAINGETCONTROLINFO
|
5296
4819
|
/*
|
5297
4820
|
* Class Libvirt::Domain::ControlInfo
|
5298
4821
|
*/
|
@@ -5312,22 +4835,12 @@ void ruby_libvirt_domain_init(void)
|
|
5312
4835
|
INT2NUM(VIR_DOMAIN_CONTROL_ERROR));
|
5313
4836
|
|
5314
4837
|
rb_define_method(c_domain, "control_info", libvirt_domain_control_info, -1);
|
5315
|
-
#endif
|
5316
4838
|
|
5317
|
-
#if HAVE_VIRDOMAINMIGRATEGETMAXSPEED
|
5318
4839
|
rb_define_method(c_domain, "migrate_max_speed",
|
5319
4840
|
libvirt_domain_migrate_max_speed, -1);
|
5320
|
-
#endif
|
5321
|
-
#if HAVE_VIRDOMAINSENDKEY
|
5322
4841
|
rb_define_method(c_domain, "send_key", libvirt_domain_send_key, 3);
|
5323
|
-
#endif
|
5324
|
-
#if HAVE_VIRDOMAINRESET
|
5325
4842
|
rb_define_method(c_domain, "reset", libvirt_domain_reset, -1);
|
5326
|
-
#endif
|
5327
|
-
#if HAVE_VIRDOMAINGETHOSTNAME
|
5328
4843
|
rb_define_method(c_domain, "hostname", libvirt_domain_hostname, -1);
|
5329
|
-
#endif
|
5330
|
-
#if HAVE_VIRDOMAINGETMETADATA
|
5331
4844
|
rb_define_const(c_domain, "METADATA_DESCRIPTION",
|
5332
4845
|
INT2NUM(VIR_DOMAIN_METADATA_DESCRIPTION));
|
5333
4846
|
rb_define_const(c_domain, "METADATA_TITLE",
|
@@ -5335,11 +4848,7 @@ void ruby_libvirt_domain_init(void)
|
|
5335
4848
|
rb_define_const(c_domain, "METADATA_ELEMENT",
|
5336
4849
|
INT2NUM(VIR_DOMAIN_METADATA_ELEMENT));
|
5337
4850
|
rb_define_method(c_domain, "metadata", libvirt_domain_metadata, -1);
|
5338
|
-
#endif
|
5339
|
-
#if HAVE_VIRDOMAINSETMETADATA
|
5340
4851
|
rb_define_method(c_domain, "metadata=", libvirt_domain_metadata_equal, 1);
|
5341
|
-
#endif
|
5342
|
-
#if HAVE_VIRDOMAINSENDPROCESSSIGNAL
|
5343
4852
|
rb_define_const(c_domain, "PROCESS_SIGNAL_NOP",
|
5344
4853
|
INT2NUM(VIR_DOMAIN_PROCESS_SIGNAL_NOP));
|
5345
4854
|
rb_define_const(c_domain, "PROCESS_SIGNAL_HUP",
|
@@ -5472,8 +4981,6 @@ void ruby_libvirt_domain_init(void)
|
|
5472
4981
|
INT2NUM(VIR_DOMAIN_PROCESS_SIGNAL_RT32));
|
5473
4982
|
rb_define_method(c_domain, "send_process_signal",
|
5474
4983
|
libvirt_domain_send_process_signal, -1);
|
5475
|
-
#endif
|
5476
|
-
#if HAVE_VIRDOMAINLISTALLSNAPSHOTS
|
5477
4984
|
rb_define_const(c_domain_snapshot, "LIST_ROOTS",
|
5478
4985
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS));
|
5479
4986
|
rb_define_const(c_domain_snapshot, "LIST_DESCENDANTS",
|
@@ -5486,7 +4993,6 @@ void ruby_libvirt_domain_init(void)
|
|
5486
4993
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_METADATA));
|
5487
4994
|
rb_define_const(c_domain_snapshot, "LIST_NO_METADATA",
|
5488
4995
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA));
|
5489
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE
|
5490
4996
|
rb_define_const(c_domain_snapshot, "LIST_INACTIVE",
|
5491
4997
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE));
|
5492
4998
|
rb_define_const(c_domain_snapshot, "LIST_ACTIVE",
|
@@ -5497,11 +5003,9 @@ void ruby_libvirt_domain_init(void)
|
|
5497
5003
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL));
|
5498
5004
|
rb_define_const(c_domain_snapshot, "LIST_EXTERNAL",
|
5499
5005
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL));
|
5500
|
-
#endif
|
5501
5006
|
rb_define_method(c_domain, "list_all_snapshots",
|
5502
5007
|
libvirt_domain_list_all_snapshots, -1);
|
5503
|
-
|
5504
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE
|
5008
|
+
|
5505
5009
|
rb_define_const(c_domain_snapshot, "CREATE_REDEFINE",
|
5506
5010
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE));
|
5507
5011
|
rb_define_const(c_domain_snapshot, "CREATE_CURRENT",
|
@@ -5512,125 +5016,64 @@ void ruby_libvirt_domain_init(void)
|
|
5512
5016
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_HALT));
|
5513
5017
|
rb_define_const(c_domain_snapshot, "CREATE_DISK_ONLY",
|
5514
5018
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY));
|
5515
|
-
#endif
|
5516
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT
|
5517
5019
|
rb_define_const(c_domain_snapshot, "CREATE_REUSE_EXT",
|
5518
5020
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT));
|
5519
|
-
#endif
|
5520
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
|
5521
5021
|
rb_define_const(c_domain_snapshot, "CREATE_QUIESCE",
|
5522
5022
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE));
|
5523
|
-
#endif
|
5524
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC
|
5525
5023
|
rb_define_const(c_domain_snapshot, "CREATE_ATOMIC",
|
5526
5024
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC));
|
5527
|
-
#endif
|
5528
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_LIVE
|
5529
5025
|
rb_define_const(c_domain_snapshot, "CREATE_LIVE",
|
5530
5026
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_LIVE));
|
5531
|
-
#endif
|
5532
|
-
#if HAVE_VIRDOMAINSNAPSHOTNUMCHILDREN
|
5533
5027
|
rb_define_method(c_domain_snapshot, "num_children",
|
5534
5028
|
libvirt_domain_snapshot_num_children, -1);
|
5535
|
-
#endif
|
5536
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTCHILDRENNAMES
|
5537
5029
|
rb_define_method(c_domain_snapshot, "list_children_names",
|
5538
5030
|
libvirt_domain_snapshot_list_children_names, -1);
|
5539
|
-
#endif
|
5540
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTALLCHILDREN
|
5541
5031
|
rb_define_method(c_domain_snapshot, "list_all_children",
|
5542
5032
|
libvirt_domain_snapshot_list_all_children, -1);
|
5543
|
-
#endif
|
5544
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETPARENT
|
5545
5033
|
rb_define_method(c_domain_snapshot, "parent",
|
5546
5034
|
libvirt_domain_snapshot_parent, -1);
|
5547
|
-
#endif
|
5548
|
-
#if HAVE_VIRDOMAINSNAPSHOTISCURRENT
|
5549
5035
|
rb_define_method(c_domain_snapshot, "current?",
|
5550
5036
|
libvirt_domain_snapshot_current_p, -1);
|
5551
|
-
#endif
|
5552
|
-
#if HAVE_VIRDOMAINSNAPSHOTHASMETADATA
|
5553
5037
|
rb_define_method(c_domain_snapshot, "has_metadata?",
|
5554
5038
|
libvirt_domain_snapshot_has_metadata_p, -1);
|
5555
|
-
#endif
|
5556
|
-
#if HAVE_VIRDOMAINSETMEMORYSTATSPERIOD
|
5557
5039
|
rb_define_method(c_domain, "memory_stats_period=",
|
5558
5040
|
libvirt_domain_memory_stats_period, 1);
|
5559
|
-
#endif
|
5560
|
-
#if HAVE_VIRDOMAINFSTRIM
|
5561
5041
|
rb_define_method(c_domain, "fstrim", libvirt_domain_fstrim, -1);
|
5562
|
-
#endif
|
5563
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_SHALLOW
|
5564
5042
|
rb_define_const(c_domain, "BLOCK_REBASE_SHALLOW",
|
5565
5043
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_SHALLOW));
|
5566
|
-
#endif
|
5567
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
|
5568
5044
|
rb_define_const(c_domain, "BLOCK_REBASE_REUSE_EXT",
|
5569
5045
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT));
|
5570
|
-
#endif
|
5571
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_COPY_RAW
|
5572
5046
|
rb_define_const(c_domain, "BLOCK_REBASE_COPY_RAW",
|
5573
5047
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_COPY_RAW));
|
5574
|
-
#endif
|
5575
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_COPY
|
5576
5048
|
rb_define_const(c_domain, "BLOCK_REBASE_COPY",
|
5577
5049
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_COPY));
|
5578
|
-
|
5579
|
-
#if HAVE_VIRDOMAINBLOCKREBASE
|
5050
|
+
|
5580
5051
|
rb_define_method(c_domain, "block_rebase", libvirt_domain_block_rebase, -1);
|
5581
|
-
#endif
|
5582
|
-
#if HAVE_CONST_VIR_DOMAIN_CHANNEL_FORCE
|
5583
5052
|
rb_define_const(c_domain, "CHANNEL_FORCE",
|
5584
5053
|
INT2NUM(VIR_DOMAIN_CHANNEL_FORCE));
|
5585
|
-
#endif
|
5586
|
-
#if HAVE_VIRDOMAINOPENCHANNEL
|
5587
5054
|
rb_define_method(c_domain, "open_channel", libvirt_domain_open_channel, -1);
|
5588
|
-
#endif
|
5589
|
-
#if HAVE_VIRDOMAINCREATEWITHFILES
|
5590
5055
|
rb_define_method(c_domain, "create_with_files",
|
5591
5056
|
libvirt_domain_create_with_files, -1);
|
5592
|
-
#endif
|
5593
|
-
#if HAVE_VIRDOMAINOPENGRAPHICS
|
5594
5057
|
rb_define_const(c_domain, "OPEN_GRAPHICS_SKIPAUTH",
|
5595
5058
|
INT2NUM(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH));
|
5596
5059
|
rb_define_method(c_domain, "open_graphics",
|
5597
5060
|
libvirt_domain_open_graphics, -1);
|
5598
|
-
#endif
|
5599
|
-
#if HAVE_VIRDOMAINPMWAKEUP
|
5600
5061
|
rb_define_method(c_domain, "pmwakeup", libvirt_domain_pmwakeup, -1);
|
5601
|
-
#endif
|
5602
|
-
#if HAVE_VIRDOMAINBLOCKRESIZE
|
5603
5062
|
rb_define_method(c_domain, "block_resize", libvirt_domain_block_resize, -1);
|
5604
|
-
#endif
|
5605
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_RESIZE_BYTES
|
5606
5063
|
rb_define_const(c_domain, "BLOCK_RESIZE_BYTES",
|
5607
5064
|
INT2NUM(VIR_DOMAIN_BLOCK_RESIZE_BYTES));
|
5608
|
-
#endif
|
5609
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING
|
5610
5065
|
rb_define_const(c_domain_snapshot, "REVERT_RUNNING",
|
5611
5066
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING));
|
5612
|
-
#endif
|
5613
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED
|
5614
5067
|
rb_define_const(c_domain_snapshot, "REVERT_PAUSED",
|
5615
5068
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED));
|
5616
|
-
#endif
|
5617
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_FORCE
|
5618
5069
|
rb_define_const(c_domain_snapshot, "REVERT_FORCE",
|
5619
5070
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_FORCE));
|
5620
|
-
#endif
|
5621
|
-
#if HAVE_VIRDOMAINPMSUSPENDFORDURATION
|
5622
5071
|
rb_define_method(c_domain, "pmsuspend_for_duration",
|
5623
5072
|
libvirt_domain_pmsuspend_for_duration, -1);
|
5624
|
-
#endif
|
5625
|
-
#if HAVE_VIRDOMAINMIGRATEGETCOMPRESSIONCACHE
|
5626
5073
|
rb_define_method(c_domain, "migrate_compression_cache",
|
5627
5074
|
libvirt_domain_migrate_compression_cache, -1);
|
5628
|
-
#endif
|
5629
|
-
#if HAVE_VIRDOMAINMIGRATESETCOMPRESSIONCACHE
|
5630
5075
|
rb_define_method(c_domain, "migrate_compression_cache=",
|
5631
5076
|
libvirt_domain_migrate_compression_cache_equal, 1);
|
5632
|
-
#endif
|
5633
|
-
#if HAVE_VIRDOMAINGETDISKERRORS
|
5634
5077
|
rb_define_const(c_domain, "DISK_ERROR_NONE",
|
5635
5078
|
INT2NUM(VIR_DOMAIN_DISK_ERROR_NONE));
|
5636
5079
|
rb_define_const(c_domain, "DISK_ERROR_UNSPEC",
|
@@ -5638,266 +5081,132 @@ void ruby_libvirt_domain_init(void)
|
|
5638
5081
|
rb_define_const(c_domain, "DISK_ERROR_NO_SPACE",
|
5639
5082
|
INT2NUM(VIR_DOMAIN_DISK_ERROR_NO_SPACE));
|
5640
5083
|
rb_define_method(c_domain, "disk_errors", libvirt_domain_disk_errors, -1);
|
5641
|
-
#endif
|
5642
|
-
#if HAVE_VIRDOMAINGETEMULATORPININFO
|
5643
5084
|
rb_define_method(c_domain, "emulator_pin_info",
|
5644
5085
|
libvirt_domain_emulator_pin_info, -1);
|
5645
|
-
#endif
|
5646
|
-
#if HAVE_VIRDOMAINPINEMULATOR
|
5647
5086
|
rb_define_method(c_domain, "pin_emulator", libvirt_domain_pin_emulator, -1);
|
5648
|
-
#endif
|
5649
|
-
#if HAVE_VIRDOMAINGETSECURITYLABELLIST
|
5650
5087
|
rb_define_method(c_domain, "security_label_list",
|
5651
5088
|
libvirt_domain_security_label_list, 0);
|
5652
|
-
#endif
|
5653
5089
|
|
5654
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_LINUX
|
5655
5090
|
rb_define_const(c_domain, "KEYCODE_SET_LINUX",
|
5656
5091
|
INT2NUM(VIR_KEYCODE_SET_LINUX));
|
5657
|
-
#endif
|
5658
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_XT
|
5659
5092
|
rb_define_const(c_domain, "KEYCODE_SET_XT",
|
5660
5093
|
INT2NUM(VIR_KEYCODE_SET_XT));
|
5661
|
-
#endif
|
5662
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET1
|
5663
5094
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET1",
|
5664
5095
|
INT2NUM(VIR_KEYCODE_SET_ATSET1));
|
5665
|
-
#endif
|
5666
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET2
|
5667
5096
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET2",
|
5668
5097
|
INT2NUM(VIR_KEYCODE_SET_ATSET2));
|
5669
|
-
#endif
|
5670
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET3
|
5671
5098
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET3",
|
5672
5099
|
INT2NUM(VIR_KEYCODE_SET_ATSET3));
|
5673
|
-
#endif
|
5674
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_OSX
|
5675
5100
|
rb_define_const(c_domain, "KEYCODE_SET_OSX",
|
5676
5101
|
INT2NUM(VIR_KEYCODE_SET_OSX));
|
5677
|
-
#endif
|
5678
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_XT_KBD
|
5679
5102
|
rb_define_const(c_domain, "KEYCODE_SET_XT_KBD",
|
5680
5103
|
INT2NUM(VIR_KEYCODE_SET_XT_KBD));
|
5681
|
-
#endif
|
5682
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_USB
|
5683
5104
|
rb_define_const(c_domain, "KEYCODE_SET_USB",
|
5684
5105
|
INT2NUM(VIR_KEYCODE_SET_USB));
|
5685
|
-
#endif
|
5686
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_WIN32
|
5687
5106
|
rb_define_const(c_domain, "KEYCODE_SET_WIN32",
|
5688
5107
|
INT2NUM(VIR_KEYCODE_SET_WIN32));
|
5689
|
-
#endif
|
5690
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_RFB
|
5691
5108
|
rb_define_const(c_domain, "KEYCODE_SET_RFB", INT2NUM(VIR_KEYCODE_SET_RFB));
|
5692
|
-
|
5693
|
-
#if HAVE_VIRDOMAINGETJOBSTATS
|
5109
|
+
|
5694
5110
|
rb_define_method(c_domain, "job_stats", libvirt_domain_job_stats, -1);
|
5695
|
-
#endif
|
5696
|
-
#if HAVE_VIRDOMAINGETBLOCKIOTUNE
|
5697
5111
|
rb_define_method(c_domain, "block_iotune",
|
5698
5112
|
libvirt_domain_block_iotune, -1);
|
5699
|
-
#endif
|
5700
|
-
#if HAVE_VIRDOMAINSETBLOCKIOTUNE
|
5701
5113
|
rb_define_method(c_domain, "block_iotune=",
|
5702
5114
|
libvirt_domain_block_iotune_equal, 1);
|
5703
|
-
#endif
|
5704
|
-
#if HAVE_VIRDOMAINBLOCKCOMMIT
|
5705
5115
|
rb_define_method(c_domain, "block_commit", libvirt_domain_block_commit, -1);
|
5706
|
-
#endif
|
5707
|
-
#if HAVE_VIRDOMAINBLOCKPULL
|
5708
5116
|
rb_define_method(c_domain, "block_pull", libvirt_domain_block_pull, -1);
|
5709
|
-
#endif
|
5710
|
-
#if HAVE_VIRDOMAINBLOCKJOBSETSPEED
|
5711
5117
|
rb_define_method(c_domain, "block_job_speed=",
|
5712
5118
|
libvirt_domain_block_job_speed_equal, 1);
|
5713
|
-
#endif
|
5714
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES
|
5715
5119
|
rb_define_const(c_domain, "BLOCK_JOB_SPEED_BANDWIDTH_BYTES",
|
5716
5120
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES));
|
5717
|
-
#endif
|
5718
|
-
#if HAVE_VIRDOMAINGETBLOCKJOBINFO
|
5719
5121
|
rb_define_method(c_domain, "block_job_info", libvirt_domain_block_job_info,
|
5720
5122
|
-1);
|
5721
|
-
#endif
|
5722
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES
|
5723
5123
|
rb_define_const(c_domain, "BLOCK_JOB_INFO_BANDWIDTH_BYTES",
|
5724
5124
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES));
|
5725
|
-
#endif
|
5726
5125
|
|
5727
|
-
#if HAVE_VIRDOMAINBLOCKJOBABORT
|
5728
5126
|
rb_define_method(c_domain, "block_job_abort",
|
5729
5127
|
libvirt_domain_block_job_abort, -1);
|
5730
|
-
#endif
|
5731
|
-
#if HAVE_VIRDOMAINGETINTERFACEPARAMETERS
|
5732
5128
|
rb_define_method(c_domain, "interface_parameters",
|
5733
5129
|
libvirt_domain_interface_parameters, -1);
|
5734
5130
|
rb_define_method(c_domain, "interface_parameters=",
|
5735
5131
|
libvirt_domain_interface_parameters_equal, 1);
|
5736
|
-
#endif
|
5737
|
-
#if HAVE_VIRDOMAINBLOCKSTATSFLAGS
|
5738
5132
|
rb_define_method(c_domain, "block_stats_flags",
|
5739
5133
|
libvirt_domain_block_stats_flags, -1);
|
5740
|
-
#endif
|
5741
|
-
#if HAVE_VIRDOMAINGETNUMAPARAMETERS
|
5742
5134
|
rb_define_method(c_domain, "numa_parameters",
|
5743
5135
|
libvirt_domain_numa_parameters, -1);
|
5744
5136
|
rb_define_method(c_domain, "numa_parameters=",
|
5745
5137
|
libvirt_domain_numa_parameters_equal, 1);
|
5746
|
-
#endif
|
5747
|
-
#if HAVE_VIRDOMAINLXCOPENNAMESPACE
|
5748
5138
|
rb_define_method(c_domain, "lxc_open_namespace",
|
5749
5139
|
libvirt_domain_lxc_open_namespace, -1);
|
5750
|
-
#endif
|
5751
|
-
#if HAVE_VIRDOMAINQEMUAGENTCOMMAND
|
5752
5140
|
rb_define_method(c_domain, "qemu_agent_command",
|
5753
5141
|
libvirt_domain_qemu_agent_command, -1);
|
5754
|
-
#endif
|
5755
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK
|
5756
5142
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_BLOCK",
|
5757
5143
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK));
|
5758
|
-
#endif
|
5759
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT
|
5760
5144
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_DEFAULT",
|
5761
5145
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT));
|
5762
|
-
#endif
|
5763
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT
|
5764
5146
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_NOWAIT",
|
5765
5147
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
|
5766
|
-
#endif
|
5767
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN
|
5768
5148
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_SHUTDOWN",
|
5769
5149
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN));
|
5770
|
-
#endif
|
5771
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT
|
5772
5150
|
rb_define_const(c_domain, "QEMU_MONITOR_COMMAND_DEFAULT",
|
5773
5151
|
INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
|
5774
|
-
#endif
|
5775
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP
|
5776
5152
|
rb_define_const(c_domain, "QEMU_MONITOR_COMMAND_HMP",
|
5777
5153
|
INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP));
|
5778
|
-
#endif
|
5779
|
-
#if HAVE_VIRDOMAINLXCENTERNAMESPACE
|
5780
5154
|
rb_define_method(c_domain, "lxc_enter_namespace",
|
5781
5155
|
libvirt_domain_lxc_enter_namespace, -1);
|
5782
|
-
#endif
|
5783
|
-
#if HAVE_VIRDOMAINMIGRATE3
|
5784
5156
|
rb_define_method(c_domain, "migrate3", libvirt_domain_migrate3, -1);
|
5785
5157
|
rb_define_method(c_domain, "migrate_to_uri3",
|
5786
5158
|
libvirt_domain_migrate_to_uri3, -1);
|
5787
|
-
#endif
|
5788
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_SHALLOW
|
5789
5159
|
rb_define_const(c_domain, "BLOCK_COMMIT_SHALLOW",
|
5790
5160
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW));
|
5791
|
-
#endif
|
5792
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_DELETE
|
5793
5161
|
rb_define_const(c_domain, "BLOCK_COMMIT_DELETE",
|
5794
5162
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_DELETE));
|
5795
|
-
#endif
|
5796
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_ACTIVE
|
5797
5163
|
rb_define_const(c_domain, "BLOCK_COMMIT_ACTIVE",
|
5798
5164
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_ACTIVE));
|
5799
|
-
#endif
|
5800
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
|
5801
5165
|
rb_define_const(c_domain, "BLOCK_COMMIT_RELATIVE",
|
5802
5166
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_RELATIVE));
|
5803
|
-
#endif
|
5804
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES
|
5805
5167
|
rb_define_const(c_domain, "BLOCK_COMMIT_BANDWIDTH_BYTES",
|
5806
5168
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES));
|
5807
|
-
#endif
|
5808
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN
|
5809
5169
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_UNKNOWN",
|
5810
5170
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN));
|
5811
|
-
#endif
|
5812
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_PULL
|
5813
5171
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_PULL",
|
5814
5172
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_PULL));
|
5815
|
-
#endif
|
5816
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_COPY
|
5817
5173
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_COPY",
|
5818
5174
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_COPY));
|
5819
|
-
#endif
|
5820
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT
|
5821
5175
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_COMMIT",
|
5822
5176
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT));
|
5823
|
-
#endif
|
5824
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT
|
5825
5177
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_ACTIVE_COMMIT",
|
5826
5178
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT));
|
5827
|
-
#endif
|
5828
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC
|
5829
5179
|
rb_define_const(c_domain, "BLOCK_JOB_ABORT_ASYNC",
|
5830
5180
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC));
|
5831
|
-
#endif
|
5832
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT
|
5833
5181
|
rb_define_const(c_domain, "BLOCK_JOB_ABORT_PIVOT",
|
5834
5182
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT));
|
5835
|
-
#endif
|
5836
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_COMPLETED
|
5837
5183
|
rb_define_const(c_domain, "BLOCK_JOB_COMPLETED",
|
5838
5184
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_COMPLETED));
|
5839
|
-
#endif
|
5840
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_FAILED
|
5841
5185
|
rb_define_const(c_domain, "BLOCK_JOB_FAILED",
|
5842
5186
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_FAILED));
|
5843
|
-
#endif
|
5844
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_CANCELED
|
5845
5187
|
rb_define_const(c_domain, "BLOCK_JOB_CANCELED",
|
5846
5188
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_CANCELED));
|
5847
|
-
#endif
|
5848
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_READY
|
5849
5189
|
rb_define_const(c_domain, "BLOCK_JOB_READY",
|
5850
5190
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_READY));
|
5851
|
-
#endif
|
5852
|
-
#if HAVE_VIRDOMAINGETCPUSTATS
|
5853
5191
|
rb_define_method(c_domain, "cpu_stats", libvirt_domain_cpu_stats, -1);
|
5854
|
-
#endif
|
5855
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_RAW
|
5856
5192
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_RAW",
|
5857
5193
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_RAW));
|
5858
|
-
#endif
|
5859
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB
|
5860
5194
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_ZLIB",
|
5861
5195
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB));
|
5862
|
-
#endif
|
5863
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO
|
5864
5196
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_LZO",
|
5865
5197
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO));
|
5866
|
-
#endif
|
5867
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY
|
5868
5198
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_SNAPPY",
|
5869
5199
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY));
|
5870
|
-
#endif
|
5871
|
-
#if HAVE_VIRDOMAINGETTIME
|
5872
5200
|
rb_define_method(c_domain, "time", libvirt_domain_get_time, -1);
|
5873
|
-
#endif
|
5874
|
-
#if HAVE_VIRDOMAINSETTIME
|
5875
5201
|
rb_define_method(c_domain, "time=", libvirt_domain_time_equal, 1);
|
5876
|
-
#endif
|
5877
|
-
#if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
|
5878
5202
|
rb_define_method(c_domain, "core_dump_with_format",
|
5879
5203
|
libvirt_domain_core_dump_with_format, -1);
|
5880
|
-
#endif
|
5881
|
-
#if HAVE_VIRDOMAINFSFREEZE
|
5882
5204
|
rb_define_method(c_domain, "fs_freeze", libvirt_domain_fs_freeze, -1);
|
5883
|
-
#endif
|
5884
|
-
#if HAVE_VIRDOMAINFSTHAW
|
5885
5205
|
rb_define_method(c_domain, "fs_thaw", libvirt_domain_fs_thaw, -1);
|
5886
|
-
#endif
|
5887
|
-
#if HAVE_VIRDOMAINGETFSINFO
|
5888
5206
|
rb_define_method(c_domain, "fs_info", libvirt_domain_fs_info, -1);
|
5889
|
-
#endif
|
5890
|
-
#if HAVE_VIRDOMAINRENAME
|
5891
5207
|
rb_define_method(c_domain, "rename", libvirt_domain_rename, -1);
|
5892
|
-
#endif
|
5893
|
-
#if HAVE_VIRDOMAINSETUSERPASSWORD
|
5894
5208
|
rb_define_method(c_domain, "user_password=", libvirt_domain_user_password_equal, 1);
|
5895
|
-
#endif
|
5896
|
-
#if HAVE_CONST_VIR_DOMAIN_PASSWORD_ENCRYPTED
|
5897
5209
|
rb_define_const(c_domain, "PASSWORD_ENCRYPTED",
|
5898
5210
|
INT2NUM(VIR_DOMAIN_PASSWORD_ENCRYPTED));
|
5899
|
-
#endif
|
5900
|
-
#if HAVE_CONST_VIR_DOMAIN_TIME_SYNC
|
5901
5211
|
rb_define_const(c_domain, "TIME_SYNC", INT2NUM(VIR_DOMAIN_TIME_SYNC));
|
5902
|
-
#endif
|
5903
5212
|
}
|