ruby-libvirt 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/NEWS +13 -0
- data/README +1 -1
- data/README.rdoc +1 -1
- data/Rakefile +3 -3
- data/ext/libvirt/_libvirt.c +10 -100
- data/ext/libvirt/common.c +9 -6
- data/ext/libvirt/common.h +1 -1
- data/ext/libvirt/connect.c +122 -358
- data/ext/libvirt/domain.c +267 -961
- data/ext/libvirt/extconf.h +0 -389
- data/ext/libvirt/extconf.rb +6 -490
- data/ext/libvirt/interface.c +8 -18
- data/ext/libvirt/network.c +15 -46
- data/ext/libvirt/nodedevice.c +22 -41
- data/ext/libvirt/nwfilter.c +5 -9
- data/ext/libvirt/secret.c +9 -20
- data/ext/libvirt/storage.c +36 -129
- data/ext/libvirt/stream.c +10 -14
- data/tests/test_domain.rb +2 -0
- data/tests/test_utils.rb +18 -0
- metadata +8 -9
data/ext/libvirt/domain.c
CHANGED
@@ -23,72 +23,28 @@
|
|
23
23
|
#include <unistd.h>
|
24
24
|
#include <ruby.h>
|
25
25
|
/* we need to include st.h since ruby 1.8 needs it for RHash */
|
26
|
-
#include <st.h>
|
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)
|
@@ -803,12 +729,11 @@ static VALUE libvirt_domain_vcpus(VALUE d)
|
|
803
729
|
|
804
730
|
cpumaplen = VIR_CPU_MAPLEN(maxcpus);
|
805
731
|
|
806
|
-
cpumap = alloca(sizeof(unsigned char) * cpumaplen);
|
732
|
+
cpumap = alloca(sizeof(unsigned char) * cpumaplen * dominfo.nrVirtCpu);
|
807
733
|
|
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,24 +748,20 @@ 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();
|
834
754
|
|
835
|
-
for (i = 0; i <
|
755
|
+
for (i = 0; i < r; i++) {
|
836
756
|
vcpuinfo = rb_class_new_instance(0, NULL, c_domain_vcpuinfo);
|
837
|
-
rb_iv_set(vcpuinfo, "@number", UINT2NUM(i));
|
838
757
|
if (cpuinfo != NULL) {
|
758
|
+
rb_iv_set(vcpuinfo, "@number", INT2NUM(cpuinfo[i].number));
|
839
759
|
rb_iv_set(vcpuinfo, "@state", INT2NUM(cpuinfo[i].state));
|
840
760
|
rb_iv_set(vcpuinfo, "@cpu_time", ULL2NUM(cpuinfo[i].cpuTime));
|
841
761
|
rb_iv_set(vcpuinfo, "@cpu", INT2NUM(cpuinfo[i].cpu));
|
842
762
|
}
|
843
763
|
else {
|
764
|
+
rb_iv_set(vcpuinfo, "@number", Qnil);
|
844
765
|
rb_iv_set(vcpuinfo, "@state", Qnil);
|
845
766
|
rb_iv_set(vcpuinfo, "@cpu_time", Qnil);
|
846
767
|
rb_iv_set(vcpuinfo, "@cpu", Qnil);
|
@@ -860,12 +781,11 @@ static VALUE libvirt_domain_vcpus(VALUE d)
|
|
860
781
|
return result;
|
861
782
|
}
|
862
783
|
|
863
|
-
#if HAVE_VIRDOMAINISACTIVE
|
864
784
|
/*
|
865
785
|
* call-seq:
|
866
786
|
* dom.active? -> [true|false]
|
867
787
|
*
|
868
|
-
* Call virDomainIsActive[
|
788
|
+
* Call virDomainIsActive[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive]
|
869
789
|
* to determine if this domain is currently active.
|
870
790
|
*/
|
871
791
|
static VALUE libvirt_domain_active_p(VALUE d)
|
@@ -874,14 +794,12 @@ static VALUE libvirt_domain_active_p(VALUE d)
|
|
874
794
|
ruby_libvirt_connect_get(d),
|
875
795
|
ruby_libvirt_domain_get(d));
|
876
796
|
}
|
877
|
-
#endif
|
878
797
|
|
879
|
-
#if HAVE_VIRDOMAINISPERSISTENT
|
880
798
|
/*
|
881
799
|
* call-seq:
|
882
800
|
* dom.persistent? -> [true|false]
|
883
801
|
*
|
884
|
-
* Call virDomainIsPersistent[
|
802
|
+
* Call virDomainIsPersistent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsPersistent]
|
885
803
|
* to determine if this is a persistent domain.
|
886
804
|
*/
|
887
805
|
static VALUE libvirt_domain_persistent_p(VALUE d)
|
@@ -890,13 +808,12 @@ static VALUE libvirt_domain_persistent_p(VALUE d)
|
|
890
808
|
ruby_libvirt_connect_get(d),
|
891
809
|
ruby_libvirt_domain_get(d));
|
892
810
|
}
|
893
|
-
#endif
|
894
811
|
|
895
812
|
/*
|
896
813
|
* call-seq:
|
897
814
|
* dom.ifinfo(if) -> Libvirt::Domain::IfInfo
|
898
815
|
*
|
899
|
-
* Call virDomainInterfaceStats[
|
816
|
+
* Call virDomainInterfaceStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceStats]
|
900
817
|
* to retrieve statistics about domain interface if.
|
901
818
|
*/
|
902
819
|
static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
|
@@ -930,7 +847,7 @@ static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
|
|
930
847
|
* call-seq:
|
931
848
|
* dom.name -> String
|
932
849
|
*
|
933
|
-
* Call virDomainGetName[
|
850
|
+
* Call virDomainGetName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName]
|
934
851
|
* to retrieve the name of this domain.
|
935
852
|
*/
|
936
853
|
static VALUE libvirt_domain_name(VALUE d)
|
@@ -944,7 +861,7 @@ static VALUE libvirt_domain_name(VALUE d)
|
|
944
861
|
* call-seq:
|
945
862
|
* dom.id -> Fixnum
|
946
863
|
*
|
947
|
-
* Call virDomainGetID[
|
864
|
+
* Call virDomainGetID[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetID]
|
948
865
|
* to retrieve the ID of this domain. If the domain isn't running, this will
|
949
866
|
* be -1.
|
950
867
|
*/
|
@@ -969,7 +886,7 @@ static VALUE libvirt_domain_id(VALUE d)
|
|
969
886
|
* call-seq:
|
970
887
|
* dom.uuid -> String
|
971
888
|
*
|
972
|
-
* Call virDomainGetUUIDString[
|
889
|
+
* Call virDomainGetUUIDString[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString]
|
973
890
|
* to retrieve the UUID of this domain.
|
974
891
|
*/
|
975
892
|
static VALUE libvirt_domain_uuid(VALUE d)
|
@@ -983,7 +900,7 @@ static VALUE libvirt_domain_uuid(VALUE d)
|
|
983
900
|
* call-seq:
|
984
901
|
* dom.os_type -> String
|
985
902
|
*
|
986
|
-
* Call virDomainGetOSType[
|
903
|
+
* Call virDomainGetOSType[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType]
|
987
904
|
* to retrieve the os_type of this domain. In libvirt terms, os_type determines
|
988
905
|
* whether this domain is fully virtualized, paravirtualized, or a container.
|
989
906
|
*/
|
@@ -998,7 +915,7 @@ static VALUE libvirt_domain_os_type(VALUE d)
|
|
998
915
|
* call-seq:
|
999
916
|
* dom.max_memory -> Fixnum
|
1000
917
|
*
|
1001
|
-
* Call virDomainGetMaxMemory[
|
918
|
+
* Call virDomainGetMaxMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxMemory]
|
1002
919
|
* to retrieve the maximum amount of memory this domain is allowed to access.
|
1003
920
|
* Note that the current amount of memory this domain is allowed to access may
|
1004
921
|
* be different (see dom.memory_set).
|
@@ -1019,7 +936,7 @@ static VALUE libvirt_domain_max_memory(VALUE d)
|
|
1019
936
|
* call-seq:
|
1020
937
|
* dom.max_memory = Fixnum
|
1021
938
|
*
|
1022
|
-
* Call virDomainSetMaxMemory[
|
939
|
+
* Call virDomainSetMaxMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMaxMemory]
|
1023
940
|
* to set the maximum amount of memory (in kilobytes) this domain should be
|
1024
941
|
* allowed to access.
|
1025
942
|
*/
|
@@ -1040,7 +957,7 @@ static VALUE libvirt_domain_max_memory_equal(VALUE d, VALUE max_memory)
|
|
1040
957
|
* call-seq:
|
1041
958
|
* dom.memory = Fixnum,flags=0
|
1042
959
|
*
|
1043
|
-
* Call virDomainSetMemory[
|
960
|
+
* Call virDomainSetMemory[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory]
|
1044
961
|
* to set the amount of memory (in kilobytes) this domain should currently
|
1045
962
|
* have. Note this will only succeed if both the hypervisor and the domain on
|
1046
963
|
* this connection support ballooning.
|
@@ -1052,15 +969,14 @@ static VALUE libvirt_domain_memory_equal(VALUE d, VALUE in)
|
|
1052
969
|
|
1053
970
|
domain_input_to_fixnum_and_flags(in, &memory, &flags);
|
1054
971
|
|
1055
|
-
#if HAVE_VIRDOMAINSETMEMORYFLAGS
|
1056
|
-
r = virDomainSetMemoryFlags(ruby_libvirt_domain_get(d), NUM2ULONG(memory),
|
1057
|
-
ruby_libvirt_value_to_uint(flags));
|
1058
|
-
#else
|
1059
972
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1060
|
-
|
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));
|
1061
979
|
}
|
1062
|
-
r = virDomainSetMemory(ruby_libvirt_domain_get(d), NUM2ULONG(memory));
|
1063
|
-
#endif
|
1064
980
|
|
1065
981
|
ruby_libvirt_raise_error_if(r < 0, e_DefinitionError, "virDomainSetMemory",
|
1066
982
|
ruby_libvirt_connect_get(d));
|
@@ -1072,7 +988,7 @@ static VALUE libvirt_domain_memory_equal(VALUE d, VALUE in)
|
|
1072
988
|
* call-seq:
|
1073
989
|
* dom.max_vcpus -> Fixnum
|
1074
990
|
*
|
1075
|
-
* Call virDomainGetMaxVcpus[
|
991
|
+
* Call virDomainGetMaxVcpus[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus]
|
1076
992
|
* to retrieve the maximum number of virtual CPUs this domain can use.
|
1077
993
|
*/
|
1078
994
|
static VALUE libvirt_domain_max_vcpus(VALUE d)
|
@@ -1082,11 +998,10 @@ static VALUE libvirt_domain_max_vcpus(VALUE d)
|
|
1082
998
|
ruby_libvirt_domain_get(d));
|
1083
999
|
}
|
1084
1000
|
|
1085
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
1086
1001
|
/* call-seq:
|
1087
1002
|
* dom.num_vcpus(flags) -> Fixnum
|
1088
1003
|
*
|
1089
|
-
* Call virDomainGetVcpusFlags[
|
1004
|
+
* Call virDomainGetVcpusFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags]
|
1090
1005
|
* to retrieve the number of virtual CPUs assigned to this domain.
|
1091
1006
|
*/
|
1092
1007
|
static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
|
@@ -1096,13 +1011,12 @@ static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
|
|
1096
1011
|
ruby_libvirt_domain_get(d),
|
1097
1012
|
ruby_libvirt_value_to_uint(flags));
|
1098
1013
|
}
|
1099
|
-
#endif
|
1100
1014
|
|
1101
1015
|
/*
|
1102
1016
|
* call-seq:
|
1103
1017
|
* dom.vcpus = Fixnum,flags=0
|
1104
1018
|
*
|
1105
|
-
* Call virDomainSetVcpus[
|
1019
|
+
* Call virDomainSetVcpus[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpus]
|
1106
1020
|
* to set the current number of virtual CPUs this domain should have. Note
|
1107
1021
|
* that this will only work if both the hypervisor and domain on this
|
1108
1022
|
* connection support virtual CPU hotplug/hot-unplug.
|
@@ -1113,46 +1027,34 @@ static VALUE libvirt_domain_vcpus_equal(VALUE d, VALUE in)
|
|
1113
1027
|
|
1114
1028
|
if (TYPE(in) == T_FIXNUM) {
|
1115
1029
|
nvcpus = in;
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
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) {
|
1120
1035
|
if (RARRAY_LEN(in) != 2) {
|
1121
1036
|
rb_raise(rb_eArgError, "wrong number of arguments (%ld for 2)",
|
1122
1037
|
RARRAY_LEN(in));
|
1123
1038
|
}
|
1124
1039
|
nvcpus = rb_ary_entry(in, 0);
|
1125
1040
|
flags = rb_ary_entry(in, 1);
|
1126
|
-
|
1127
|
-
|
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 {
|
1128
1047
|
rb_raise(rb_eTypeError,
|
1129
1048
|
"wrong argument type (expected Number or Array)");
|
1130
1049
|
}
|
1131
|
-
|
1132
|
-
ruby_libvirt_generate_call_nil(virDomainSetVcpusFlags,
|
1133
|
-
ruby_libvirt_connect_get(d),
|
1134
|
-
ruby_libvirt_domain_get(d), NUM2UINT(nvcpus),
|
1135
|
-
NUM2UINT(flags));
|
1136
|
-
#else
|
1137
|
-
|
1138
|
-
if (NUM2UINT(flags) != 0) {
|
1139
|
-
rb_raise(e_NoSupportError, "Non-zero flags not supported");
|
1140
|
-
}
|
1141
|
-
|
1142
|
-
ruby_libvirt_generate_call_nil(virDomainSetVcpus,
|
1143
|
-
ruby_libvirt_connect_get(d),
|
1144
|
-
ruby_libvirt_domain_get(d),
|
1145
|
-
NUM2UINT(nvcpus));
|
1146
|
-
#endif
|
1147
1050
|
}
|
1148
1051
|
|
1149
|
-
#if HAVE_VIRDOMAINSETVCPUSFLAGS
|
1150
1052
|
/*
|
1151
1053
|
* call-seq:
|
1152
1054
|
* dom.vcpus_flags = Fixnum,flags=0
|
1153
1055
|
*
|
1154
1056
|
|
1155
|
-
* Call virDomainSetVcpusFlags[
|
1057
|
+
* Call virDomainSetVcpusFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpusFlags]
|
1156
1058
|
* to set the current number of virtual CPUs this domain should have. The
|
1157
1059
|
* flags parameter controls whether the change is made to the running domain
|
1158
1060
|
* the domain configuration, or both, and must not be 0. Deprecated;
|
@@ -1169,13 +1071,12 @@ static VALUE libvirt_domain_vcpus_flags_equal(VALUE d, VALUE in)
|
|
1169
1071
|
ruby_libvirt_domain_get(d), NUM2UINT(nvcpus),
|
1170
1072
|
NUM2UINT(flags));
|
1171
1073
|
}
|
1172
|
-
#endif
|
1173
1074
|
|
1174
1075
|
/*
|
1175
1076
|
* call-seq:
|
1176
1077
|
* dom.pin_vcpu(vcpu, cpulist, flags=0) -> nil
|
1177
1078
|
*
|
1178
|
-
* Call virDomainPinVcpu[
|
1079
|
+
* Call virDomainPinVcpu[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
|
1179
1080
|
* to pin a particular virtual CPU to a range of physical processors. The
|
1180
1081
|
* cpulist should be an array of Fixnums representing the physical processors
|
1181
1082
|
* this virtual CPU should be allowed to be scheduled on.
|
@@ -1202,29 +1103,28 @@ static VALUE libvirt_domain_pin_vcpu(int argc, VALUE *argv, VALUE d)
|
|
1202
1103
|
VIR_USE_CPU(cpumap, NUM2UINT(e));
|
1203
1104
|
}
|
1204
1105
|
|
1205
|
-
#if HAVE_VIRDOMAINPINVCPUFLAGS
|
1206
|
-
ruby_libvirt_generate_call_nil(virDomainPinVcpuFlags,
|
1207
|
-
ruby_libvirt_connect_get(d),
|
1208
|
-
ruby_libvirt_domain_get(d),
|
1209
|
-
NUM2UINT(vcpu), cpumap, cpumaplen,
|
1210
|
-
ruby_libvirt_value_to_uint(flags));
|
1211
|
-
#else
|
1212
1106
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1213
|
-
|
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);
|
1214
1120
|
}
|
1215
|
-
|
1216
|
-
ruby_libvirt_generate_call_nil(virDomainPinVcpu,
|
1217
|
-
ruby_libvirt_connect_get(d),
|
1218
|
-
ruby_libvirt_domain_get(d), NUM2UINT(vcpu),
|
1219
|
-
cpumap, cpumaplen);
|
1220
|
-
#endif
|
1221
1121
|
}
|
1222
1122
|
|
1223
1123
|
/*
|
1224
1124
|
* call-seq:
|
1225
1125
|
* dom.xml_desc(flags=0) -> String
|
1226
1126
|
*
|
1227
|
-
* Call virDomainGetXMLDesc[
|
1127
|
+
* Call virDomainGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc]
|
1228
1128
|
* to retrieve the XML describing this domain.
|
1229
1129
|
*/
|
1230
1130
|
static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
|
@@ -1243,7 +1143,7 @@ static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
|
|
1243
1143
|
* call-seq:
|
1244
1144
|
* dom.undefine(flags=0) -> nil
|
1245
1145
|
*
|
1246
|
-
* Call virDomainUndefine[
|
1146
|
+
* Call virDomainUndefine[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefine]
|
1247
1147
|
* to undefine the domain. After this call, the domain object is no longer
|
1248
1148
|
* valid.
|
1249
1149
|
*/
|
@@ -1253,27 +1153,23 @@ static VALUE libvirt_domain_undefine(int argc, VALUE *argv, VALUE d)
|
|
1253
1153
|
|
1254
1154
|
rb_scan_args(argc, argv, "01", &flags);
|
1255
1155
|
|
1256
|
-
#if HAVE_VIRDOMAINUNDEFINEFLAGS
|
1257
|
-
ruby_libvirt_generate_call_nil(virDomainUndefineFlags,
|
1258
|
-
ruby_libvirt_connect_get(d),
|
1259
|
-
ruby_libvirt_domain_get(d),
|
1260
|
-
ruby_libvirt_value_to_uint(flags));
|
1261
|
-
#else
|
1262
1156
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1263
|
-
|
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));
|
1264
1165
|
}
|
1265
|
-
|
1266
|
-
ruby_libvirt_generate_call_nil(virDomainUndefine,
|
1267
|
-
ruby_libvirt_connect_get(d),
|
1268
|
-
ruby_libvirt_domain_get(d));
|
1269
|
-
#endif
|
1270
1166
|
}
|
1271
1167
|
|
1272
1168
|
/*
|
1273
1169
|
* call-seq:
|
1274
1170
|
* dom.create(flags=0) -> nil
|
1275
1171
|
*
|
1276
|
-
* Call virDomainCreate[
|
1172
|
+
* Call virDomainCreate[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreate]
|
1277
1173
|
* to start an already defined domain.
|
1278
1174
|
*/
|
1279
1175
|
static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
|
@@ -1282,25 +1178,23 @@ static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
|
|
1282
1178
|
|
1283
1179
|
rb_scan_args(argc, argv, "01", &flags);
|
1284
1180
|
|
1285
|
-
#if HAVE_VIRDOMAINCREATEWITHFLAGS
|
1286
|
-
ruby_libvirt_generate_call_nil(virDomainCreateWithFlags,
|
1287
|
-
ruby_libvirt_connect_get(d),
|
1288
|
-
ruby_libvirt_domain_get(d),
|
1289
|
-
ruby_libvirt_value_to_uint(flags));
|
1290
|
-
#else
|
1291
1181
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1292
|
-
|
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));
|
1293
1190
|
}
|
1294
|
-
ruby_libvirt_generate_call_nil(virDomainCreate, ruby_libvirt_connect_get(d),
|
1295
|
-
ruby_libvirt_domain_get(d));
|
1296
|
-
#endif
|
1297
1191
|
}
|
1298
1192
|
|
1299
1193
|
/*
|
1300
1194
|
* call-seq:
|
1301
1195
|
* dom.autostart -> [true|false]
|
1302
1196
|
*
|
1303
|
-
* Call virDomainGetAutostart[
|
1197
|
+
* Call virDomainGetAutostart[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetAutostart]
|
1304
1198
|
* to find out the state of the autostart flag for a domain.
|
1305
1199
|
*/
|
1306
1200
|
static VALUE libvirt_domain_autostart(VALUE d)
|
@@ -1318,7 +1212,7 @@ static VALUE libvirt_domain_autostart(VALUE d)
|
|
1318
1212
|
* call-seq:
|
1319
1213
|
* dom.autostart = [true|false]
|
1320
1214
|
*
|
1321
|
-
* Call virDomainSetAutostart[
|
1215
|
+
* Call virDomainSetAutostart[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetAutostart]
|
1322
1216
|
* to make this domain autostart when libvirtd starts up.
|
1323
1217
|
*/
|
1324
1218
|
static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
|
@@ -1338,7 +1232,7 @@ static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
|
|
1338
1232
|
* call-seq:
|
1339
1233
|
* dom.attach_device(device_xml, flags=0) -> nil
|
1340
1234
|
*
|
1341
|
-
* Call virDomainAttachDevice[
|
1235
|
+
* Call virDomainAttachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice]
|
1342
1236
|
* to attach the device described by the device_xml to the domain.
|
1343
1237
|
*/
|
1344
1238
|
static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
|
@@ -1347,28 +1241,25 @@ static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
|
|
1347
1241
|
|
1348
1242
|
rb_scan_args(argc, argv, "11", &xml, &flags);
|
1349
1243
|
|
1350
|
-
#if HAVE_VIRDOMAINATTACHDEVICEFLAGS
|
1351
|
-
ruby_libvirt_generate_call_nil(virDomainAttachDeviceFlags,
|
1352
|
-
ruby_libvirt_connect_get(d),
|
1353
|
-
ruby_libvirt_domain_get(d),
|
1354
|
-
StringValueCStr(xml),
|
1355
|
-
ruby_libvirt_value_to_uint(flags));
|
1356
|
-
#else
|
1357
1244
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1358
|
-
|
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));
|
1359
1255
|
}
|
1360
|
-
ruby_libvirt_generate_call_nil(virDomainAttachDevice,
|
1361
|
-
ruby_libvirt_connect_get(d),
|
1362
|
-
ruby_libvirt_domain_get(d),
|
1363
|
-
StringValueCStr(xml));
|
1364
|
-
#endif
|
1365
1256
|
}
|
1366
1257
|
|
1367
1258
|
/*
|
1368
1259
|
* call-seq:
|
1369
1260
|
* dom.detach_device(device_xml, flags=0) -> nil
|
1370
1261
|
*
|
1371
|
-
* Call virDomainDetachDevice[
|
1262
|
+
* Call virDomainDetachDevice[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice]
|
1372
1263
|
* to detach the device described by the device_xml from the domain.
|
1373
1264
|
*/
|
1374
1265
|
static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
|
@@ -1377,29 +1268,25 @@ static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
|
|
1377
1268
|
|
1378
1269
|
rb_scan_args(argc, argv, "11", &xml, &flags);
|
1379
1270
|
|
1380
|
-
#if HAVE_VIRDOMAINDETACHDEVICEFLAGS
|
1381
|
-
ruby_libvirt_generate_call_nil(virDomainDetachDeviceFlags,
|
1382
|
-
ruby_libvirt_connect_get(d),
|
1383
|
-
ruby_libvirt_domain_get(d),
|
1384
|
-
StringValueCStr(xml),
|
1385
|
-
ruby_libvirt_value_to_uint(flags));
|
1386
|
-
#else
|
1387
1271
|
if (ruby_libvirt_value_to_uint(flags) != 0) {
|
1388
|
-
|
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));
|
1389
1282
|
}
|
1390
|
-
ruby_libvirt_generate_call_nil(virDomainDetachDevice,
|
1391
|
-
ruby_libvirt_connect_get(d),
|
1392
|
-
ruby_libvirt_domain_get(d),
|
1393
|
-
StringValueCStr(xml));
|
1394
|
-
#endif
|
1395
1283
|
}
|
1396
1284
|
|
1397
|
-
#if HAVE_VIRDOMAINUPDATEDEVICEFLAGS
|
1398
1285
|
/*
|
1399
1286
|
* call-seq:
|
1400
1287
|
* dom.update_device(device_xml, flags=0) -> nil
|
1401
1288
|
*
|
1402
|
-
* Call virDomainUpdateDeviceFlags[
|
1289
|
+
* Call virDomainUpdateDeviceFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags]
|
1403
1290
|
* to update the device described by the device_xml.
|
1404
1291
|
*/
|
1405
1292
|
static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
|
@@ -1414,13 +1301,12 @@ static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
|
|
1414
1301
|
StringValueCStr(xml),
|
1415
1302
|
ruby_libvirt_value_to_uint(flags));
|
1416
1303
|
}
|
1417
|
-
#endif
|
1418
1304
|
|
1419
1305
|
/*
|
1420
1306
|
* call-seq:
|
1421
1307
|
* dom.free -> nil
|
1422
1308
|
*
|
1423
|
-
* Call virDomainFree[
|
1309
|
+
* Call virDomainFree[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFree]
|
1424
1310
|
* to free a domain object.
|
1425
1311
|
*/
|
1426
1312
|
static VALUE libvirt_domain_free(VALUE d)
|
@@ -1428,7 +1314,6 @@ static VALUE libvirt_domain_free(VALUE d)
|
|
1428
1314
|
ruby_libvirt_generate_call_free(Domain, d);
|
1429
1315
|
}
|
1430
1316
|
|
1431
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
1432
1317
|
static void domain_snapshot_free(void *d)
|
1433
1318
|
{
|
1434
1319
|
ruby_libvirt_free_struct(DomainSnapshot, d);
|
@@ -1455,7 +1340,7 @@ static virDomainSnapshotPtr domain_snapshot_get(VALUE d)
|
|
1455
1340
|
* call-seq:
|
1456
1341
|
* dom.snapshot_create_xml(snapshot_xml, flags=0) -> Libvirt::Domain::Snapshot
|
1457
1342
|
*
|
1458
|
-
* Call virDomainSnapshotCreateXML[
|
1343
|
+
* Call virDomainSnapshotCreateXML[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotCreateXML]
|
1459
1344
|
* to create a new snapshot based on snapshot_xml.
|
1460
1345
|
*/
|
1461
1346
|
static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
|
@@ -1480,7 +1365,7 @@ static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
|
|
1480
1365
|
* call-seq:
|
1481
1366
|
* dom.num_of_snapshots(flags=0) -> Fixnum
|
1482
1367
|
*
|
1483
|
-
* Call virDomainSnapshotNum[
|
1368
|
+
* Call virDomainSnapshotNum[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNum]
|
1484
1369
|
* to retrieve the number of available snapshots for this domain.
|
1485
1370
|
*/
|
1486
1371
|
static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -1499,7 +1384,7 @@ static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
|
|
1499
1384
|
* call-seq:
|
1500
1385
|
* dom.list_snapshots(flags=0) -> list
|
1501
1386
|
*
|
1502
|
-
* Call virDomainSnapshotListNames[
|
1387
|
+
* Call virDomainSnapshotListNames[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListNames]
|
1503
1388
|
* to retrieve a list of snapshot names available for this domain.
|
1504
1389
|
*/
|
1505
1390
|
static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -1539,7 +1424,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
|
|
1539
1424
|
* call-seq:
|
1540
1425
|
* dom.lookup_snapshot_by_name(name, flags=0) -> Libvirt::Domain::Snapshot
|
1541
1426
|
*
|
1542
|
-
* Call virDomainSnapshotLookupByName[
|
1427
|
+
* Call virDomainSnapshotLookupByName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotLookupByName]
|
1543
1428
|
* to retrieve a snapshot object corresponding to snapshot name.
|
1544
1429
|
*/
|
1545
1430
|
static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
|
@@ -1564,7 +1449,7 @@ static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
|
|
1564
1449
|
* call-seq:
|
1565
1450
|
* dom.has_current_snapshot?(flags=0) -> [true|false]
|
1566
1451
|
*
|
1567
|
-
* Call virDomainHasCurrentSnapshot[
|
1452
|
+
* Call virDomainHasCurrentSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasCurrentSnapshot]
|
1568
1453
|
* to find out if this domain has a snapshot active.
|
1569
1454
|
*/
|
1570
1455
|
static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
|
@@ -1584,7 +1469,7 @@ static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
|
|
1584
1469
|
* call-seq:
|
1585
1470
|
* dom.revert_to_snapshot(snapshot_object, flags=0) -> nil
|
1586
1471
|
*
|
1587
|
-
* Call virDomainRevertToSnapshot[
|
1472
|
+
* Call virDomainRevertToSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRevertToSnapshot]
|
1588
1473
|
* to restore this domain to a previously saved snapshot.
|
1589
1474
|
*/
|
1590
1475
|
static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
|
@@ -1603,7 +1488,7 @@ static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
|
|
1603
1488
|
* call-seq:
|
1604
1489
|
* dom.current_snapshot(flags=0) -> Libvirt::Domain::Snapshot
|
1605
1490
|
*
|
1606
|
-
* Call virDomainCurrentSnapshot[
|
1491
|
+
* Call virDomainCurrentSnapshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCurrentSnapshot]
|
1607
1492
|
* to retrieve the current snapshot for this domain (if any).
|
1608
1493
|
*/
|
1609
1494
|
static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
|
@@ -1626,7 +1511,7 @@ static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
|
|
1626
1511
|
* call-seq:
|
1627
1512
|
* snapshot.xml_desc(flags=0) -> String
|
1628
1513
|
*
|
1629
|
-
* Call virDomainSnapshotGetXMLDesc[
|
1514
|
+
* Call virDomainSnapshotGetXMLDesc[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetXMLDesc]
|
1630
1515
|
* to retrieve the xml description for this snapshot.
|
1631
1516
|
*/
|
1632
1517
|
static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
|
@@ -1645,7 +1530,7 @@ static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
|
|
1645
1530
|
* call-seq:
|
1646
1531
|
* snapshot.delete(flags=0) -> nil
|
1647
1532
|
*
|
1648
|
-
* Call virDomainSnapshotDelete[
|
1533
|
+
* Call virDomainSnapshotDelete[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotDelete]
|
1649
1534
|
* to delete this snapshot.
|
1650
1535
|
*/
|
1651
1536
|
static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
|
@@ -1664,7 +1549,7 @@ static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
|
|
1664
1549
|
* call-seq:
|
1665
1550
|
* snapshot.free -> nil
|
1666
1551
|
*
|
1667
|
-
* Call virDomainSnapshotFree[
|
1552
|
+
* Call virDomainSnapshotFree[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotFree]
|
1668
1553
|
* to free up the snapshot object. After this call the snapshot object is
|
1669
1554
|
* no longer valid.
|
1670
1555
|
*/
|
@@ -1673,14 +1558,12 @@ static VALUE libvirt_domain_snapshot_free(VALUE s)
|
|
1673
1558
|
ruby_libvirt_generate_call_free(DomainSnapshot, s);
|
1674
1559
|
}
|
1675
1560
|
|
1676
|
-
#endif
|
1677
1561
|
|
1678
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETNAME
|
1679
1562
|
/*
|
1680
1563
|
* call-seq:
|
1681
1564
|
* snapshot.name -> String
|
1682
1565
|
*
|
1683
|
-
* Call virDomainSnapshotGetName[
|
1566
|
+
* Call virDomainSnapshotGetName[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetName]
|
1684
1567
|
* to get the name associated with a snapshot.
|
1685
1568
|
*/
|
1686
1569
|
static VALUE libvirt_domain_snapshot_name(VALUE s)
|
@@ -1689,15 +1572,13 @@ static VALUE libvirt_domain_snapshot_name(VALUE s)
|
|
1689
1572
|
ruby_libvirt_connect_get(s),
|
1690
1573
|
0, domain_snapshot_get(s));
|
1691
1574
|
}
|
1692
|
-
#endif
|
1693
1575
|
|
1694
1576
|
|
1695
|
-
#if HAVE_TYPE_VIRDOMAINJOBINFOPTR
|
1696
1577
|
/*
|
1697
1578
|
* call-seq:
|
1698
1579
|
* dom.job_info -> Libvirt::Domain::JobInfo
|
1699
1580
|
*
|
1700
|
-
* Call virDomainGetJobInfo[
|
1581
|
+
* Call virDomainGetJobInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo]
|
1701
1582
|
* to retrieve the current state of the running domain job.
|
1702
1583
|
*/
|
1703
1584
|
static VALUE libvirt_domain_job_info(VALUE d)
|
@@ -1731,7 +1612,7 @@ static VALUE libvirt_domain_job_info(VALUE d)
|
|
1731
1612
|
* call-seq:
|
1732
1613
|
* dom.abort_job -> nil
|
1733
1614
|
*
|
1734
|
-
* Call virDomainAbortJob[
|
1615
|
+
* Call virDomainAbortJob[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob]
|
1735
1616
|
* to abort the currently running job on this domain.
|
1736
1617
|
*/
|
1737
1618
|
static VALUE libvirt_domain_abort_job(VALUE d)
|
@@ -1741,7 +1622,6 @@ static VALUE libvirt_domain_abort_job(VALUE d)
|
|
1741
1622
|
ruby_libvirt_domain_get(d));
|
1742
1623
|
}
|
1743
1624
|
|
1744
|
-
#endif
|
1745
1625
|
|
1746
1626
|
struct create_sched_type_args {
|
1747
1627
|
char *type;
|
@@ -1766,7 +1646,7 @@ static VALUE create_sched_type_array(VALUE input)
|
|
1766
1646
|
* call-seq:
|
1767
1647
|
* dom.scheduler_type -> [type, #params]
|
1768
1648
|
*
|
1769
|
-
* Call virDomainGetSchedulerType[
|
1649
|
+
* Call virDomainGetSchedulerType[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerType]
|
1770
1650
|
* to retrieve the scheduler type used on this domain.
|
1771
1651
|
*/
|
1772
1652
|
static VALUE libvirt_domain_scheduler_type(VALUE d)
|
@@ -1793,7 +1673,6 @@ static VALUE libvirt_domain_scheduler_type(VALUE d)
|
|
1793
1673
|
return result;
|
1794
1674
|
}
|
1795
1675
|
|
1796
|
-
#if HAVE_VIRDOMAINQEMUMONITORCOMMAND
|
1797
1676
|
/*
|
1798
1677
|
* call-seq:
|
1799
1678
|
* dom.qemu_monitor_command(cmd, flags=0) -> String
|
@@ -1841,14 +1720,12 @@ static VALUE libvirt_domain_qemu_monitor_command(int argc, VALUE *argv, VALUE d)
|
|
1841
1720
|
|
1842
1721
|
return ret;
|
1843
1722
|
}
|
1844
|
-
#endif
|
1845
1723
|
|
1846
|
-
#if HAVE_VIRDOMAINISUPDATED
|
1847
1724
|
/*
|
1848
1725
|
* call-seq:
|
1849
1726
|
* dom.updated? -> [True|False]
|
1850
1727
|
*
|
1851
|
-
* Call virDomainIsUpdated[
|
1728
|
+
* Call virDomainIsUpdated[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsUpdated]
|
1852
1729
|
* to determine whether the definition for this domain has been updated.
|
1853
1730
|
*/
|
1854
1731
|
static VALUE libvirt_domain_is_updated(VALUE d)
|
@@ -1857,7 +1734,6 @@ static VALUE libvirt_domain_is_updated(VALUE d)
|
|
1857
1734
|
ruby_libvirt_connect_get(d),
|
1858
1735
|
ruby_libvirt_domain_get(d));
|
1859
1736
|
}
|
1860
|
-
#endif
|
1861
1737
|
|
1862
1738
|
static const char *scheduler_nparams(VALUE d,
|
1863
1739
|
unsigned int RUBY_LIBVIRT_UNUSED(flags),
|
@@ -1882,21 +1758,17 @@ static const char *scheduler_get(VALUE d, unsigned int flags, void *voidparams,
|
|
1882
1758
|
{
|
1883
1759
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
1884
1760
|
|
1885
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
1886
|
-
if (virDomainGetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1887
|
-
nparams, flags) < 0) {
|
1888
|
-
return "virDomainGetSchedulerParameters";
|
1889
|
-
}
|
1890
|
-
#else
|
1891
1761
|
if (flags != 0) {
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
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
|
+
}
|
1898
1771
|
}
|
1899
|
-
#endif
|
1900
1772
|
|
1901
1773
|
return NULL;
|
1902
1774
|
}
|
@@ -1905,21 +1777,17 @@ static const char *scheduler_set(VALUE d, unsigned int flags,
|
|
1905
1777
|
virTypedParameterPtr params, int nparams,
|
1906
1778
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
1907
1779
|
{
|
1908
|
-
#if HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
1909
|
-
if (virDomainSetSchedulerParametersFlags(ruby_libvirt_domain_get(d), params,
|
1910
|
-
nparams, flags) < 0) {
|
1911
|
-
return "virDomainSetSchedulerParameters";
|
1912
|
-
}
|
1913
|
-
#else
|
1914
1780
|
if (flags != 0) {
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
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
|
+
}
|
1921
1790
|
}
|
1922
|
-
#endif
|
1923
1791
|
|
1924
1792
|
return NULL;
|
1925
1793
|
}
|
@@ -1928,7 +1796,7 @@ static const char *scheduler_set(VALUE d, unsigned int flags,
|
|
1928
1796
|
* call-seq:
|
1929
1797
|
* dom.scheduler_parameters(flags=0) -> Hash
|
1930
1798
|
*
|
1931
|
-
* Call virDomainGetSchedulerParameters[
|
1799
|
+
* Call virDomainGetSchedulerParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParameters]
|
1932
1800
|
* to retrieve all of the scheduler parameters for this domain. The keys and
|
1933
1801
|
* values in the hash that is returned are hypervisor specific.
|
1934
1802
|
*/
|
@@ -1948,12 +1816,8 @@ static struct ruby_libvirt_typed_param domain_scheduler_allowed[] = {
|
|
1948
1816
|
{VIR_DOMAIN_SCHEDULER_CPU_SHARES, VIR_TYPED_PARAM_ULLONG},
|
1949
1817
|
{VIR_DOMAIN_SCHEDULER_VCPU_PERIOD, VIR_TYPED_PARAM_ULLONG},
|
1950
1818
|
{VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, VIR_TYPED_PARAM_LLONG},
|
1951
|
-
#if HAVE_CONST_VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD
|
1952
1819
|
{VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD, VIR_TYPED_PARAM_ULLONG},
|
1953
|
-
#endif
|
1954
|
-
#if HAVE_CONST_VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA
|
1955
1820
|
{VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA, VIR_TYPED_PARAM_LLONG},
|
1956
|
-
#endif
|
1957
1821
|
{VIR_DOMAIN_SCHEDULER_WEIGHT, VIR_TYPED_PARAM_UINT},
|
1958
1822
|
{VIR_DOMAIN_SCHEDULER_CAP, VIR_TYPED_PARAM_UINT},
|
1959
1823
|
{VIR_DOMAIN_SCHEDULER_RESERVATION, VIR_TYPED_PARAM_LLONG},
|
@@ -1965,7 +1829,7 @@ static struct ruby_libvirt_typed_param domain_scheduler_allowed[] = {
|
|
1965
1829
|
* call-seq:
|
1966
1830
|
* dom.scheduler_parameters = Hash
|
1967
1831
|
*
|
1968
|
-
* Call virDomainSetSchedulerParameters[
|
1832
|
+
* Call virDomainSetSchedulerParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters]
|
1969
1833
|
* to set the scheduler parameters for this domain. The keys and values in
|
1970
1834
|
* the input hash are hypervisor specific. If an empty hash is given, no
|
1971
1835
|
* changes are made (and no error is raised).
|
@@ -1982,7 +1846,6 @@ static VALUE libvirt_domain_scheduler_parameters_equal(VALUE d, VALUE input)
|
|
1982
1846
|
scheduler_set);
|
1983
1847
|
}
|
1984
1848
|
|
1985
|
-
#if HAVE_VIRDOMAINSETMEMORYPARAMETERS
|
1986
1849
|
static const char *memory_nparams(VALUE d, unsigned int flags,
|
1987
1850
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
1988
1851
|
int *nparams)
|
@@ -2000,14 +1863,8 @@ static const char *memory_get(VALUE d, unsigned int flags, void *voidparams,
|
|
2000
1863
|
{
|
2001
1864
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
2002
1865
|
|
2003
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2004
1866
|
if (virDomainGetMemoryParameters(ruby_libvirt_domain_get(d), params,
|
2005
1867
|
nparams, flags) < 0) {
|
2006
|
-
#else
|
2007
|
-
if (virDomainGetMemoryParameters(ruby_libvirt_domain_get(d),
|
2008
|
-
(virMemoryParameterPtr)params, nparams,
|
2009
|
-
flags) < 0) {
|
2010
|
-
#endif
|
2011
1868
|
return "virDomainGetMemoryParameters";
|
2012
1869
|
}
|
2013
1870
|
|
@@ -2018,14 +1875,8 @@ static const char *memory_set(VALUE d, unsigned int flags,
|
|
2018
1875
|
virTypedParameterPtr params, int nparams,
|
2019
1876
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
2020
1877
|
{
|
2021
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2022
1878
|
if (virDomainSetMemoryParameters(ruby_libvirt_domain_get(d), params,
|
2023
1879
|
nparams, flags) < 0) {
|
2024
|
-
#else
|
2025
|
-
if (virDomainSetMemoryParameters(ruby_libvirt_domain_get(d),
|
2026
|
-
(virMemoryParameterPtr)params, nparams,
|
2027
|
-
flags) < 0) {
|
2028
|
-
#endif
|
2029
1880
|
return "virDomainSetMemoryParameters";
|
2030
1881
|
}
|
2031
1882
|
|
@@ -2036,7 +1887,7 @@ static const char *memory_set(VALUE d, unsigned int flags,
|
|
2036
1887
|
* call-seq:
|
2037
1888
|
* dom.memory_parameters(flags=0) -> Hash
|
2038
1889
|
*
|
2039
|
-
* Call virDomainGetMemoryParameters[
|
1890
|
+
* Call virDomainGetMemoryParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMemoryParameters]
|
2040
1891
|
* to retrieve all of the memory parameters for this domain. The keys and
|
2041
1892
|
* values in the hash that is returned are hypervisor specific.
|
2042
1893
|
*/
|
@@ -2062,7 +1913,7 @@ static struct ruby_libvirt_typed_param domain_memory_allowed[] = {
|
|
2062
1913
|
* call-seq:
|
2063
1914
|
* dom.memory_parameters = Hash,flags=0
|
2064
1915
|
*
|
2065
|
-
* Call virDomainSetMemoryParameters[
|
1916
|
+
* Call virDomainSetMemoryParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryParameters]
|
2066
1917
|
* to set the memory parameters for this domain. The keys and values in
|
2067
1918
|
* the input hash are hypervisor specific.
|
2068
1919
|
*/
|
@@ -2077,9 +1928,7 @@ static VALUE libvirt_domain_memory_parameters_equal(VALUE d, VALUE in)
|
|
2077
1928
|
ARRAY_SIZE(domain_memory_allowed),
|
2078
1929
|
memory_set);
|
2079
1930
|
}
|
2080
|
-
#endif
|
2081
1931
|
|
2082
|
-
#if HAVE_VIRDOMAINSETBLKIOPARAMETERS
|
2083
1932
|
static const char *blkio_nparams(VALUE d, unsigned int flags,
|
2084
1933
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
2085
1934
|
int *nparams)
|
@@ -2097,14 +1946,8 @@ static const char *blkio_get(VALUE d, unsigned int flags, void *voidparams,
|
|
2097
1946
|
{
|
2098
1947
|
virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
|
2099
1948
|
|
2100
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2101
1949
|
if (virDomainGetBlkioParameters(ruby_libvirt_domain_get(d), params, nparams,
|
2102
1950
|
flags) < 0) {
|
2103
|
-
#else
|
2104
|
-
if (virDomainGetBlkioParameters(ruby_libvirt_domain_get(d),
|
2105
|
-
(virBlkioParameterPtr)params, nparams,
|
2106
|
-
flags) < 0) {
|
2107
|
-
#endif
|
2108
1951
|
return "virDomainGetBlkioParameters";
|
2109
1952
|
}
|
2110
1953
|
|
@@ -2115,14 +1958,8 @@ static const char *blkio_set(VALUE d, unsigned int flags,
|
|
2115
1958
|
virTypedParameterPtr params, int nparams,
|
2116
1959
|
void *RUBY_LIBVIRT_UNUSED(opaque))
|
2117
1960
|
{
|
2118
|
-
#ifdef HAVE_TYPE_VIRTYPEDPARAMETERPTR
|
2119
1961
|
if (virDomainSetBlkioParameters(ruby_libvirt_domain_get(d), params, nparams,
|
2120
1962
|
flags) < 0) {
|
2121
|
-
#else
|
2122
|
-
if (virDomainSetBlkioParameters(ruby_libvirt_domain_get(d),
|
2123
|
-
(virBlkioParameterPtr)params, nparams,
|
2124
|
-
flags) < 0) {
|
2125
|
-
#endif
|
2126
1963
|
return "virDomainSetBlkioParameters";
|
2127
1964
|
}
|
2128
1965
|
|
@@ -2133,7 +1970,7 @@ static const char *blkio_set(VALUE d, unsigned int flags,
|
|
2133
1970
|
* call-seq:
|
2134
1971
|
* dom.blkio_parameters(flags=0) -> Hash
|
2135
1972
|
*
|
2136
|
-
* Call virDomainGetBlkioParameters[
|
1973
|
+
* Call virDomainGetBlkioParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters]
|
2137
1974
|
* to retrieve all of the blkio parameters for this domain. The keys and
|
2138
1975
|
* values in the hash that is returned are hypervisor specific.
|
2139
1976
|
*/
|
@@ -2157,7 +1994,7 @@ static struct ruby_libvirt_typed_param blkio_allowed[] = {
|
|
2157
1994
|
* call-seq:
|
2158
1995
|
* dom.blkio_parameters = Hash,flags=0
|
2159
1996
|
*
|
2160
|
-
* Call virDomainSetBlkioParameters[
|
1997
|
+
* Call virDomainSetBlkioParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters]
|
2161
1998
|
* to set the blkio parameters for this domain. The keys and values in
|
2162
1999
|
* the input hash are hypervisor specific.
|
2163
2000
|
*/
|
@@ -2172,14 +2009,12 @@ static VALUE libvirt_domain_blkio_parameters_equal(VALUE d, VALUE in)
|
|
2172
2009
|
ARRAY_SIZE(blkio_allowed),
|
2173
2010
|
blkio_set);
|
2174
2011
|
}
|
2175
|
-
#endif
|
2176
2012
|
|
2177
|
-
#if HAVE_VIRDOMAINGETSTATE
|
2178
2013
|
/*
|
2179
2014
|
* call-seq:
|
2180
2015
|
* dom.state(flags=0) -> state, reason
|
2181
2016
|
*
|
2182
|
-
* Call virDomainGetState[
|
2017
|
+
* Call virDomainGetState[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState]
|
2183
2018
|
* to get the current state of the domain.
|
2184
2019
|
*/
|
2185
2020
|
static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
|
@@ -2201,14 +2036,12 @@ static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
|
|
2201
2036
|
|
2202
2037
|
return result;
|
2203
2038
|
}
|
2204
|
-
#endif
|
2205
2039
|
|
2206
|
-
#if HAVE_VIRDOMAINOPENCONSOLE
|
2207
2040
|
/*
|
2208
2041
|
* call-seq:
|
2209
2042
|
* dom.open_console(device, stream, flags=0) -> nil
|
2210
2043
|
*
|
2211
|
-
* Call virDomainOpenConsole[
|
2044
|
+
* Call virDomainOpenConsole[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenConsole]
|
2212
2045
|
* to open up a console to device over stream.
|
2213
2046
|
*/
|
2214
2047
|
static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
|
@@ -2224,14 +2057,12 @@ static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
|
|
2224
2057
|
StringValueCStr(dev),
|
2225
2058
|
ruby_libvirt_stream_get(st), NUM2INT(flags));
|
2226
2059
|
}
|
2227
|
-
#endif
|
2228
2060
|
|
2229
|
-
#if HAVE_VIRDOMAINSCREENSHOT
|
2230
2061
|
/*
|
2231
2062
|
* call-seq:
|
2232
2063
|
* dom.screenshot(stream, screen, flags=0) -> nil
|
2233
2064
|
*
|
2234
|
-
* Call virDomainScreenshot[
|
2065
|
+
* Call virDomainScreenshot[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainScreenshot]
|
2235
2066
|
* to take a screenshot of the domain console as a stream.
|
2236
2067
|
*/
|
2237
2068
|
static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
|
@@ -2247,14 +2078,12 @@ static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
|
|
2247
2078
|
NUM2UINT(screen),
|
2248
2079
|
ruby_libvirt_value_to_uint(flags));
|
2249
2080
|
}
|
2250
|
-
#endif
|
2251
2081
|
|
2252
|
-
#if HAVE_VIRDOMAININJECTNMI
|
2253
2082
|
/*
|
2254
2083
|
* call-seq:
|
2255
2084
|
* dom.inject_nmi(flags=0) -> nil
|
2256
2085
|
*
|
2257
|
-
* Call virDomainInjectNMI[
|
2086
|
+
* Call virDomainInjectNMI[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI]
|
2258
2087
|
* to send an NMI to the guest.
|
2259
2088
|
*/
|
2260
2089
|
static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
|
@@ -2268,14 +2097,12 @@ static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
|
|
2268
2097
|
ruby_libvirt_domain_get(d),
|
2269
2098
|
ruby_libvirt_value_to_uint(flags));
|
2270
2099
|
}
|
2271
|
-
#endif
|
2272
2100
|
|
2273
|
-
#if HAVE_VIRDOMAINGETCONTROLINFO
|
2274
2101
|
/*
|
2275
2102
|
* call-seq:
|
2276
2103
|
* dom.control_info(flags=0) -> Libvirt::Domain::ControlInfo
|
2277
2104
|
*
|
2278
|
-
* Call virDomainGetControlInfo[
|
2105
|
+
* Call virDomainGetControlInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetControlInfo]
|
2279
2106
|
* to retrieve domain control interface information.
|
2280
2107
|
*/
|
2281
2108
|
static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
|
@@ -2299,14 +2126,12 @@ static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
|
|
2299
2126
|
|
2300
2127
|
return result;
|
2301
2128
|
}
|
2302
|
-
#endif
|
2303
2129
|
|
2304
|
-
#if HAVE_VIRDOMAINSENDKEY
|
2305
2130
|
/*
|
2306
2131
|
* call-seq:
|
2307
2132
|
* dom.send_key(codeset, holdtime, keycodes)
|
2308
2133
|
*
|
2309
|
-
* Call virDomainSendKey[
|
2134
|
+
* Call virDomainSendKey[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey]
|
2310
2135
|
* to send key(s) to the domain. Keycodes has to be an array of keys to send.
|
2311
2136
|
*/
|
2312
2137
|
VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
|
@@ -2329,14 +2154,12 @@ VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
|
|
2329
2154
|
NUM2UINT(codeset), NUM2UINT(holdtime), codes,
|
2330
2155
|
RARRAY_LEN(keycodes), 0);
|
2331
2156
|
}
|
2332
|
-
#endif
|
2333
2157
|
|
2334
|
-
#if HAVE_VIRDOMAINMIGRATEGETMAXSPEED
|
2335
2158
|
/*
|
2336
2159
|
* call-seq:
|
2337
2160
|
* dom.migrate_max_speed(flags=0) -> Fixnum
|
2338
2161
|
*
|
2339
|
-
* Call virDomainMigrateGetMaxSpeed[
|
2162
|
+
* Call virDomainMigrateGetMaxSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxSpeed]
|
2340
2163
|
* to retrieve the maximum speed a migration can use.
|
2341
2164
|
*/
|
2342
2165
|
static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
|
@@ -2355,14 +2178,12 @@ static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
|
|
2355
2178
|
|
2356
2179
|
return ULONG2NUM(bandwidth);
|
2357
2180
|
}
|
2358
|
-
#endif
|
2359
2181
|
|
2360
|
-
#if HAVE_VIRDOMAINRESET
|
2361
2182
|
/*
|
2362
2183
|
* call-seq:
|
2363
2184
|
* dom.reset(flags=0) -> nil
|
2364
2185
|
*
|
2365
|
-
* Call virDomainReset[
|
2186
|
+
* Call virDomainReset[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset]
|
2366
2187
|
* to reset a domain immediately.
|
2367
2188
|
*/
|
2368
2189
|
static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
|
@@ -2375,14 +2196,12 @@ static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
|
|
2375
2196
|
ruby_libvirt_domain_get(d),
|
2376
2197
|
ruby_libvirt_value_to_uint(flags));
|
2377
2198
|
}
|
2378
|
-
#endif
|
2379
2199
|
|
2380
|
-
#if HAVE_VIRDOMAINGETHOSTNAME
|
2381
2200
|
/*
|
2382
2201
|
* call-seq:
|
2383
2202
|
* dom.hostname(flags=0) -> nil
|
2384
2203
|
*
|
2385
|
-
* Call virDomainGetHostname[
|
2204
|
+
* Call virDomainGetHostname[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname]
|
2386
2205
|
* to get the hostname from a domain.
|
2387
2206
|
*/
|
2388
2207
|
static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
|
@@ -2396,14 +2215,12 @@ static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
|
|
2396
2215
|
ruby_libvirt_domain_get(d),
|
2397
2216
|
ruby_libvirt_value_to_uint(flags));
|
2398
2217
|
}
|
2399
|
-
#endif
|
2400
2218
|
|
2401
|
-
#if HAVE_VIRDOMAINGETMETADATA
|
2402
2219
|
/*
|
2403
2220
|
* call-seq:
|
2404
2221
|
* dom.metadata(type, uri=nil, flags=0) -> String
|
2405
2222
|
*
|
2406
|
-
* Call virDomainGetMetadata[
|
2223
|
+
* Call virDomainGetMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata]
|
2407
2224
|
* to get the metadata from a domain.
|
2408
2225
|
*/
|
2409
2226
|
static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
|
@@ -2418,14 +2235,12 @@ static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
|
|
2418
2235
|
ruby_libvirt_get_cstring_or_null(uri),
|
2419
2236
|
ruby_libvirt_value_to_uint(flags));
|
2420
2237
|
}
|
2421
|
-
#endif
|
2422
2238
|
|
2423
|
-
#if HAVE_VIRDOMAINSETMETADATA
|
2424
2239
|
/*
|
2425
2240
|
* call-seq:
|
2426
2241
|
* dom.metadata = Fixnum,string/nil,key=nil,uri=nil,flags=0 -> nil
|
2427
2242
|
*
|
2428
|
-
* Call virDomainSetMetadata[
|
2243
|
+
* Call virDomainSetMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata]
|
2429
2244
|
* to set the metadata for a domain.
|
2430
2245
|
*/
|
2431
2246
|
static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
|
@@ -2464,14 +2279,12 @@ static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
|
|
2464
2279
|
ruby_libvirt_get_cstring_or_null(uri),
|
2465
2280
|
ruby_libvirt_value_to_uint(flags));
|
2466
2281
|
}
|
2467
|
-
#endif
|
2468
2282
|
|
2469
|
-
#if HAVE_VIRDOMAINSENDPROCESSSIGNAL
|
2470
2283
|
/*
|
2471
2284
|
* call-seq:
|
2472
2285
|
* dom.send_process_signal(pid, signum, flags=0) -> nil
|
2473
2286
|
*
|
2474
|
-
* Call virDomainSendProcessSignal[
|
2287
|
+
* Call virDomainSendProcessSignal[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal]
|
2475
2288
|
* to send a signal to a process inside the domain.
|
2476
2289
|
*/
|
2477
2290
|
static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
|
@@ -2486,14 +2299,12 @@ static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
|
|
2486
2299
|
NUM2UINT(signum),
|
2487
2300
|
ruby_libvirt_value_to_uint(flags));
|
2488
2301
|
}
|
2489
|
-
#endif
|
2490
2302
|
|
2491
|
-
#if HAVE_VIRDOMAINLISTALLSNAPSHOTS
|
2492
2303
|
/*
|
2493
2304
|
* call-seq:
|
2494
2305
|
* dom.list_all_snapshots(flags=0) -> Array
|
2495
2306
|
*
|
2496
|
-
* Call virDomainListAllSnapshots[
|
2307
|
+
* Call virDomainListAllSnapshots[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainListAllSnapshots]
|
2497
2308
|
* to get an array of snapshot objects for all snapshots.
|
2498
2309
|
*/
|
2499
2310
|
static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
|
@@ -2504,14 +2315,12 @@ static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
|
|
2504
2315
|
domain_snapshot_new,
|
2505
2316
|
virDomainSnapshotFree);
|
2506
2317
|
}
|
2507
|
-
#endif
|
2508
2318
|
|
2509
|
-
#if HAVE_VIRDOMAINSNAPSHOTNUMCHILDREN
|
2510
2319
|
/*
|
2511
2320
|
* call-seq:
|
2512
2321
|
* snapshot.num_children(flags=0) -> Fixnum
|
2513
2322
|
*
|
2514
|
-
* Call virDomainSnapshotNumChildren[
|
2323
|
+
* Call virDomainSnapshotNumChildren[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNumChildren]
|
2515
2324
|
* to get the number of children snapshots of this snapshot.
|
2516
2325
|
*/
|
2517
2326
|
static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
|
@@ -2526,14 +2335,12 @@ static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
|
|
2526
2335
|
domain_snapshot_get(s),
|
2527
2336
|
ruby_libvirt_value_to_uint(flags));
|
2528
2337
|
}
|
2529
|
-
#endif
|
2530
2338
|
|
2531
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTCHILDRENNAMES
|
2532
2339
|
/*
|
2533
2340
|
* call-seq:
|
2534
2341
|
* snapshot.list_children_names(flags=0) -> Array
|
2535
2342
|
*
|
2536
|
-
* Call virDomainSnapshotListChildrenNames[
|
2343
|
+
* Call virDomainSnapshotListChildrenNames[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListChildrenNames]
|
2537
2344
|
* to get an array of strings representing the children of this snapshot.
|
2538
2345
|
*/
|
2539
2346
|
static VALUE libvirt_domain_snapshot_list_children_names(int argc, VALUE *argv,
|
@@ -2590,14 +2397,12 @@ error:
|
|
2590
2397
|
/* not necessary, just to shut the compiler up */
|
2591
2398
|
return Qnil;
|
2592
2399
|
}
|
2593
|
-
#endif
|
2594
2400
|
|
2595
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTALLCHILDREN
|
2596
2401
|
/*
|
2597
2402
|
* call-seq:
|
2598
2403
|
* snapshot.list_all_children(flags=0) -> Array
|
2599
2404
|
*
|
2600
|
-
* Call virDomainSnapshotListAllChildren[
|
2405
|
+
* Call virDomainSnapshotListAllChildren[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListAllChildren]
|
2601
2406
|
* to get an array of snapshot objects that are children of this snapshot.
|
2602
2407
|
*/
|
2603
2408
|
static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
|
@@ -2609,14 +2414,12 @@ static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
|
|
2609
2414
|
domain_snapshot_new,
|
2610
2415
|
virDomainSnapshotFree);
|
2611
2416
|
}
|
2612
|
-
#endif
|
2613
2417
|
|
2614
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETPARENT
|
2615
2418
|
/*
|
2616
2419
|
* call-seq:
|
2617
2420
|
* snapshot.parent(flags=0) -> [Libvirt::Domain::Snapshot|nil]
|
2618
2421
|
*
|
2619
|
-
* Call virDomainSnapshotGetParent[
|
2422
|
+
* Call virDomainSnapshotGetParent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetParent]
|
2620
2423
|
* to get the parent of this snapshot (nil will be returned if this is a root
|
2621
2424
|
* snapshot).
|
2622
2425
|
*/
|
@@ -2646,14 +2449,12 @@ static VALUE libvirt_domain_snapshot_parent(int argc, VALUE *argv, VALUE s)
|
|
2646
2449
|
|
2647
2450
|
return domain_snapshot_new(snap, s);
|
2648
2451
|
}
|
2649
|
-
#endif
|
2650
2452
|
|
2651
|
-
#if HAVE_VIRDOMAINSNAPSHOTISCURRENT
|
2652
2453
|
/*
|
2653
2454
|
* call-seq:
|
2654
2455
|
* snapshot.current?(flags=0) -> [true|false]
|
2655
2456
|
*
|
2656
|
-
* Call virDomainSnapshotIsCurrent[
|
2457
|
+
* Call virDomainSnapshotIsCurrent[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotIsCurrent]
|
2657
2458
|
* to determine if the snapshot is the domain's current snapshot.
|
2658
2459
|
*/
|
2659
2460
|
static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
|
@@ -2667,14 +2468,12 @@ static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
|
|
2667
2468
|
domain_snapshot_get(s),
|
2668
2469
|
ruby_libvirt_value_to_uint(flags));
|
2669
2470
|
}
|
2670
|
-
#endif
|
2671
2471
|
|
2672
|
-
#if HAVE_VIRDOMAINSNAPSHOTHASMETADATA
|
2673
2472
|
/*
|
2674
2473
|
* call-seq:
|
2675
2474
|
* snapshot.has_metadata?(flags=0) -> [true|false]
|
2676
2475
|
*
|
2677
|
-
* Call virDomainSnapshotHasMetadata[
|
2476
|
+
* Call virDomainSnapshotHasMetadata[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotHasMetadata]
|
2678
2477
|
* to determine if the snapshot is associated with libvirt metadata.
|
2679
2478
|
*/
|
2680
2479
|
static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
|
@@ -2689,14 +2488,12 @@ static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
|
|
2689
2488
|
domain_snapshot_get(s),
|
2690
2489
|
ruby_libvirt_value_to_uint(flags));
|
2691
2490
|
}
|
2692
|
-
#endif
|
2693
2491
|
|
2694
|
-
#if HAVE_VIRDOMAINSETMEMORYSTATSPERIOD
|
2695
2492
|
/*
|
2696
2493
|
* call-seq:
|
2697
2494
|
* dom.memory_stats_period = Fixnum,flags=0
|
2698
2495
|
*
|
2699
|
-
* Call virDomainSetMemoryStatsPeriod[
|
2496
|
+
* Call virDomainSetMemoryStatsPeriod[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod]
|
2700
2497
|
* to set the memory statistics collection period.
|
2701
2498
|
*/
|
2702
2499
|
static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
|
@@ -2711,14 +2508,12 @@ static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
|
|
2711
2508
|
NUM2INT(period),
|
2712
2509
|
ruby_libvirt_value_to_uint(flags));
|
2713
2510
|
}
|
2714
|
-
#endif
|
2715
2511
|
|
2716
|
-
#if HAVE_VIRDOMAINFSTRIM
|
2717
2512
|
/*
|
2718
2513
|
* call-seq:
|
2719
2514
|
* dom.fstrim(mountpoint=nil, minimum=0, flags=0) -> nil
|
2720
2515
|
*
|
2721
|
-
* Call virDomainFSTrim[
|
2516
|
+
* Call virDomainFSTrim[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim]
|
2722
2517
|
* to call FITRIM within the guest.
|
2723
2518
|
*/
|
2724
2519
|
static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
|
@@ -2733,14 +2528,12 @@ static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
|
|
2733
2528
|
ruby_libvirt_value_to_ulonglong(minimum),
|
2734
2529
|
ruby_libvirt_value_to_uint(flags));
|
2735
2530
|
}
|
2736
|
-
#endif
|
2737
2531
|
|
2738
|
-
#if HAVE_VIRDOMAINBLOCKREBASE
|
2739
2532
|
/*
|
2740
2533
|
* call-seq:
|
2741
2534
|
* dom.block_rebase(disk, base=nil, bandwidth=0, flags=0) -> nil
|
2742
2535
|
*
|
2743
|
-
* Call virDomainBlockRebase[
|
2536
|
+
* Call virDomainBlockRebase[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase]
|
2744
2537
|
* to populate a disk image with data from its backing image chain.
|
2745
2538
|
*/
|
2746
2539
|
static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
|
@@ -2757,14 +2550,12 @@ static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
|
|
2757
2550
|
ruby_libvirt_value_to_ulong(bandwidth),
|
2758
2551
|
ruby_libvirt_value_to_uint(flags));
|
2759
2552
|
}
|
2760
|
-
#endif
|
2761
2553
|
|
2762
|
-
#if HAVE_VIRDOMAINOPENCHANNEL
|
2763
2554
|
/*
|
2764
2555
|
* call-seq:
|
2765
2556
|
* dom.open_channel(name, stream, flags=0) -> nil
|
2766
2557
|
*
|
2767
|
-
* Call virDomainOpenChannel[
|
2558
|
+
* Call virDomainOpenChannel[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenChannel]
|
2768
2559
|
* to open a channel on a guest. Note that name may be nil, in which case the
|
2769
2560
|
* first channel on the guest is opened.
|
2770
2561
|
*/
|
@@ -2781,14 +2572,12 @@ static VALUE libvirt_domain_open_channel(int argc, VALUE *argv, VALUE d)
|
|
2781
2572
|
ruby_libvirt_stream_get(st),
|
2782
2573
|
ruby_libvirt_value_to_uint(flags));
|
2783
2574
|
}
|
2784
|
-
#endif
|
2785
2575
|
|
2786
|
-
#if HAVE_VIRDOMAINCREATEWITHFILES
|
2787
2576
|
/*
|
2788
2577
|
* call-seq:
|
2789
2578
|
* dom.create_with_files(fds=nil, flags=0) -> nil
|
2790
2579
|
*
|
2791
|
-
* Call virDomainCreateWithFiles[
|
2580
|
+
* Call virDomainCreateWithFiles[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFiles]
|
2792
2581
|
* to launch a defined domain with a set of open file descriptors.
|
2793
2582
|
*/
|
2794
2583
|
static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
|
@@ -2820,14 +2609,12 @@ static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
|
|
2820
2609
|
numfiles, files,
|
2821
2610
|
ruby_libvirt_value_to_uint(flags));
|
2822
2611
|
}
|
2823
|
-
#endif
|
2824
2612
|
|
2825
|
-
#if HAVE_VIRDOMAINOPENGRAPHICS
|
2826
2613
|
/*
|
2827
2614
|
* call-seq:
|
2828
2615
|
* dom.open_graphics(fd, idx=0, flags=0) -> nil
|
2829
2616
|
*
|
2830
|
-
* Call virDomainOpenGraphics[
|
2617
|
+
* Call virDomainOpenGraphics[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphics]
|
2831
2618
|
* to connect a file descriptor to the graphics backend of the domain.
|
2832
2619
|
*/
|
2833
2620
|
static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
|
@@ -2842,14 +2629,12 @@ static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
|
|
2842
2629
|
ruby_libvirt_value_to_uint(idx), NUM2INT(fd),
|
2843
2630
|
ruby_libvirt_value_to_uint(flags));
|
2844
2631
|
}
|
2845
|
-
#endif
|
2846
2632
|
|
2847
|
-
#if HAVE_VIRDOMAINPMWAKEUP
|
2848
2633
|
/*
|
2849
2634
|
* call-seq:
|
2850
2635
|
* dom.pmwakeup(flags=0) -> nil
|
2851
2636
|
*
|
2852
|
-
* Call virDomainPMWakeup[
|
2637
|
+
* Call virDomainPMWakeup[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup]
|
2853
2638
|
* to inject a wakeup into the guest.
|
2854
2639
|
*/
|
2855
2640
|
static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
|
@@ -2863,14 +2648,12 @@ static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
|
|
2863
2648
|
ruby_libvirt_domain_get(d),
|
2864
2649
|
ruby_libvirt_value_to_uint(flags));
|
2865
2650
|
}
|
2866
|
-
#endif
|
2867
2651
|
|
2868
|
-
#if HAVE_VIRDOMAINBLOCKRESIZE
|
2869
2652
|
/*
|
2870
2653
|
* call-seq:
|
2871
2654
|
* dom.block_resize(disk, size, flags=0) -> nil
|
2872
2655
|
*
|
2873
|
-
* Call virDomainBlockResize[
|
2656
|
+
* Call virDomainBlockResize[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize]
|
2874
2657
|
* to resize a block device of domain.
|
2875
2658
|
*/
|
2876
2659
|
static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
|
@@ -2885,14 +2668,12 @@ static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
|
|
2885
2668
|
StringValueCStr(disk), NUM2ULL(size),
|
2886
2669
|
ruby_libvirt_value_to_uint(flags));
|
2887
2670
|
}
|
2888
|
-
#endif
|
2889
2671
|
|
2890
|
-
#if HAVE_VIRDOMAINPMSUSPENDFORDURATION
|
2891
2672
|
/*
|
2892
2673
|
* call-seq:
|
2893
2674
|
* dom.pmsuspend_for_duration(target, duration, flags=0) -> nil
|
2894
2675
|
*
|
2895
|
-
* Call virDomainPMSuspendForDuration[
|
2676
|
+
* Call virDomainPMSuspendForDuration[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMSuspendForDuration]
|
2896
2677
|
* to have the domain enter the target power management suspend level.
|
2897
2678
|
*/
|
2898
2679
|
static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
|
@@ -2908,14 +2689,12 @@ static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
|
|
2908
2689
|
NUM2UINT(target), NUM2ULL(duration),
|
2909
2690
|
ruby_libvirt_value_to_uint(flags));
|
2910
2691
|
}
|
2911
|
-
#endif
|
2912
2692
|
|
2913
|
-
#if HAVE_VIRDOMAINMIGRATEGETCOMPRESSIONCACHE
|
2914
2693
|
/*
|
2915
2694
|
* call-seq:
|
2916
2695
|
* dom.migrate_compression_cache(flags=0) -> Fixnum
|
2917
2696
|
*
|
2918
|
-
* Call virDomainMigrateGetCompressionCache[
|
2697
|
+
* Call virDomainMigrateGetCompressionCache[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache]
|
2919
2698
|
* to get the current size of the migration cache.
|
2920
2699
|
*/
|
2921
2700
|
static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
|
@@ -2936,14 +2715,12 @@ static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
|
|
2936
2715
|
|
2937
2716
|
return ULL2NUM(cachesize);
|
2938
2717
|
}
|
2939
|
-
#endif
|
2940
2718
|
|
2941
|
-
#if HAVE_VIRDOMAINMIGRATESETCOMPRESSIONCACHE
|
2942
2719
|
/*
|
2943
2720
|
* call-seq:
|
2944
2721
|
* dom.migrate_compression_cache = Fixnum,flags=0
|
2945
2722
|
*
|
2946
|
-
* Call virDomainMigrateSetCompressionCache[
|
2723
|
+
* Call virDomainMigrateSetCompressionCache[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache]
|
2947
2724
|
* to set the current size of the migration cache.
|
2948
2725
|
*/
|
2949
2726
|
static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
|
@@ -2958,14 +2735,12 @@ static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
|
|
2958
2735
|
NUM2ULL(cachesize),
|
2959
2736
|
ruby_libvirt_value_to_uint(flags));
|
2960
2737
|
}
|
2961
|
-
#endif
|
2962
2738
|
|
2963
|
-
#if HAVE_VIRDOMAINGETDISKERRORS
|
2964
2739
|
/*
|
2965
2740
|
* call-seq:
|
2966
2741
|
* dom.disk_errors(flags=0) -> Hash
|
2967
2742
|
*
|
2968
|
-
* Call virDomainGetDiskErrors[
|
2743
|
+
* Call virDomainGetDiskErrors[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors]
|
2969
2744
|
* to get errors on disks in the domain.
|
2970
2745
|
*/
|
2971
2746
|
static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
|
@@ -2999,14 +2774,12 @@ static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
|
|
2999
2774
|
|
3000
2775
|
return hash;
|
3001
2776
|
}
|
3002
|
-
#endif
|
3003
2777
|
|
3004
|
-
#if HAVE_VIRDOMAINGETEMULATORPININFO
|
3005
2778
|
/*
|
3006
2779
|
* call-seq:
|
3007
2780
|
* dom.emulator_pin_info(flags=0) -> Array
|
3008
2781
|
*
|
3009
|
-
* Call virDomainGetEmulatorPinInfo[
|
2782
|
+
* Call virDomainGetEmulatorPinInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo]
|
3010
2783
|
* to an array representing the mapping of emulator threads to physical CPUs.
|
3011
2784
|
* For each physical CPU in the machine, the array offset corresponding to that
|
3012
2785
|
* CPU is 'true' if an emulator thread is running on that CPU, and 'false'
|
@@ -3043,14 +2816,12 @@ static VALUE libvirt_domain_emulator_pin_info(int argc, VALUE *argv, VALUE d)
|
|
3043
2816
|
|
3044
2817
|
return emulator2cpumap;
|
3045
2818
|
}
|
3046
|
-
#endif
|
3047
2819
|
|
3048
|
-
#if HAVE_VIRDOMAINPINEMULATOR
|
3049
2820
|
/*
|
3050
2821
|
* call-seq:
|
3051
2822
|
* dom.pin_emulator(cpulist, flags=0) -> nil
|
3052
2823
|
*
|
3053
|
-
* Call virDomainPinVcpu[
|
2824
|
+
* Call virDomainPinVcpu[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
|
3054
2825
|
* to pin the emulator to a range of physical processors. The cpulist should
|
3055
2826
|
* be an array of Fixnums representing the physical processors this domain's
|
3056
2827
|
* emulator should be allowed to be scheduled on.
|
@@ -3083,14 +2854,12 @@ static VALUE libvirt_domain_pin_emulator(int argc, VALUE *argv, VALUE d)
|
|
3083
2854
|
cpumaplen,
|
3084
2855
|
ruby_libvirt_value_to_uint(flags));
|
3085
2856
|
}
|
3086
|
-
#endif
|
3087
2857
|
|
3088
|
-
#if HAVE_VIRDOMAINGETSECURITYLABELLIST
|
3089
2858
|
/*
|
3090
2859
|
* call-seq:
|
3091
2860
|
* dom.security_label_list -> [ Libvirt::Domain::SecurityLabel ]
|
3092
2861
|
*
|
3093
|
-
* Call virDomainGetSecurityLabelList[
|
2862
|
+
* Call virDomainGetSecurityLabelList[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabelList]
|
3094
2863
|
* to retrieve the security labels applied to this domain.
|
3095
2864
|
*/
|
3096
2865
|
static VALUE libvirt_domain_security_label_list(VALUE d)
|
@@ -3116,9 +2885,7 @@ static VALUE libvirt_domain_security_label_list(VALUE d)
|
|
3116
2885
|
|
3117
2886
|
return result;
|
3118
2887
|
}
|
3119
|
-
#endif
|
3120
2888
|
|
3121
|
-
#if HAVE_VIRDOMAINGETJOBSTATS
|
3122
2889
|
struct params_to_hash_arg {
|
3123
2890
|
virTypedParameterPtr params;
|
3124
2891
|
int nparams;
|
@@ -3141,7 +2908,7 @@ static VALUE params_to_hash(VALUE in)
|
|
3141
2908
|
* call-seq:
|
3142
2909
|
* dom.job_stats -> Hash
|
3143
2910
|
*
|
3144
|
-
* Call virDomainGetJobStats[
|
2911
|
+
* Call virDomainGetJobStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats]
|
3145
2912
|
* to retrieve information about progress of a background job on a domain.
|
3146
2913
|
*/
|
3147
2914
|
static VALUE libvirt_domain_job_stats(int argc, VALUE *argv, VALUE d)
|
@@ -3187,9 +2954,7 @@ static VALUE libvirt_domain_job_stats(int argc, VALUE *argv, VALUE d)
|
|
3187
2954
|
|
3188
2955
|
return result;
|
3189
2956
|
}
|
3190
|
-
#endif
|
3191
2957
|
|
3192
|
-
#if HAVE_VIRDOMAINGETBLOCKIOTUNE
|
3193
2958
|
static const char *iotune_nparams(VALUE d, unsigned int flags, void *opaque,
|
3194
2959
|
int *nparams)
|
3195
2960
|
{
|
@@ -3237,7 +3002,7 @@ static const char *iotune_set(VALUE d, unsigned int flags,
|
|
3237
3002
|
* call-seq:
|
3238
3003
|
* dom.block_iotune(disk=nil, flags=0) -> Hash
|
3239
3004
|
*
|
3240
|
-
* Call virDomainGetBlockIoTune[
|
3005
|
+
* Call virDomainGetBlockIoTune[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockIoTune]
|
3241
3006
|
* to retrieve all of the block IO tune parameters for this domain. The keys
|
3242
3007
|
* and values in the hash that is returned are hypervisor specific.
|
3243
3008
|
*/
|
@@ -3252,9 +3017,7 @@ static VALUE libvirt_domain_block_iotune(int argc, VALUE *argv, VALUE d)
|
|
3252
3017
|
(void *)disk, iotune_nparams,
|
3253
3018
|
iotune_get);
|
3254
3019
|
}
|
3255
|
-
#endif
|
3256
3020
|
|
3257
|
-
#if HAVE_VIRDOMAINSETBLOCKIOTUNE
|
3258
3021
|
static struct ruby_libvirt_typed_param iotune_allowed[] = {
|
3259
3022
|
{VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC, VIR_TYPED_PARAM_ULLONG},
|
3260
3023
|
{VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC, VIR_TYPED_PARAM_ULLONG},
|
@@ -3262,16 +3025,14 @@ static struct ruby_libvirt_typed_param iotune_allowed[] = {
|
|
3262
3025
|
{VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
|
3263
3026
|
{VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
|
3264
3027
|
{VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
|
3265
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC
|
3266
3028
|
{VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
|
3267
|
-
#endif
|
3268
3029
|
};
|
3269
3030
|
|
3270
3031
|
/*
|
3271
3032
|
* call-seq:
|
3272
3033
|
* dom.block_iotune = disk,Hash,flags=0
|
3273
3034
|
*
|
3274
|
-
* Call virDomainSetBlockIoTune[
|
3035
|
+
* Call virDomainSetBlockIoTune[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune]
|
3275
3036
|
* to set the block IO tune parameters for the supplied disk on this domain.
|
3276
3037
|
* The keys and values in the input hash are hypervisor specific.
|
3277
3038
|
*/
|
@@ -3301,14 +3062,12 @@ static VALUE libvirt_domain_block_iotune_equal(VALUE d, VALUE in)
|
|
3301
3062
|
ARRAY_SIZE(iotune_allowed),
|
3302
3063
|
iotune_set);
|
3303
3064
|
}
|
3304
|
-
#endif
|
3305
3065
|
|
3306
|
-
#if HAVE_VIRDOMAINBLOCKCOMMIT
|
3307
3066
|
/*
|
3308
3067
|
* call-seq:
|
3309
3068
|
* dom.block_commit(disk, base=nil, top=nil, bandwidth=0, flags=0) -> nil
|
3310
3069
|
*
|
3311
|
-
* Call virDomainBlockCommit[
|
3070
|
+
* Call virDomainBlockCommit[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit]
|
3312
3071
|
* to commit changes from a top-level backing file into a lower level base file.
|
3313
3072
|
*/
|
3314
3073
|
static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
|
@@ -3326,14 +3085,12 @@ static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
|
|
3326
3085
|
ruby_libvirt_value_to_ulong(bandwidth),
|
3327
3086
|
ruby_libvirt_value_to_uint(flags));
|
3328
3087
|
}
|
3329
|
-
#endif
|
3330
3088
|
|
3331
|
-
#if HAVE_VIRDOMAINBLOCKPULL
|
3332
3089
|
/*
|
3333
3090
|
* call-seq:
|
3334
3091
|
* dom.block_pull(disk, bandwidth=0, flags=0) -> nil
|
3335
3092
|
*
|
3336
|
-
* Call virDomainBlockPull[
|
3093
|
+
* Call virDomainBlockPull[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull]
|
3337
3094
|
* to pull changes from a backing file into a disk image.
|
3338
3095
|
*/
|
3339
3096
|
static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
|
@@ -3349,14 +3106,12 @@ static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
|
|
3349
3106
|
ruby_libvirt_value_to_ulong(bandwidth),
|
3350
3107
|
ruby_libvirt_value_to_uint(flags));
|
3351
3108
|
}
|
3352
|
-
#endif
|
3353
3109
|
|
3354
|
-
#if HAVE_VIRDOMAINBLOCKJOBSETSPEED
|
3355
3110
|
/*
|
3356
3111
|
* call-seq:
|
3357
3112
|
* dom.block_job_speed = disk,bandwidth=0,flags=0
|
3358
3113
|
*
|
3359
|
-
* Call virDomainBlockJobSetSpeed[
|
3114
|
+
* Call virDomainBlockJobSetSpeed[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobSetSpeed]
|
3360
3115
|
* to set the maximum allowable bandwidth a block job may consume.
|
3361
3116
|
*/
|
3362
3117
|
static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
|
@@ -3395,14 +3150,12 @@ static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
|
|
3395
3150
|
StringValueCStr(disk),
|
3396
3151
|
NUM2UINT(bandwidth), NUM2UINT(flags));
|
3397
3152
|
}
|
3398
|
-
#endif
|
3399
3153
|
|
3400
|
-
#if HAVE_VIRDOMAINGETBLOCKJOBINFO
|
3401
3154
|
/*
|
3402
3155
|
* call-seq:
|
3403
3156
|
* dom.block_job_info(disk, flags=0) -> Libvirt::Domain::BlockJobInfo
|
3404
3157
|
*
|
3405
|
-
* Call virDomainGetBlockJobInfo[
|
3158
|
+
* Call virDomainGetBlockJobInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo]
|
3406
3159
|
* to get block job information for a given disk.
|
3407
3160
|
*/
|
3408
3161
|
static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
|
@@ -3430,14 +3183,12 @@ static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
|
|
3430
3183
|
|
3431
3184
|
return result;
|
3432
3185
|
}
|
3433
|
-
#endif
|
3434
3186
|
|
3435
|
-
#if HAVE_VIRDOMAINBLOCKJOBABORT
|
3436
3187
|
/*
|
3437
3188
|
* call-seq:
|
3438
3189
|
* dom.block_job_abort(disk, flags=0) -> nil
|
3439
3190
|
*
|
3440
|
-
* Call virDomainBlockJobAbort[
|
3191
|
+
* Call virDomainBlockJobAbort[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbort]
|
3441
3192
|
* to cancel an active block job on the given disk.
|
3442
3193
|
*/
|
3443
3194
|
static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
|
@@ -3452,9 +3203,7 @@ static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
|
|
3452
3203
|
StringValueCStr(disk),
|
3453
3204
|
ruby_libvirt_value_to_uint(flags));
|
3454
3205
|
}
|
3455
|
-
#endif
|
3456
3206
|
|
3457
|
-
#if HAVE_VIRDOMAINGETINTERFACEPARAMETERS
|
3458
3207
|
static const char *interface_nparams(VALUE d, unsigned int flags, void *opaque,
|
3459
3208
|
int *nparams)
|
3460
3209
|
{
|
@@ -3502,7 +3251,7 @@ static const char *interface_set(VALUE d, unsigned int flags,
|
|
3502
3251
|
* call-seq:
|
3503
3252
|
* dom.interface_parameters(interface, flags=0) -> Hash
|
3504
3253
|
*
|
3505
|
-
* Call virDomainGetInterfaceParameters[
|
3254
|
+
* Call virDomainGetInterfaceParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters]
|
3506
3255
|
* to retrieve the interface parameters for the given interface on this domain.
|
3507
3256
|
* The keys and values in the hash that is returned are hypervisor specific.
|
3508
3257
|
*/
|
@@ -3533,7 +3282,7 @@ static struct ruby_libvirt_typed_param interface_allowed[] = {
|
|
3533
3282
|
* call-seq:
|
3534
3283
|
* dom.interface_parameters = device,Hash,flags=0
|
3535
3284
|
*
|
3536
|
-
* Call virDomainSetInterfaceParameters[
|
3285
|
+
* Call virDomainSetInterfaceParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters]
|
3537
3286
|
* to set the interface parameters for the supplied device on this domain.
|
3538
3287
|
* The keys and values in the input hash are hypervisor specific.
|
3539
3288
|
*/
|
@@ -3564,9 +3313,7 @@ static VALUE libvirt_domain_interface_parameters_equal(VALUE d, VALUE in)
|
|
3564
3313
|
ARRAY_SIZE(interface_allowed),
|
3565
3314
|
interface_set);
|
3566
3315
|
}
|
3567
|
-
#endif
|
3568
3316
|
|
3569
|
-
#if HAVE_VIRDOMAINBLOCKSTATSFLAGS
|
3570
3317
|
static const char *block_stats_nparams(VALUE d, unsigned int flags,
|
3571
3318
|
void *opaque, int *nparams)
|
3572
3319
|
{
|
@@ -3599,7 +3346,7 @@ static const char *block_stats_get(VALUE d, unsigned int flags,
|
|
3599
3346
|
* call-seq:
|
3600
3347
|
* dom.block_stats_flags(disk, flags=0) -> Hash
|
3601
3348
|
*
|
3602
|
-
* Call virDomainGetBlockStatsFlags[
|
3349
|
+
* Call virDomainGetBlockStatsFlags[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockStatsFlags]
|
3603
3350
|
* to retrieve the block statistics for the given disk on this domain.
|
3604
3351
|
* The keys and values in the hash that is returned are hypervisor specific.
|
3605
3352
|
*/
|
@@ -3617,9 +3364,7 @@ static VALUE libvirt_domain_block_stats_flags(int argc, VALUE *argv, VALUE d)
|
|
3617
3364
|
block_stats_nparams,
|
3618
3365
|
block_stats_get);
|
3619
3366
|
}
|
3620
|
-
#endif
|
3621
3367
|
|
3622
|
-
#if HAVE_VIRDOMAINGETNUMAPARAMETERS
|
3623
3368
|
static const char *numa_nparams(VALUE d, unsigned int flags,
|
3624
3369
|
void *RUBY_LIBVIRT_UNUSED(opaque),
|
3625
3370
|
int *nparams)
|
@@ -3660,7 +3405,7 @@ static const char *numa_set(VALUE d, unsigned int flags,
|
|
3660
3405
|
* call-seq:
|
3661
3406
|
* dom.numa_parameters(flags=0) -> Hash
|
3662
3407
|
*
|
3663
|
-
* Call virDomainGetNumaParameters[
|
3408
|
+
* Call virDomainGetNumaParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters]
|
3664
3409
|
* to retrieve the numa parameters for this domain. The keys and values in
|
3665
3410
|
* the hash that is returned are hypervisor specific.
|
3666
3411
|
*/
|
@@ -3684,7 +3429,7 @@ static struct ruby_libvirt_typed_param numa_allowed[] = {
|
|
3684
3429
|
* call-seq:
|
3685
3430
|
* dom.numa_parameters = Hash,flags=0
|
3686
3431
|
*
|
3687
|
-
* Call virDomainSetNumaParameters[
|
3432
|
+
* Call virDomainSetNumaParameters[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetNumaParameters]
|
3688
3433
|
* to set the numa parameters for this domain. The keys and values in the input
|
3689
3434
|
* hash are hypervisor specific.
|
3690
3435
|
*/
|
@@ -3700,14 +3445,12 @@ static VALUE libvirt_domain_numa_parameters_equal(VALUE d, VALUE in)
|
|
3700
3445
|
ARRAY_SIZE(numa_allowed),
|
3701
3446
|
numa_set);
|
3702
3447
|
}
|
3703
|
-
#endif
|
3704
3448
|
|
3705
|
-
#if HAVE_VIRDOMAINLXCOPENNAMESPACE
|
3706
3449
|
/*
|
3707
3450
|
* call-seq:
|
3708
3451
|
* dom.lxc_open_namespace(flags=0) -> Array
|
3709
3452
|
*
|
3710
|
-
* Call virDomainLxcOpenNamespace[
|
3453
|
+
* Call virDomainLxcOpenNamespace[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcOpenNamespace]
|
3711
3454
|
* to open an LXC namespace. Note that this will only work on connections to
|
3712
3455
|
* the LXC driver. The call will return an array of open file descriptors;
|
3713
3456
|
* these should be closed when use of them is finished.
|
@@ -3757,14 +3500,12 @@ error:
|
|
3757
3500
|
free(fdlist);
|
3758
3501
|
rb_jump_tag(exception);
|
3759
3502
|
}
|
3760
|
-
#endif
|
3761
3503
|
|
3762
|
-
#if HAVE_VIRDOMAINQEMUAGENTCOMMAND
|
3763
3504
|
/*
|
3764
3505
|
* call-seq:
|
3765
3506
|
* dom.qemu_agent_command(command, timeout=0, flags=0) -> String
|
3766
3507
|
*
|
3767
|
-
* Call virDomainQemuAgentCommand[
|
3508
|
+
* Call virDomainQemuAgentCommand[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainQemuAgentCommand]
|
3768
3509
|
* to run an arbitrary command on the Qemu Agent.
|
3769
3510
|
*/
|
3770
3511
|
static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
|
@@ -3775,6 +3516,10 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
|
|
3775
3516
|
|
3776
3517
|
rb_scan_args(argc, argv, "12", &command, &timeout, &flags);
|
3777
3518
|
|
3519
|
+
if (NIL_P(timeout)) {
|
3520
|
+
timeout = INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT);
|
3521
|
+
}
|
3522
|
+
|
3778
3523
|
ret = virDomainQemuAgentCommand(ruby_libvirt_domain_get(d),
|
3779
3524
|
StringValueCStr(command),
|
3780
3525
|
ruby_libvirt_value_to_int(timeout),
|
@@ -3791,14 +3536,12 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
|
|
3791
3536
|
|
3792
3537
|
return result;
|
3793
3538
|
}
|
3794
|
-
#endif
|
3795
3539
|
|
3796
|
-
#if HAVE_VIRDOMAINLXCENTERNAMESPACE
|
3797
3540
|
/*
|
3798
3541
|
* call-seq:
|
3799
3542
|
* dom.lxc_enter_namespace(fds, flags=0) -> Array
|
3800
3543
|
*
|
3801
|
-
* Call virDomainLxcEnterNamespace[
|
3544
|
+
* Call virDomainLxcEnterNamespace[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcEnterNamespace]
|
3802
3545
|
* to attach the process to the namespaces associated with the file descriptors
|
3803
3546
|
* in the fds array. Note that this call does not actually enter the namespace;
|
3804
3547
|
* the next call to fork will do that. Also note that this function will return
|
@@ -3857,25 +3600,21 @@ static VALUE libvirt_domain_lxc_enter_namespace(int argc, VALUE *argv, VALUE d)
|
|
3857
3600
|
|
3858
3601
|
return result;
|
3859
3602
|
}
|
3860
|
-
#endif
|
3861
3603
|
|
3862
|
-
#if HAVE_VIRDOMAINMIGRATE3
|
3863
3604
|
static struct ruby_libvirt_typed_param migrate3_allowed[] = {
|
3864
3605
|
{VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING},
|
3865
3606
|
{VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING},
|
3866
3607
|
{VIR_MIGRATE_PARAM_DEST_XML, VIR_TYPED_PARAM_STRING},
|
3867
3608
|
{VIR_MIGRATE_PARAM_BANDWIDTH, VIR_TYPED_PARAM_ULLONG},
|
3868
3609
|
{VIR_MIGRATE_PARAM_GRAPHICS_URI, VIR_TYPED_PARAM_STRING},
|
3869
|
-
#if HAVE_CONST_VIR_MIGRATE_PARAM_LISTEN_ADDRESS
|
3870
3610
|
{VIR_MIGRATE_PARAM_LISTEN_ADDRESS, VIR_TYPED_PARAM_STRING},
|
3871
|
-
#endif
|
3872
3611
|
};
|
3873
3612
|
|
3874
3613
|
/*
|
3875
3614
|
* call-seq:
|
3876
3615
|
* dom.migrate3(dconn, Hash=nil, flags=0) -> Libvirt::Domain
|
3877
3616
|
*
|
3878
|
-
* Call virDomainMigrate3[
|
3617
|
+
* Call virDomainMigrate3[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3]
|
3879
3618
|
* to migrate a domain from the host on this connection to the connection
|
3880
3619
|
* referenced in dconn.
|
3881
3620
|
*/
|
@@ -3919,7 +3658,7 @@ static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
|
|
3919
3658
|
* call-seq:
|
3920
3659
|
* dom.migrate_to_uri3(duri=nil, Hash=nil, flags=0) -> nil
|
3921
3660
|
*
|
3922
|
-
* Call virDomainMigrateToURI3[
|
3661
|
+
* Call virDomainMigrateToURI3[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3]
|
3923
3662
|
* to migrate a domain from the host on this connection to the host whose
|
3924
3663
|
* libvirt URI is duri.
|
3925
3664
|
*/
|
@@ -3955,14 +3694,12 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
|
|
3955
3694
|
args.params, args.i,
|
3956
3695
|
ruby_libvirt_value_to_ulong(flags));
|
3957
3696
|
}
|
3958
|
-
#endif
|
3959
3697
|
|
3960
|
-
#if HAVE_VIRDOMAINGETCPUSTATS
|
3961
3698
|
/*
|
3962
3699
|
* call-seq:
|
3963
3700
|
* dom.cpu_stats(start_cpu=-1, numcpus=1, flags=0) -> Hash
|
3964
3701
|
*
|
3965
|
-
* Call virDomainGetCPUStats[
|
3702
|
+
* Call virDomainGetCPUStats[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetCPUStats]
|
3966
3703
|
* to get statistics about CPU usage attributable to a single domain. If
|
3967
3704
|
* start_cpu is -1, then numcpus must be 1 and statistics attributable to the
|
3968
3705
|
* entire domain is returned. If start_cpu is any positive number, then it
|
@@ -4048,13 +3785,11 @@ static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
|
|
4048
3785
|
|
4049
3786
|
return result;
|
4050
3787
|
}
|
4051
|
-
#endif
|
4052
3788
|
|
4053
|
-
#if HAVE_VIRDOMAINGETTIME
|
4054
3789
|
/*
|
4055
3790
|
* call-seq:
|
4056
3791
|
* dom.time(flags=0) -> Hash
|
4057
|
-
* Call virDomainGetTime[
|
3792
|
+
* Call virDomainGetTime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime]
|
4058
3793
|
* to get information about the guest time.
|
4059
3794
|
*/
|
4060
3795
|
static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
|
@@ -4077,13 +3812,11 @@ static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
|
|
4077
3812
|
|
4078
3813
|
return result;
|
4079
3814
|
}
|
4080
|
-
#endif
|
4081
3815
|
|
4082
|
-
#if HAVE_VIRDOMAINSETTIME
|
4083
3816
|
/*
|
4084
3817
|
* call-seq:
|
4085
3818
|
* dom.time = Hash,flags=0
|
4086
|
-
* Call virDomainSetTime[
|
3819
|
+
* Call virDomainSetTime[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetTime]
|
4087
3820
|
* to set guest time.
|
4088
3821
|
*/
|
4089
3822
|
static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
|
@@ -4101,14 +3834,12 @@ static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
|
|
4101
3834
|
NUM2LL(seconds), NUM2UINT(nseconds),
|
4102
3835
|
NUM2UINT(flags));
|
4103
3836
|
}
|
4104
|
-
#endif
|
4105
3837
|
|
4106
|
-
#if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
|
4107
3838
|
/*
|
4108
3839
|
* call-seq:
|
4109
3840
|
* dom.core_dump_with_format(filename, dumpformat, flags=0) -> nil
|
4110
3841
|
*
|
4111
|
-
* Call virDomainCoreDumpWithFormat[
|
3842
|
+
* Call virDomainCoreDumpWithFormat[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump]
|
4112
3843
|
* to do a full memory dump of the domain to filename.
|
4113
3844
|
*/
|
4114
3845
|
static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d)
|
@@ -4124,14 +3855,12 @@ static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d
|
|
4124
3855
|
NUM2UINT(dumpformat),
|
4125
3856
|
ruby_libvirt_value_to_uint(flags));
|
4126
3857
|
}
|
4127
|
-
#endif
|
4128
3858
|
|
4129
|
-
#if HAVE_VIRDOMAINFSFREEZE
|
4130
3859
|
/*
|
4131
3860
|
* call-seq:
|
4132
3861
|
* dom.fs_freeze(mountpoints=nil, flags=0) -> Fixnum
|
4133
3862
|
*
|
4134
|
-
* Call virDomainFSFreeze[
|
3863
|
+
* Call virDomainFSFreeze[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSFreeze]
|
4135
3864
|
* to freeze the specified filesystems within the guest.
|
4136
3865
|
*/
|
4137
3866
|
static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
|
@@ -4165,14 +3894,12 @@ static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
|
|
4165
3894
|
mnt, nmountpoints,
|
4166
3895
|
ruby_libvirt_value_to_uint(flags));
|
4167
3896
|
}
|
4168
|
-
#endif
|
4169
3897
|
|
4170
|
-
#if HAVE_VIRDOMAINFSTHAW
|
4171
3898
|
/*
|
4172
3899
|
* call-seq:
|
4173
3900
|
* dom.fs_thaw(mountpoints=nil, flags=0) -> Fixnum
|
4174
3901
|
*
|
4175
|
-
* Call virDomainFSThaw[
|
3902
|
+
* Call virDomainFSThaw[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw]
|
4176
3903
|
* to thaw the specified filesystems within the guest.
|
4177
3904
|
*/
|
4178
3905
|
static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
|
@@ -4206,9 +3933,7 @@ static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
|
|
4206
3933
|
mnt, nmountpoints,
|
4207
3934
|
ruby_libvirt_value_to_uint(flags));
|
4208
3935
|
}
|
4209
|
-
#endif
|
4210
3936
|
|
4211
|
-
#if HAVE_VIRDOMAINGETFSINFO
|
4212
3937
|
struct fs_info_arg {
|
4213
3938
|
virDomainFSInfoPtr *info;
|
4214
3939
|
int ninfo;
|
@@ -4247,7 +3972,7 @@ static VALUE fs_info_wrap(VALUE arg)
|
|
4247
3972
|
* call-seq:
|
4248
3973
|
* dom.fs_info(flags=0) -> [Hash]
|
4249
3974
|
*
|
4250
|
-
* Call virDomainGetFSInfo[
|
3975
|
+
* Call virDomainGetFSInfo[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetFSInfo]
|
4251
3976
|
* to get information about the guest filesystems.
|
4252
3977
|
*/
|
4253
3978
|
static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
|
@@ -4279,14 +4004,12 @@ static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
|
|
4279
4004
|
|
4280
4005
|
return result;
|
4281
4006
|
}
|
4282
|
-
#endif
|
4283
4007
|
|
4284
|
-
#if HAVE_VIRDOMAINRENAME
|
4285
4008
|
/*
|
4286
4009
|
* call-seq:
|
4287
4010
|
* dom.rename(name, flags=0) -> nil
|
4288
4011
|
*
|
4289
|
-
* Call virDomainRename[
|
4012
|
+
* Call virDomainRename[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainRename]
|
4290
4013
|
* to rename a domain.
|
4291
4014
|
*/
|
4292
4015
|
static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
|
@@ -4301,14 +4024,12 @@ static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
|
|
4301
4024
|
StringValueCStr(name),
|
4302
4025
|
ruby_libvirt_value_to_uint(flags));
|
4303
4026
|
}
|
4304
|
-
#endif
|
4305
4027
|
|
4306
|
-
#if HAVE_VIRDOMAINSETUSERPASSWORD
|
4307
4028
|
/*
|
4308
4029
|
* call-seq:
|
4309
4030
|
* dom.user_password = user,password,flags=0 -> nil
|
4310
4031
|
*
|
4311
|
-
* Call virDomainSetUserPassword[
|
4032
|
+
* Call virDomainSetUserPassword[https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword]
|
4312
4033
|
* to set the user password on a domain.
|
4313
4034
|
*/
|
4314
4035
|
static VALUE libvirt_domain_user_password_equal(VALUE d, VALUE in)
|
@@ -4339,7 +4060,6 @@ static VALUE libvirt_domain_user_password_equal(VALUE d, VALUE in)
|
|
4339
4060
|
StringValueCStr(password),
|
4340
4061
|
ruby_libvirt_value_to_uint(flags));
|
4341
4062
|
}
|
4342
|
-
#endif
|
4343
4063
|
|
4344
4064
|
/*
|
4345
4065
|
* Class Libvirt::Domain
|
@@ -4355,67 +4075,35 @@ void ruby_libvirt_domain_init(void)
|
|
4355
4075
|
rb_define_const(c_domain, "SHUTDOWN", INT2NUM(VIR_DOMAIN_SHUTDOWN));
|
4356
4076
|
rb_define_const(c_domain, "SHUTOFF", INT2NUM(VIR_DOMAIN_SHUTOFF));
|
4357
4077
|
rb_define_const(c_domain, "CRASHED", INT2NUM(VIR_DOMAIN_CRASHED));
|
4358
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED
|
4359
4078
|
rb_define_const(c_domain, "PMSUSPENDED", INT2NUM(VIR_DOMAIN_PMSUSPENDED));
|
4360
|
-
#endif
|
4361
4079
|
|
4362
4080
|
/* virDomainMigrateFlags */
|
4363
|
-
#if HAVE_CONST_VIR_MIGRATE_LIVE
|
4364
4081
|
rb_define_const(c_domain, "MIGRATE_LIVE", INT2NUM(VIR_MIGRATE_LIVE));
|
4365
|
-
#endif
|
4366
|
-
#if HAVE_CONST_VIR_MIGRATE_PEER2PEER
|
4367
4082
|
rb_define_const(c_domain, "MIGRATE_PEER2PEER",
|
4368
4083
|
INT2NUM(VIR_MIGRATE_PEER2PEER));
|
4369
|
-
#endif
|
4370
|
-
#if HAVE_CONST_VIR_MIGRATE_TUNNELLED
|
4371
4084
|
rb_define_const(c_domain, "MIGRATE_TUNNELLED",
|
4372
4085
|
INT2NUM(VIR_MIGRATE_TUNNELLED));
|
4373
|
-
#endif
|
4374
|
-
#if HAVE_CONST_VIR_MIGRATE_PERSIST_DEST
|
4375
4086
|
rb_define_const(c_domain, "MIGRATE_PERSIST_DEST",
|
4376
4087
|
INT2NUM(VIR_MIGRATE_PERSIST_DEST));
|
4377
|
-
#endif
|
4378
|
-
#if HAVE_CONST_VIR_MIGRATE_UNDEFINE_SOURCE
|
4379
4088
|
rb_define_const(c_domain, "MIGRATE_UNDEFINE_SOURCE",
|
4380
4089
|
INT2NUM(VIR_MIGRATE_UNDEFINE_SOURCE));
|
4381
|
-
#endif
|
4382
|
-
#if HAVE_CONST_VIR_MIGRATE_PAUSED
|
4383
4090
|
rb_define_const(c_domain, "MIGRATE_PAUSED", INT2NUM(VIR_MIGRATE_PAUSED));
|
4384
|
-
#endif
|
4385
|
-
#if HAVE_CONST_VIR_MIGRATE_NON_SHARED_DISK
|
4386
4091
|
rb_define_const(c_domain, "MIGRATE_NON_SHARED_DISK",
|
4387
4092
|
INT2NUM(VIR_MIGRATE_NON_SHARED_DISK));
|
4388
|
-
#endif
|
4389
|
-
#if HAVE_CONST_VIR_MIGRATE_NON_SHARED_INC
|
4390
4093
|
rb_define_const(c_domain, "MIGRATE_NON_SHARED_INC",
|
4391
4094
|
INT2NUM(VIR_MIGRATE_NON_SHARED_INC));
|
4392
|
-
#endif
|
4393
|
-
#if HAVE_CONST_VIR_MIGRATE_CHANGE_PROTECTION
|
4394
4095
|
rb_define_const(c_domain, "MIGRATE_CHANGE_PROTECTION",
|
4395
4096
|
INT2NUM(VIR_MIGRATE_CHANGE_PROTECTION));
|
4396
|
-
#endif
|
4397
|
-
#if HAVE_CONST_VIR_MIGRATE_UNSAFE
|
4398
4097
|
rb_define_const(c_domain, "MIGRATE_UNSAFE", INT2NUM(VIR_MIGRATE_UNSAFE));
|
4399
|
-
#endif
|
4400
|
-
#if HAVE_CONST_VIR_MIGRATE_OFFLINE
|
4401
4098
|
rb_define_const(c_domain, "MIGRATE_OFFLINE", INT2NUM(VIR_MIGRATE_OFFLINE));
|
4402
|
-
#endif
|
4403
|
-
#if HAVE_CONST_VIR_MIGRATE_COMPRESSED
|
4404
4099
|
rb_define_const(c_domain, "MIGRATE_COMPRESSED",
|
4405
4100
|
INT2NUM(VIR_MIGRATE_COMPRESSED));
|
4406
|
-
#endif
|
4407
|
-
#if HAVE_CONST_VIR_MIGRATE_ABORT_ON_ERROR
|
4408
4101
|
rb_define_const(c_domain, "MIGRATE_ABORT_ON_ERROR",
|
4409
4102
|
INT2NUM(VIR_MIGRATE_ABORT_ON_ERROR));
|
4410
|
-
#endif
|
4411
|
-
#if HAVE_CONST_VIR_MIGRATE_AUTO_CONVERGE
|
4412
4103
|
rb_define_const(c_domain, "MIGRATE_AUTO_CONVERGE",
|
4413
4104
|
INT2NUM(VIR_MIGRATE_AUTO_CONVERGE));
|
4414
|
-
#endif
|
4415
|
-
#if HAVE_CONST_VIR_MIGRATE_RDMA_PIN_ALL
|
4416
4105
|
rb_define_const(c_domain, "MIGRATE_RDMA_PIN_ALL",
|
4417
4106
|
INT2NUM(VIR_MIGRATE_RDMA_PIN_ALL));
|
4418
|
-
#endif
|
4419
4107
|
|
4420
4108
|
/* Ideally we would just have the "XML_SECURE" constant. Unfortunately
|
4421
4109
|
* we screwed up long ago, and we have to leave "DOMAIN_XML_SECURE" for
|
@@ -4431,7 +4119,6 @@ void ruby_libvirt_domain_init(void)
|
|
4431
4119
|
rb_define_const(c_domain, "XML_INACTIVE", INT2NUM(VIR_DOMAIN_XML_INACTIVE));
|
4432
4120
|
rb_define_const(c_domain, "DOMAIN_XML_INACTIVE",
|
4433
4121
|
INT2NUM(VIR_DOMAIN_XML_INACTIVE));
|
4434
|
-
#if HAVE_CONST_VIR_DOMAIN_XML_UPDATE_CPU
|
4435
4122
|
/* Ideally we would just have the "XML_UPDATE_CPU" constant. Unfortunately
|
4436
4123
|
* we screwed up long ago, and we have to leave "DOMAIN_XML_UPDATE_CPU" for
|
4437
4124
|
* backwards compatibility.
|
@@ -4440,77 +4127,39 @@ void ruby_libvirt_domain_init(void)
|
|
4440
4127
|
INT2NUM(VIR_DOMAIN_XML_UPDATE_CPU));
|
4441
4128
|
rb_define_const(c_domain, "DOMAIN_XML_UPDATE_CPU",
|
4442
4129
|
INT2NUM(VIR_DOMAIN_XML_UPDATE_CPU));
|
4443
|
-
#endif
|
4444
|
-
#if HAVE_CONST_VIR_DOMAIN_XML_MIGRATABLE
|
4445
4130
|
rb_define_const(c_domain, "XML_MIGRATABLE",
|
4446
4131
|
INT2NUM(VIR_DOMAIN_XML_MIGRATABLE));
|
4447
|
-
#endif
|
4448
|
-
#if HAVE_VIRDOMAINMEMORYPEEK
|
4449
4132
|
rb_define_const(c_domain, "MEMORY_VIRTUAL", INT2NUM(VIR_MEMORY_VIRTUAL));
|
4450
|
-
#endif
|
4451
|
-
#if HAVE_CONST_VIR_MEMORY_PHYSICAL
|
4452
4133
|
rb_define_const(c_domain, "MEMORY_PHYSICAL", INT2NUM(VIR_MEMORY_PHYSICAL));
|
4453
|
-
#endif
|
4454
4134
|
|
4455
|
-
#if HAVE_CONST_VIR_DOMAIN_START_PAUSED
|
4456
4135
|
rb_define_const(c_domain, "START_PAUSED", INT2NUM(VIR_DOMAIN_START_PAUSED));
|
4457
|
-
#endif
|
4458
4136
|
|
4459
|
-
#if HAVE_CONST_VIR_DOMAIN_START_AUTODESTROY
|
4460
4137
|
rb_define_const(c_domain, "START_AUTODESTROY",
|
4461
4138
|
INT2NUM(VIR_DOMAIN_START_AUTODESTROY));
|
4462
|
-
#endif
|
4463
|
-
|
4464
|
-
#if HAVE_CONST_VIR_DOMAIN_START_BYPASS_CACHE
|
4465
4139
|
rb_define_const(c_domain, "START_BYPASS_CACHE",
|
4466
4140
|
INT2NUM(VIR_DOMAIN_START_BYPASS_CACHE));
|
4467
|
-
#endif
|
4468
|
-
|
4469
|
-
#if HAVE_CONST_VIR_DOMAIN_START_FORCE_BOOT
|
4470
4141
|
rb_define_const(c_domain, "START_FORCE_BOOT",
|
4471
4142
|
INT2NUM(VIR_DOMAIN_START_FORCE_BOOT));
|
4472
|
-
#endif
|
4473
4143
|
|
4474
|
-
#if HAVE_CONST_VIR_DUMP_CRASH
|
4475
4144
|
rb_define_const(c_domain, "DUMP_CRASH", INT2NUM(VIR_DUMP_CRASH));
|
4476
|
-
#endif
|
4477
|
-
#if HAVE_CONST_VIR_DUMP_LIVE
|
4478
4145
|
rb_define_const(c_domain, "DUMP_LIVE", INT2NUM(VIR_DUMP_LIVE));
|
4479
|
-
#endif
|
4480
|
-
#if HAVE_CONST_VIR_DUMP_BYPASS_CACHE
|
4481
4146
|
rb_define_const(c_domain, "BYPASS_CACHE", INT2NUM(VIR_DUMP_BYPASS_CACHE));
|
4482
|
-
#endif
|
4483
|
-
#if HAVE_CONST_VIR_DUMP_RESET
|
4484
4147
|
rb_define_const(c_domain, "RESET", INT2NUM(VIR_DUMP_RESET));
|
4485
|
-
#endif
|
4486
|
-
#if HAVE_CONST_VIR_DUMP_MEMORY_ONLY
|
4487
4148
|
rb_define_const(c_domain, "MEMORY_ONLY", INT2NUM(VIR_DUMP_MEMORY_ONLY));
|
4488
|
-
#endif
|
4489
4149
|
|
4490
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
4491
4150
|
rb_define_const(c_domain, "VCPU_LIVE", INT2NUM(VIR_DOMAIN_VCPU_LIVE));
|
4492
4151
|
rb_define_const(c_domain, "VCPU_CONFIG", INT2NUM(VIR_DOMAIN_VCPU_CONFIG));
|
4493
4152
|
rb_define_const(c_domain, "VCPU_MAXIMUM", INT2NUM(VIR_DOMAIN_VCPU_MAXIMUM));
|
4494
|
-
#endif
|
4495
|
-
#if HAVE_CONST_VIR_DOMAIN_VCPU_CURRENT
|
4496
4153
|
rb_define_const(c_domain, "VCPU_CURRENT", INT2NUM(VIR_DOMAIN_VCPU_CURRENT));
|
4497
|
-
#endif
|
4498
|
-
#if HAVE_CONST_VIR_DOMAIN_VCPU_GUEST
|
4499
4154
|
rb_define_const(c_domain, "VCPU_GUEST", INT2NUM(VIR_DOMAIN_VCPU_GUEST));
|
4500
|
-
#endif
|
4501
4155
|
|
4502
4156
|
rb_define_method(c_domain, "migrate", libvirt_domain_migrate, -1);
|
4503
|
-
#if HAVE_VIRDOMAINMIGRATETOURI
|
4504
4157
|
rb_define_method(c_domain, "migrate_to_uri",
|
4505
4158
|
libvirt_domain_migrate_to_uri, -1);
|
4506
|
-
#endif
|
4507
|
-
#if HAVE_VIRDOMAINMIGRATESETMAXDOWNTIME
|
4508
4159
|
rb_define_method(c_domain, "migrate_set_max_downtime",
|
4509
4160
|
libvirt_domain_migrate_set_max_downtime, -1);
|
4510
4161
|
rb_define_method(c_domain, "migrate_max_downtime=",
|
4511
4162
|
libvirt_domain_migrate_max_downtime_equal, 1);
|
4512
|
-
#endif
|
4513
|
-
#if HAVE_VIRDOMAINMIGRATE2
|
4514
4163
|
rb_define_method(c_domain, "migrate2", libvirt_domain_migrate2, -1);
|
4515
4164
|
rb_define_method(c_domain, "migrate_to_uri2",
|
4516
4165
|
libvirt_domain_migrate_to_uri2, -1);
|
@@ -4518,92 +4167,60 @@ void ruby_libvirt_domain_init(void)
|
|
4518
4167
|
libvirt_domain_migrate_set_max_speed, -1);
|
4519
4168
|
rb_define_method(c_domain, "migrate_max_speed=",
|
4520
4169
|
libvirt_domain_migrate_max_speed_equal, 1);
|
4521
|
-
#endif
|
4522
4170
|
|
4523
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_BYPASS_CACHE
|
4524
4171
|
rb_define_const(c_domain, "SAVE_BYPASS_CACHE",
|
4525
4172
|
INT2NUM(VIR_DOMAIN_SAVE_BYPASS_CACHE));
|
4526
|
-
#endif
|
4527
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_RUNNING
|
4528
4173
|
rb_define_const(c_domain, "SAVE_RUNNING", INT2NUM(VIR_DOMAIN_SAVE_RUNNING));
|
4529
|
-
#endif
|
4530
|
-
#if HAVE_CONST_VIR_DOMAIN_SAVE_PAUSED
|
4531
4174
|
rb_define_const(c_domain, "SAVE_PAUSED", INT2NUM(VIR_DOMAIN_SAVE_PAUSED));
|
4532
|
-
#endif
|
4533
4175
|
|
4534
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
|
4535
4176
|
rb_define_const(c_domain, "UNDEFINE_MANAGED_SAVE",
|
4536
4177
|
INT2NUM(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE));
|
4537
|
-
#endif
|
4538
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA
|
4539
4178
|
rb_define_const(c_domain, "UNDEFINE_SNAPSHOTS_METADATA",
|
4540
4179
|
INT2NUM(VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA));
|
4541
|
-
#endif
|
4542
|
-
#if HAVE_CONST_VIR_DOMAIN_UNDEFINE_NVRAM
|
4543
4180
|
rb_define_const(c_domain, "UNDEFINE_NVRAM",
|
4544
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));
|
4545
4189
|
#endif
|
4546
4190
|
rb_define_attr(c_domain, "connection", 1, 0);
|
4547
4191
|
|
4548
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_DEFAULT
|
4549
4192
|
rb_define_const(c_domain, "SHUTDOWN_DEFAULT",
|
4550
4193
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_DEFAULT));
|
4551
|
-
#endif
|
4552
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN
|
4553
4194
|
rb_define_const(c_domain, "SHUTDOWN_ACPI_POWER_BTN",
|
4554
4195
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN));
|
4555
|
-
#endif
|
4556
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_GUEST_AGENT
|
4557
4196
|
rb_define_const(c_domain, "SHUTDOWN_GUEST_AGENT",
|
4558
4197
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_GUEST_AGENT));
|
4559
|
-
#endif
|
4560
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_INITCTL
|
4561
4198
|
rb_define_const(c_domain, "SHUTDOWN_INITCTL",
|
4562
4199
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_INITCTL));
|
4563
|
-
#endif
|
4564
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_SIGNAL
|
4565
4200
|
rb_define_const(c_domain, "SHUTDOWN_SIGNAL",
|
4566
4201
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_SIGNAL));
|
4567
|
-
#endif
|
4568
|
-
#if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_PARAVIRT
|
4569
4202
|
rb_define_const(c_domain, "SHUTDOWN_PARAVIRT",
|
4570
4203
|
INT2NUM(VIR_DOMAIN_SHUTDOWN_PARAVIRT));
|
4571
|
-
#endif
|
4572
4204
|
rb_define_method(c_domain, "shutdown", libvirt_domain_shutdown, -1);
|
4573
4205
|
|
4574
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_DEFAULT
|
4575
4206
|
rb_define_const(c_domain, "REBOOT_DEFAULT",
|
4576
4207
|
INT2NUM(VIR_DOMAIN_REBOOT_DEFAULT));
|
4577
|
-
#endif
|
4578
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_ACPI_POWER_BTN
|
4579
4208
|
rb_define_const(c_domain, "REBOOT_ACPI_POWER_BTN",
|
4580
4209
|
INT2NUM(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN));
|
4581
|
-
#endif
|
4582
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_GUEST_AGENT
|
4583
4210
|
rb_define_const(c_domain, "REBOOT_GUEST_AGENT",
|
4584
4211
|
INT2NUM(VIR_DOMAIN_REBOOT_GUEST_AGENT));
|
4585
|
-
#endif
|
4586
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_INITCTL
|
4587
4212
|
rb_define_const(c_domain, "REBOOT_INITCTL",
|
4588
4213
|
INT2NUM(VIR_DOMAIN_REBOOT_INITCTL));
|
4589
|
-
#endif
|
4590
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_SIGNAL
|
4591
4214
|
rb_define_const(c_domain, "REBOOT_SIGNAL",
|
4592
4215
|
INT2NUM(VIR_DOMAIN_REBOOT_SIGNAL));
|
4593
|
-
#endif
|
4594
|
-
#if HAVE_CONST_VIR_DOMAIN_REBOOT_PARAVIRT
|
4595
4216
|
rb_define_const(c_domain, "REBOOT_PARAVIRT",
|
4596
4217
|
INT2NUM(VIR_DOMAIN_REBOOT_PARAVIRT));
|
4597
|
-
#endif
|
4598
4218
|
rb_define_method(c_domain, "reboot", libvirt_domain_reboot, -1);
|
4599
|
-
|
4219
|
+
|
4600
4220
|
rb_define_const(c_domain, "DESTROY_DEFAULT",
|
4601
4221
|
INT2NUM(VIR_DOMAIN_DESTROY_DEFAULT));
|
4602
|
-
#endif
|
4603
|
-
#if HAVE_CONST_VIR_DOMAIN_DESTROY_GRACEFUL
|
4604
4222
|
rb_define_const(c_domain, "DESTROY_GRACEFUL",
|
4605
4223
|
INT2NUM(VIR_DOMAIN_DESTROY_GRACEFUL));
|
4606
|
-
#endif
|
4607
4224
|
rb_define_method(c_domain, "destroy", libvirt_domain_destroy, -1);
|
4608
4225
|
rb_define_method(c_domain, "suspend", libvirt_domain_suspend, 0);
|
4609
4226
|
rb_define_method(c_domain, "resume", libvirt_domain_resume, 0);
|
@@ -4623,10 +4240,8 @@ void ruby_libvirt_domain_init(void)
|
|
4623
4240
|
rb_define_method(c_domain, "memory=", libvirt_domain_memory_equal, 1);
|
4624
4241
|
rb_define_method(c_domain, "max_vcpus", libvirt_domain_max_vcpus, 0);
|
4625
4242
|
rb_define_method(c_domain, "vcpus=", libvirt_domain_vcpus_equal, 1);
|
4626
|
-
#if HAVE_VIRDOMAINSETVCPUSFLAGS
|
4627
4243
|
rb_define_method(c_domain, "vcpus_flags=", libvirt_domain_vcpus_flags_equal,
|
4628
4244
|
1);
|
4629
|
-
#endif
|
4630
4245
|
rb_define_method(c_domain, "pin_vcpu", libvirt_domain_pin_vcpu, -1);
|
4631
4246
|
rb_define_method(c_domain, "xml_desc", libvirt_domain_xml_desc, -1);
|
4632
4247
|
rb_define_method(c_domain, "undefine", libvirt_domain_undefine, -1);
|
@@ -4636,67 +4251,41 @@ void ruby_libvirt_domain_init(void)
|
|
4636
4251
|
rb_define_method(c_domain, "autostart=", libvirt_domain_autostart_equal, 1);
|
4637
4252
|
rb_define_method(c_domain, "free", libvirt_domain_free, 0);
|
4638
4253
|
|
4639
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_CURRENT
|
4640
4254
|
rb_define_const(c_domain, "DEVICE_MODIFY_CURRENT",
|
4641
4255
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_CURRENT));
|
4642
|
-
#endif
|
4643
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_LIVE
|
4644
4256
|
rb_define_const(c_domain, "DEVICE_MODIFY_LIVE",
|
4645
4257
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_LIVE));
|
4646
|
-
#endif
|
4647
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_CONFIG
|
4648
4258
|
rb_define_const(c_domain, "DEVICE_MODIFY_CONFIG",
|
4649
4259
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_CONFIG));
|
4650
|
-
#endif
|
4651
|
-
#if HAVE_CONST_VIR_DOMAIN_DEVICE_MODIFY_FORCE
|
4652
4260
|
rb_define_const(c_domain, "DEVICE_MODIFY_FORCE",
|
4653
4261
|
INT2NUM(VIR_DOMAIN_DEVICE_MODIFY_FORCE));
|
4654
|
-
|
4262
|
+
|
4655
4263
|
rb_define_method(c_domain, "attach_device", libvirt_domain_attach_device,
|
4656
4264
|
-1);
|
4657
4265
|
rb_define_method(c_domain, "detach_device", libvirt_domain_detach_device,
|
4658
4266
|
-1);
|
4659
|
-
#if HAVE_VIRDOMAINUPDATEDEVICEFLAGS
|
4660
4267
|
rb_define_method(c_domain, "update_device", libvirt_domain_update_device,
|
4661
4268
|
-1);
|
4662
|
-
#endif
|
4663
4269
|
|
4664
4270
|
rb_define_method(c_domain, "scheduler_type", libvirt_domain_scheduler_type,
|
4665
4271
|
0);
|
4666
4272
|
|
4667
|
-
#if HAVE_VIRDOMAINMANAGEDSAVE
|
4668
4273
|
rb_define_method(c_domain, "managed_save", libvirt_domain_managed_save, -1);
|
4669
4274
|
rb_define_method(c_domain, "has_managed_save?",
|
4670
4275
|
libvirt_domain_has_managed_save, -1);
|
4671
4276
|
rb_define_method(c_domain, "managed_save_remove",
|
4672
4277
|
libvirt_domain_managed_save_remove, -1);
|
4673
|
-
#endif
|
4674
|
-
#if HAVE_VIRDOMAINGETSECURITYLABEL
|
4675
4278
|
rb_define_method(c_domain, "security_label",
|
4676
4279
|
libvirt_domain_security_label, 0);
|
4677
|
-
#endif
|
4678
4280
|
rb_define_method(c_domain, "block_stats", libvirt_domain_block_stats, 1);
|
4679
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
4680
4281
|
rb_define_method(c_domain, "memory_stats", libvirt_domain_memory_stats, -1);
|
4681
|
-
#endif
|
4682
|
-
#if HAVE_VIRDOMAINBLOCKPEEK
|
4683
4282
|
rb_define_method(c_domain, "block_peek", libvirt_domain_block_peek, -1);
|
4684
|
-
#endif
|
4685
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
4686
4283
|
rb_define_method(c_domain, "blockinfo", libvirt_domain_block_info, -1);
|
4687
|
-
#endif
|
4688
|
-
#if HAVE_VIRDOMAINMEMORYPEEK
|
4689
4284
|
rb_define_method(c_domain, "memory_peek", libvirt_domain_memory_peek, -1);
|
4690
|
-
#endif
|
4691
4285
|
rb_define_method(c_domain, "vcpus", libvirt_domain_vcpus, 0);
|
4692
4286
|
rb_define_alias(c_domain, "get_vcpus", "vcpus");
|
4693
|
-
#if HAVE_VIRDOMAINISACTIVE
|
4694
4287
|
rb_define_method(c_domain, "active?", libvirt_domain_active_p, 0);
|
4695
|
-
#endif
|
4696
|
-
#if HAVE_VIRDOMAINISPERSISTENT
|
4697
4288
|
rb_define_method(c_domain, "persistent?", libvirt_domain_persistent_p, 0);
|
4698
|
-
#endif
|
4699
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
4700
4289
|
rb_define_method(c_domain, "snapshot_create_xml",
|
4701
4290
|
libvirt_domain_snapshot_create_xml, -1);
|
4702
4291
|
rb_define_method(c_domain, "num_of_snapshots",
|
@@ -4711,7 +4300,6 @@ void ruby_libvirt_domain_init(void)
|
|
4711
4300
|
libvirt_domain_revert_to_snapshot, -1);
|
4712
4301
|
rb_define_method(c_domain, "current_snapshot",
|
4713
4302
|
libvirt_domain_current_snapshot, -1);
|
4714
|
-
#endif
|
4715
4303
|
|
4716
4304
|
/*
|
4717
4305
|
* Class Libvirt::Domain::Info
|
@@ -4756,7 +4344,6 @@ void ruby_libvirt_domain_init(void)
|
|
4756
4344
|
rb_define_attr(c_domain_block_stats, "wr_bytes", 1, 0);
|
4757
4345
|
rb_define_attr(c_domain_block_stats, "errs", 1, 0);
|
4758
4346
|
|
4759
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKJOBINFOPTR
|
4760
4347
|
/*
|
4761
4348
|
* Class Libvirt::Domain::BlockJobInfo
|
4762
4349
|
*/
|
@@ -4766,9 +4353,7 @@ void ruby_libvirt_domain_init(void)
|
|
4766
4353
|
rb_define_attr(c_domain_block_job_info, "bandwidth", 1, 0);
|
4767
4354
|
rb_define_attr(c_domain_block_job_info, "cur", 1, 0);
|
4768
4355
|
rb_define_attr(c_domain_block_job_info, "end", 1, 0);
|
4769
|
-
#endif
|
4770
4356
|
|
4771
|
-
#if HAVE_TYPE_VIRDOMAINMEMORYSTATPTR
|
4772
4357
|
/*
|
4773
4358
|
* Class Libvirt::Domain::MemoryStats
|
4774
4359
|
*/
|
@@ -4789,17 +4374,11 @@ void ruby_libvirt_domain_init(void)
|
|
4789
4374
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_UNUSED));
|
4790
4375
|
rb_define_const(c_domain_memory_stats, "AVAILABLE",
|
4791
4376
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_AVAILABLE));
|
4792
|
-
#if HAVE_CONST_VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON
|
4793
4377
|
rb_define_const(c_domain_memory_stats, "ACTUAL_BALLOON",
|
4794
4378
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON));
|
4795
|
-
#endif
|
4796
|
-
#if HAVE_CONST_VIR_DOMAIN_MEMORY_STATE_RSS
|
4797
4379
|
rb_define_const(c_domain_memory_stats, "RSS",
|
4798
4380
|
INT2NUM(VIR_DOMAIN_MEMORY_STAT_RSS));
|
4799
|
-
#endif
|
4800
|
-
#endif
|
4801
4381
|
|
4802
|
-
#if HAVE_TYPE_VIRDOMAINBLOCKINFOPTR
|
4803
4382
|
/*
|
4804
4383
|
* Class Libvirt::Domain::BlockInfo
|
4805
4384
|
*/
|
@@ -4808,9 +4387,7 @@ void ruby_libvirt_domain_init(void)
|
|
4808
4387
|
rb_define_attr(c_domain_block_info, "capacity", 1, 0);
|
4809
4388
|
rb_define_attr(c_domain_block_info, "allocation", 1, 0);
|
4810
4389
|
rb_define_attr(c_domain_block_info, "physical", 1, 0);
|
4811
|
-
#endif
|
4812
4390
|
|
4813
|
-
#if HAVE_TYPE_VIRDOMAINSNAPSHOTPTR
|
4814
4391
|
/*
|
4815
4392
|
* Class Libvirt::Domain::Snapshot
|
4816
4393
|
*/
|
@@ -4823,20 +4400,13 @@ void ruby_libvirt_domain_init(void)
|
|
4823
4400
|
libvirt_domain_snapshot_delete, -1);
|
4824
4401
|
rb_define_method(c_domain_snapshot, "free", libvirt_domain_snapshot_free,
|
4825
4402
|
0);
|
4826
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY
|
4827
4403
|
rb_define_const(c_domain_snapshot, "DELETE_METADATA_ONLY",
|
4828
4404
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY));
|
4829
|
-
#endif
|
4830
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY
|
4831
4405
|
rb_define_const(c_domain_snapshot, "DELETE_CHILDREN_ONLY",
|
4832
4406
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY));
|
4833
|
-
#endif
|
4834
4407
|
|
4835
|
-
#endif
|
4836
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETNAME
|
4837
4408
|
rb_define_method(c_domain_snapshot, "name", libvirt_domain_snapshot_name,
|
4838
4409
|
0);
|
4839
|
-
#endif
|
4840
4410
|
|
4841
4411
|
/*
|
4842
4412
|
* Class Libvirt::Domain::VCPUInfo
|
@@ -4851,7 +4421,6 @@ void ruby_libvirt_domain_init(void)
|
|
4851
4421
|
rb_define_attr(c_domain_vcpuinfo, "cpu", 1, 0);
|
4852
4422
|
rb_define_attr(c_domain_vcpuinfo, "cpumap", 1, 0);
|
4853
4423
|
|
4854
|
-
#if HAVE_TYPE_VIRDOMAINJOBINFOPTR
|
4855
4424
|
/*
|
4856
4425
|
* Class Libvirt::Domain::JobInfo
|
4857
4426
|
*/
|
@@ -4882,27 +4451,17 @@ void ruby_libvirt_domain_init(void)
|
|
4882
4451
|
|
4883
4452
|
rb_define_method(c_domain, "job_info", libvirt_domain_job_info, 0);
|
4884
4453
|
rb_define_method(c_domain, "abort_job", libvirt_domain_abort_job, 0);
|
4885
|
-
#endif
|
4886
4454
|
|
4887
|
-
#if HAVE_VIRDOMAINQEMUMONITORCOMMAND
|
4888
4455
|
rb_define_method(c_domain, "qemu_monitor_command",
|
4889
4456
|
libvirt_domain_qemu_monitor_command, -1);
|
4890
|
-
#endif
|
4891
4457
|
|
4892
|
-
#if HAVE_VIRDOMAINGETVCPUSFLAGS
|
4893
4458
|
rb_define_method(c_domain, "num_vcpus", libvirt_domain_num_vcpus, 1);
|
4894
|
-
#endif
|
4895
4459
|
|
4896
|
-
#if HAVE_VIRDOMAINISUPDATED
|
4897
4460
|
rb_define_method(c_domain, "updated?", libvirt_domain_is_updated, 0);
|
4898
|
-
#endif
|
4899
4461
|
|
4900
|
-
#ifdef VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
|
4901
4462
|
rb_define_const(c_domain, "MEMORY_PARAM_UNLIMITED",
|
4902
4463
|
LL2NUM(VIR_DOMAIN_MEMORY_PARAM_UNLIMITED));
|
4903
|
-
#endif
|
4904
4464
|
|
4905
|
-
#if HAVE_VIRDOMAINSETMEMORYFLAGS
|
4906
4465
|
/* Ideally we would just have the "MEM_LIVE" constant. Unfortunately
|
4907
4466
|
* we screwed up long ago, and we have to leave "DOMAIN_MEM_LIVE" for
|
4908
4467
|
* backwards compatibility.
|
@@ -4916,8 +4475,7 @@ void ruby_libvirt_domain_init(void)
|
|
4916
4475
|
rb_define_const(c_domain, "MEM_CONFIG", INT2NUM(VIR_DOMAIN_MEM_CONFIG));
|
4917
4476
|
rb_define_const(c_domain, "DOMAIN_MEM_CONFIG",
|
4918
4477
|
INT2NUM(VIR_DOMAIN_MEM_CONFIG));
|
4919
|
-
|
4920
|
-
#if HAVE_CONST_VIR_DOMAIN_MEM_CURRENT
|
4478
|
+
|
4921
4479
|
/* Ideally we would just have the "MEM_CURRENT" constant. Unfortunately
|
4922
4480
|
* we screwed up long ago, and we have to leave "DOMAIN_MEM_CURRENT" for
|
4923
4481
|
* backwards compatibility.
|
@@ -4932,28 +4490,22 @@ void ruby_libvirt_domain_init(void)
|
|
4932
4490
|
rb_define_const(c_domain, "MEM_MAXIMUM", INT2NUM(VIR_DOMAIN_MEM_MAXIMUM));
|
4933
4491
|
rb_define_const(c_domain, "DOMAIN_MEM_MAXIMUM",
|
4934
4492
|
INT2NUM(VIR_DOMAIN_MEM_MAXIMUM));
|
4935
|
-
#endif
|
4936
4493
|
|
4937
4494
|
rb_define_method(c_domain, "scheduler_parameters",
|
4938
4495
|
libvirt_domain_scheduler_parameters, -1);
|
4939
4496
|
rb_define_method(c_domain, "scheduler_parameters=",
|
4940
4497
|
libvirt_domain_scheduler_parameters_equal, 1);
|
4941
4498
|
|
4942
|
-
#if HAVE_VIRDOMAINSETMEMORYPARAMETERS
|
4943
4499
|
rb_define_method(c_domain, "memory_parameters",
|
4944
4500
|
libvirt_domain_memory_parameters, -1);
|
4945
4501
|
rb_define_method(c_domain, "memory_parameters=",
|
4946
4502
|
libvirt_domain_memory_parameters_equal, 1);
|
4947
|
-
#endif
|
4948
4503
|
|
4949
|
-
#if HAVE_VIRDOMAINSETBLKIOPARAMETERS
|
4950
4504
|
rb_define_method(c_domain, "blkio_parameters",
|
4951
4505
|
libvirt_domain_blkio_parameters, -1);
|
4952
4506
|
rb_define_method(c_domain, "blkio_parameters=",
|
4953
4507
|
libvirt_domain_blkio_parameters_equal, 1);
|
4954
|
-
#endif
|
4955
4508
|
|
4956
|
-
#if HAVE_VIRDOMAINGETSTATE
|
4957
4509
|
/* Ideally we would just have the "RUNNING_UNKNOWN" constant. Unfortunately
|
4958
4510
|
* we screwed up long ago, and we have to leave "DOMAIN_RUNNING_UNKNOWN"
|
4959
4511
|
* for backwards compatibility.
|
@@ -5018,7 +4570,6 @@ void ruby_libvirt_domain_init(void)
|
|
5018
4570
|
INT2NUM(VIR_DOMAIN_RUNNING_SAVE_CANCELED));
|
5019
4571
|
rb_define_const(c_domain, "DOMAIN_RUNNING_SAVE_CANCELED",
|
5020
4572
|
INT2NUM(VIR_DOMAIN_RUNNING_SAVE_CANCELED));
|
5021
|
-
#if HAVE_CONST_VIR_DOMAIN_RUNNING_WAKEUP
|
5022
4573
|
/* Ideally we would just have the "RUNNING_WAKEUP" constant. Unfortunately
|
5023
4574
|
* we screwed up long ago, and we have to leave "DOMAIN_RUNNING_WAKEUP"
|
5024
4575
|
* for backwards compatibility.
|
@@ -5027,7 +4578,6 @@ void ruby_libvirt_domain_init(void)
|
|
5027
4578
|
INT2NUM(VIR_DOMAIN_RUNNING_WAKEUP));
|
5028
4579
|
rb_define_const(c_domain, "DOMAIN_RUNNING_WAKEUP",
|
5029
4580
|
INT2NUM(VIR_DOMAIN_RUNNING_WAKEUP));
|
5030
|
-
#endif
|
5031
4581
|
/* Ideally we would just have the "BLOCKED_UNKNOWN" constant. Unfortunately
|
5032
4582
|
* we screwed up long ago, and we have to leave "DOMAIN_BLOCKED_UNKNOWN"
|
5033
4583
|
* for backwards compatibility.
|
@@ -5100,7 +4650,6 @@ void ruby_libvirt_domain_init(void)
|
|
5100
4650
|
INT2NUM(VIR_DOMAIN_PAUSED_FROM_SNAPSHOT));
|
5101
4651
|
rb_define_const(c_domain, "DOMAIN_PAUSED_FROM_SNAPSHOT",
|
5102
4652
|
INT2NUM(VIR_DOMAIN_PAUSED_FROM_SNAPSHOT));
|
5103
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_SHUTTING_DOWN
|
5104
4653
|
/* Ideally we would just have the "PAUSED_SHUTTING_DOWN" constant.
|
5105
4654
|
* Unfortunately we screwed up long ago, and we have to leave
|
5106
4655
|
* "DOMAIN_PAUSED_SHUTTING_DOWN" for backwards compatibility.
|
@@ -5109,8 +4658,6 @@ void ruby_libvirt_domain_init(void)
|
|
5109
4658
|
INT2NUM(VIR_DOMAIN_PAUSED_SHUTTING_DOWN));
|
5110
4659
|
rb_define_const(c_domain, "DOMAIN_PAUSED_SHUTTING_DOWN",
|
5111
4660
|
INT2NUM(VIR_DOMAIN_PAUSED_SHUTTING_DOWN));
|
5112
|
-
#endif
|
5113
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_SNAPSHOT
|
5114
4661
|
/* Ideally we would just have the "PAUSED_SNAPSHOT" constant. Unfortunately
|
5115
4662
|
* we screwed up long ago, and we have to leave "DOMAIN_PAUSED_SNAPSHOT"
|
5116
4663
|
* for backwards compatibility.
|
@@ -5119,7 +4666,6 @@ void ruby_libvirt_domain_init(void)
|
|
5119
4666
|
INT2NUM(VIR_DOMAIN_PAUSED_SNAPSHOT));
|
5120
4667
|
rb_define_const(c_domain, "DOMAIN_PAUSED_SNAPSHOT",
|
5121
4668
|
INT2NUM(VIR_DOMAIN_PAUSED_SNAPSHOT));
|
5122
|
-
#endif
|
5123
4669
|
/* Ideally we would just have the "SHUTDOWN_UNKNOWN" constant.
|
5124
4670
|
* Unfortunately we screwed up long ago, and we have to leave
|
5125
4671
|
* "DOMAIN_SHUTDOWN_UNKNOWN" for backwards compatibility.
|
@@ -5208,7 +4754,6 @@ void ruby_libvirt_domain_init(void)
|
|
5208
4754
|
INT2NUM(VIR_DOMAIN_CRASHED_UNKNOWN));
|
5209
4755
|
rb_define_const(c_domain, "DOMAIN_CRASHED_UNKNOWN",
|
5210
4756
|
INT2NUM(VIR_DOMAIN_CRASHED_UNKNOWN));
|
5211
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED_UNKNOWN
|
5212
4757
|
/* Ideally we would just have the "PMSUSPENDED_UNKNOWN" constant.
|
5213
4758
|
* Unfortunately we screwed up long ago, and we have to leave
|
5214
4759
|
* "DOMAIN_PMSUSPENDED_UNKNOWN" for backwards compatibility.
|
@@ -5217,8 +4762,6 @@ void ruby_libvirt_domain_init(void)
|
|
5217
4762
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_UNKNOWN));
|
5218
4763
|
rb_define_const(c_domain, "DOMAIN_PMSUSPENDED_UNKNOWN",
|
5219
4764
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_UNKNOWN));
|
5220
|
-
#endif
|
5221
|
-
#if HAVE_CONST_VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN
|
5222
4765
|
/* Ideally we would just have the "PMSUSPENDED_DISK_UNKNOWN" constant.
|
5223
4766
|
* Unfortunately we screwed up long ago, and we have to leave
|
5224
4767
|
* "DOMAIN_PMSUSPENDED_DISK_UNKNOWN" for backwards compatibility.
|
@@ -5227,28 +4770,17 @@ void ruby_libvirt_domain_init(void)
|
|
5227
4770
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN));
|
5228
4771
|
rb_define_const(c_domain, "DOMAIN_PMSUSPENDED_DISK_UNKNOWN",
|
5229
4772
|
INT2NUM(VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN));
|
5230
|
-
#endif
|
5231
|
-
#if HAVE_CONST_VIR_DOMAIN_RUNNING_CRASHED
|
5232
4773
|
rb_define_const(c_domain, "RUNNING_CRASHED",
|
5233
4774
|
INT2NUM(VIR_DOMAIN_RUNNING_CRASHED));
|
5234
|
-
#endif
|
5235
|
-
#if HAVE_CONST_VIR_DOMAIN_NOSTATE_UNKNOWN
|
5236
4775
|
rb_define_const(c_domain, "NOSTATE_UNKNOWN",
|
5237
4776
|
INT2NUM(VIR_DOMAIN_NOSTATE_UNKNOWN));
|
5238
|
-
#endif
|
5239
|
-
#if HAVE_CONST_VIR_DOMAIN_PAUSED_CRASHED
|
5240
4777
|
rb_define_const(c_domain, "PAUSED_CRASHED",
|
5241
4778
|
INT2NUM(VIR_DOMAIN_PAUSED_CRASHED));
|
5242
|
-
#endif
|
5243
|
-
#if HAVE_CONST_VIR_DOMAIN_CRASHED_PANICKED
|
5244
4779
|
rb_define_const(c_domain, "CRASHED_PANICKED",
|
5245
4780
|
INT2NUM(VIR_DOMAIN_CRASHED_PANICKED));
|
5246
|
-
#endif
|
5247
4781
|
|
5248
4782
|
rb_define_method(c_domain, "state", libvirt_domain_state, -1);
|
5249
|
-
#endif
|
5250
4783
|
|
5251
|
-
#if HAVE_CONST_VIR_DOMAIN_AFFECT_CURRENT
|
5252
4784
|
/* Ideally we would just have the "AFFECT_CURRENT" constant. Unfortunately
|
5253
4785
|
* we screwed up long ago, and we have to leave "DOMAIN_AFFECT_CURRENT" for
|
5254
4786
|
* backwards compatibility.
|
@@ -5273,29 +4805,17 @@ void ruby_libvirt_domain_init(void)
|
|
5273
4805
|
INT2NUM(VIR_DOMAIN_AFFECT_CONFIG));
|
5274
4806
|
rb_define_const(c_domain, "DOMAIN_AFFECT_CONFIG",
|
5275
4807
|
INT2NUM(VIR_DOMAIN_AFFECT_CONFIG));
|
5276
|
-
#endif
|
5277
4808
|
|
5278
|
-
#if HAVE_CONST_VIR_DOMAIN_CONSOLE_FORCE
|
5279
4809
|
rb_define_const(c_domain, "CONSOLE_FORCE",
|
5280
4810
|
INT2NUM(VIR_DOMAIN_CONSOLE_FORCE));
|
5281
|
-
#endif
|
5282
|
-
#if HAVE_CONST_VIR_DOMAIN_CONSOLE_SAFE
|
5283
4811
|
rb_define_const(c_domain, "CONSOLE_SAFE", INT2NUM(VIR_DOMAIN_CONSOLE_SAFE));
|
5284
|
-
#endif
|
5285
4812
|
|
5286
|
-
#if HAVE_VIRDOMAINOPENCONSOLE
|
5287
4813
|
rb_define_method(c_domain, "open_console", libvirt_domain_open_console, -1);
|
5288
|
-
#endif
|
5289
4814
|
|
5290
|
-
#if HAVE_VIRDOMAINSCREENSHOT
|
5291
4815
|
rb_define_method(c_domain, "screenshot", libvirt_domain_screenshot, -1);
|
5292
|
-
#endif
|
5293
4816
|
|
5294
|
-
#if HAVE_VIRDOMAININJECTNMI
|
5295
4817
|
rb_define_method(c_domain, "inject_nmi", libvirt_domain_inject_nmi, -1);
|
5296
|
-
#endif
|
5297
4818
|
|
5298
|
-
#if HAVE_VIRDOMAINGETCONTROLINFO
|
5299
4819
|
/*
|
5300
4820
|
* Class Libvirt::Domain::ControlInfo
|
5301
4821
|
*/
|
@@ -5315,22 +4835,12 @@ void ruby_libvirt_domain_init(void)
|
|
5315
4835
|
INT2NUM(VIR_DOMAIN_CONTROL_ERROR));
|
5316
4836
|
|
5317
4837
|
rb_define_method(c_domain, "control_info", libvirt_domain_control_info, -1);
|
5318
|
-
#endif
|
5319
4838
|
|
5320
|
-
#if HAVE_VIRDOMAINMIGRATEGETMAXSPEED
|
5321
4839
|
rb_define_method(c_domain, "migrate_max_speed",
|
5322
4840
|
libvirt_domain_migrate_max_speed, -1);
|
5323
|
-
#endif
|
5324
|
-
#if HAVE_VIRDOMAINSENDKEY
|
5325
4841
|
rb_define_method(c_domain, "send_key", libvirt_domain_send_key, 3);
|
5326
|
-
#endif
|
5327
|
-
#if HAVE_VIRDOMAINRESET
|
5328
4842
|
rb_define_method(c_domain, "reset", libvirt_domain_reset, -1);
|
5329
|
-
#endif
|
5330
|
-
#if HAVE_VIRDOMAINGETHOSTNAME
|
5331
4843
|
rb_define_method(c_domain, "hostname", libvirt_domain_hostname, -1);
|
5332
|
-
#endif
|
5333
|
-
#if HAVE_VIRDOMAINGETMETADATA
|
5334
4844
|
rb_define_const(c_domain, "METADATA_DESCRIPTION",
|
5335
4845
|
INT2NUM(VIR_DOMAIN_METADATA_DESCRIPTION));
|
5336
4846
|
rb_define_const(c_domain, "METADATA_TITLE",
|
@@ -5338,11 +4848,7 @@ void ruby_libvirt_domain_init(void)
|
|
5338
4848
|
rb_define_const(c_domain, "METADATA_ELEMENT",
|
5339
4849
|
INT2NUM(VIR_DOMAIN_METADATA_ELEMENT));
|
5340
4850
|
rb_define_method(c_domain, "metadata", libvirt_domain_metadata, -1);
|
5341
|
-
#endif
|
5342
|
-
#if HAVE_VIRDOMAINSETMETADATA
|
5343
4851
|
rb_define_method(c_domain, "metadata=", libvirt_domain_metadata_equal, 1);
|
5344
|
-
#endif
|
5345
|
-
#if HAVE_VIRDOMAINSENDPROCESSSIGNAL
|
5346
4852
|
rb_define_const(c_domain, "PROCESS_SIGNAL_NOP",
|
5347
4853
|
INT2NUM(VIR_DOMAIN_PROCESS_SIGNAL_NOP));
|
5348
4854
|
rb_define_const(c_domain, "PROCESS_SIGNAL_HUP",
|
@@ -5475,8 +4981,6 @@ void ruby_libvirt_domain_init(void)
|
|
5475
4981
|
INT2NUM(VIR_DOMAIN_PROCESS_SIGNAL_RT32));
|
5476
4982
|
rb_define_method(c_domain, "send_process_signal",
|
5477
4983
|
libvirt_domain_send_process_signal, -1);
|
5478
|
-
#endif
|
5479
|
-
#if HAVE_VIRDOMAINLISTALLSNAPSHOTS
|
5480
4984
|
rb_define_const(c_domain_snapshot, "LIST_ROOTS",
|
5481
4985
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS));
|
5482
4986
|
rb_define_const(c_domain_snapshot, "LIST_DESCENDANTS",
|
@@ -5489,7 +4993,6 @@ void ruby_libvirt_domain_init(void)
|
|
5489
4993
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_METADATA));
|
5490
4994
|
rb_define_const(c_domain_snapshot, "LIST_NO_METADATA",
|
5491
4995
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA));
|
5492
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE
|
5493
4996
|
rb_define_const(c_domain_snapshot, "LIST_INACTIVE",
|
5494
4997
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE));
|
5495
4998
|
rb_define_const(c_domain_snapshot, "LIST_ACTIVE",
|
@@ -5500,11 +5003,9 @@ void ruby_libvirt_domain_init(void)
|
|
5500
5003
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL));
|
5501
5004
|
rb_define_const(c_domain_snapshot, "LIST_EXTERNAL",
|
5502
5005
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL));
|
5503
|
-
#endif
|
5504
5006
|
rb_define_method(c_domain, "list_all_snapshots",
|
5505
5007
|
libvirt_domain_list_all_snapshots, -1);
|
5506
|
-
|
5507
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE
|
5008
|
+
|
5508
5009
|
rb_define_const(c_domain_snapshot, "CREATE_REDEFINE",
|
5509
5010
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE));
|
5510
5011
|
rb_define_const(c_domain_snapshot, "CREATE_CURRENT",
|
@@ -5515,125 +5016,64 @@ void ruby_libvirt_domain_init(void)
|
|
5515
5016
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_HALT));
|
5516
5017
|
rb_define_const(c_domain_snapshot, "CREATE_DISK_ONLY",
|
5517
5018
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY));
|
5518
|
-
#endif
|
5519
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT
|
5520
5019
|
rb_define_const(c_domain_snapshot, "CREATE_REUSE_EXT",
|
5521
5020
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT));
|
5522
|
-
#endif
|
5523
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
|
5524
5021
|
rb_define_const(c_domain_snapshot, "CREATE_QUIESCE",
|
5525
5022
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE));
|
5526
|
-
#endif
|
5527
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC
|
5528
5023
|
rb_define_const(c_domain_snapshot, "CREATE_ATOMIC",
|
5529
5024
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC));
|
5530
|
-
#endif
|
5531
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_CREATE_LIVE
|
5532
5025
|
rb_define_const(c_domain_snapshot, "CREATE_LIVE",
|
5533
5026
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_CREATE_LIVE));
|
5534
|
-
#endif
|
5535
|
-
#if HAVE_VIRDOMAINSNAPSHOTNUMCHILDREN
|
5536
5027
|
rb_define_method(c_domain_snapshot, "num_children",
|
5537
5028
|
libvirt_domain_snapshot_num_children, -1);
|
5538
|
-
#endif
|
5539
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTCHILDRENNAMES
|
5540
5029
|
rb_define_method(c_domain_snapshot, "list_children_names",
|
5541
5030
|
libvirt_domain_snapshot_list_children_names, -1);
|
5542
|
-
#endif
|
5543
|
-
#if HAVE_VIRDOMAINSNAPSHOTLISTALLCHILDREN
|
5544
5031
|
rb_define_method(c_domain_snapshot, "list_all_children",
|
5545
5032
|
libvirt_domain_snapshot_list_all_children, -1);
|
5546
|
-
#endif
|
5547
|
-
#if HAVE_VIRDOMAINSNAPSHOTGETPARENT
|
5548
5033
|
rb_define_method(c_domain_snapshot, "parent",
|
5549
5034
|
libvirt_domain_snapshot_parent, -1);
|
5550
|
-
#endif
|
5551
|
-
#if HAVE_VIRDOMAINSNAPSHOTISCURRENT
|
5552
5035
|
rb_define_method(c_domain_snapshot, "current?",
|
5553
5036
|
libvirt_domain_snapshot_current_p, -1);
|
5554
|
-
#endif
|
5555
|
-
#if HAVE_VIRDOMAINSNAPSHOTHASMETADATA
|
5556
5037
|
rb_define_method(c_domain_snapshot, "has_metadata?",
|
5557
5038
|
libvirt_domain_snapshot_has_metadata_p, -1);
|
5558
|
-
#endif
|
5559
|
-
#if HAVE_VIRDOMAINSETMEMORYSTATSPERIOD
|
5560
5039
|
rb_define_method(c_domain, "memory_stats_period=",
|
5561
5040
|
libvirt_domain_memory_stats_period, 1);
|
5562
|
-
#endif
|
5563
|
-
#if HAVE_VIRDOMAINFSTRIM
|
5564
5041
|
rb_define_method(c_domain, "fstrim", libvirt_domain_fstrim, -1);
|
5565
|
-
#endif
|
5566
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_SHALLOW
|
5567
5042
|
rb_define_const(c_domain, "BLOCK_REBASE_SHALLOW",
|
5568
5043
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_SHALLOW));
|
5569
|
-
#endif
|
5570
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
|
5571
5044
|
rb_define_const(c_domain, "BLOCK_REBASE_REUSE_EXT",
|
5572
5045
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT));
|
5573
|
-
#endif
|
5574
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_COPY_RAW
|
5575
5046
|
rb_define_const(c_domain, "BLOCK_REBASE_COPY_RAW",
|
5576
5047
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_COPY_RAW));
|
5577
|
-
#endif
|
5578
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_REBASE_COPY
|
5579
5048
|
rb_define_const(c_domain, "BLOCK_REBASE_COPY",
|
5580
5049
|
INT2NUM(VIR_DOMAIN_BLOCK_REBASE_COPY));
|
5581
|
-
|
5582
|
-
#if HAVE_VIRDOMAINBLOCKREBASE
|
5050
|
+
|
5583
5051
|
rb_define_method(c_domain, "block_rebase", libvirt_domain_block_rebase, -1);
|
5584
|
-
#endif
|
5585
|
-
#if HAVE_CONST_VIR_DOMAIN_CHANNEL_FORCE
|
5586
5052
|
rb_define_const(c_domain, "CHANNEL_FORCE",
|
5587
5053
|
INT2NUM(VIR_DOMAIN_CHANNEL_FORCE));
|
5588
|
-
#endif
|
5589
|
-
#if HAVE_VIRDOMAINOPENCHANNEL
|
5590
5054
|
rb_define_method(c_domain, "open_channel", libvirt_domain_open_channel, -1);
|
5591
|
-
#endif
|
5592
|
-
#if HAVE_VIRDOMAINCREATEWITHFILES
|
5593
5055
|
rb_define_method(c_domain, "create_with_files",
|
5594
5056
|
libvirt_domain_create_with_files, -1);
|
5595
|
-
#endif
|
5596
|
-
#if HAVE_VIRDOMAINOPENGRAPHICS
|
5597
5057
|
rb_define_const(c_domain, "OPEN_GRAPHICS_SKIPAUTH",
|
5598
5058
|
INT2NUM(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH));
|
5599
5059
|
rb_define_method(c_domain, "open_graphics",
|
5600
5060
|
libvirt_domain_open_graphics, -1);
|
5601
|
-
#endif
|
5602
|
-
#if HAVE_VIRDOMAINPMWAKEUP
|
5603
5061
|
rb_define_method(c_domain, "pmwakeup", libvirt_domain_pmwakeup, -1);
|
5604
|
-
#endif
|
5605
|
-
#if HAVE_VIRDOMAINBLOCKRESIZE
|
5606
5062
|
rb_define_method(c_domain, "block_resize", libvirt_domain_block_resize, -1);
|
5607
|
-
#endif
|
5608
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_RESIZE_BYTES
|
5609
5063
|
rb_define_const(c_domain, "BLOCK_RESIZE_BYTES",
|
5610
5064
|
INT2NUM(VIR_DOMAIN_BLOCK_RESIZE_BYTES));
|
5611
|
-
#endif
|
5612
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING
|
5613
5065
|
rb_define_const(c_domain_snapshot, "REVERT_RUNNING",
|
5614
5066
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING));
|
5615
|
-
#endif
|
5616
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED
|
5617
5067
|
rb_define_const(c_domain_snapshot, "REVERT_PAUSED",
|
5618
5068
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED));
|
5619
|
-
#endif
|
5620
|
-
#if HAVE_CONST_VIR_DOMAIN_SNAPSHOT_REVERT_FORCE
|
5621
5069
|
rb_define_const(c_domain_snapshot, "REVERT_FORCE",
|
5622
5070
|
INT2NUM(VIR_DOMAIN_SNAPSHOT_REVERT_FORCE));
|
5623
|
-
#endif
|
5624
|
-
#if HAVE_VIRDOMAINPMSUSPENDFORDURATION
|
5625
5071
|
rb_define_method(c_domain, "pmsuspend_for_duration",
|
5626
5072
|
libvirt_domain_pmsuspend_for_duration, -1);
|
5627
|
-
#endif
|
5628
|
-
#if HAVE_VIRDOMAINMIGRATEGETCOMPRESSIONCACHE
|
5629
5073
|
rb_define_method(c_domain, "migrate_compression_cache",
|
5630
5074
|
libvirt_domain_migrate_compression_cache, -1);
|
5631
|
-
#endif
|
5632
|
-
#if HAVE_VIRDOMAINMIGRATESETCOMPRESSIONCACHE
|
5633
5075
|
rb_define_method(c_domain, "migrate_compression_cache=",
|
5634
5076
|
libvirt_domain_migrate_compression_cache_equal, 1);
|
5635
|
-
#endif
|
5636
|
-
#if HAVE_VIRDOMAINGETDISKERRORS
|
5637
5077
|
rb_define_const(c_domain, "DISK_ERROR_NONE",
|
5638
5078
|
INT2NUM(VIR_DOMAIN_DISK_ERROR_NONE));
|
5639
5079
|
rb_define_const(c_domain, "DISK_ERROR_UNSPEC",
|
@@ -5641,266 +5081,132 @@ void ruby_libvirt_domain_init(void)
|
|
5641
5081
|
rb_define_const(c_domain, "DISK_ERROR_NO_SPACE",
|
5642
5082
|
INT2NUM(VIR_DOMAIN_DISK_ERROR_NO_SPACE));
|
5643
5083
|
rb_define_method(c_domain, "disk_errors", libvirt_domain_disk_errors, -1);
|
5644
|
-
#endif
|
5645
|
-
#if HAVE_VIRDOMAINGETEMULATORPININFO
|
5646
5084
|
rb_define_method(c_domain, "emulator_pin_info",
|
5647
5085
|
libvirt_domain_emulator_pin_info, -1);
|
5648
|
-
#endif
|
5649
|
-
#if HAVE_VIRDOMAINPINEMULATOR
|
5650
5086
|
rb_define_method(c_domain, "pin_emulator", libvirt_domain_pin_emulator, -1);
|
5651
|
-
#endif
|
5652
|
-
#if HAVE_VIRDOMAINGETSECURITYLABELLIST
|
5653
5087
|
rb_define_method(c_domain, "security_label_list",
|
5654
5088
|
libvirt_domain_security_label_list, 0);
|
5655
|
-
#endif
|
5656
5089
|
|
5657
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_LINUX
|
5658
5090
|
rb_define_const(c_domain, "KEYCODE_SET_LINUX",
|
5659
5091
|
INT2NUM(VIR_KEYCODE_SET_LINUX));
|
5660
|
-
#endif
|
5661
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_XT
|
5662
5092
|
rb_define_const(c_domain, "KEYCODE_SET_XT",
|
5663
5093
|
INT2NUM(VIR_KEYCODE_SET_XT));
|
5664
|
-
#endif
|
5665
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET1
|
5666
5094
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET1",
|
5667
5095
|
INT2NUM(VIR_KEYCODE_SET_ATSET1));
|
5668
|
-
#endif
|
5669
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET2
|
5670
5096
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET2",
|
5671
5097
|
INT2NUM(VIR_KEYCODE_SET_ATSET2));
|
5672
|
-
#endif
|
5673
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_ATSET3
|
5674
5098
|
rb_define_const(c_domain, "KEYCODE_SET_ATSET3",
|
5675
5099
|
INT2NUM(VIR_KEYCODE_SET_ATSET3));
|
5676
|
-
#endif
|
5677
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_OSX
|
5678
5100
|
rb_define_const(c_domain, "KEYCODE_SET_OSX",
|
5679
5101
|
INT2NUM(VIR_KEYCODE_SET_OSX));
|
5680
|
-
#endif
|
5681
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_XT_KBD
|
5682
5102
|
rb_define_const(c_domain, "KEYCODE_SET_XT_KBD",
|
5683
5103
|
INT2NUM(VIR_KEYCODE_SET_XT_KBD));
|
5684
|
-
#endif
|
5685
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_USB
|
5686
5104
|
rb_define_const(c_domain, "KEYCODE_SET_USB",
|
5687
5105
|
INT2NUM(VIR_KEYCODE_SET_USB));
|
5688
|
-
#endif
|
5689
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_WIN32
|
5690
5106
|
rb_define_const(c_domain, "KEYCODE_SET_WIN32",
|
5691
5107
|
INT2NUM(VIR_KEYCODE_SET_WIN32));
|
5692
|
-
#endif
|
5693
|
-
#if HAVE_CONST_VIR_KEYCODE_SET_RFB
|
5694
5108
|
rb_define_const(c_domain, "KEYCODE_SET_RFB", INT2NUM(VIR_KEYCODE_SET_RFB));
|
5695
|
-
|
5696
|
-
#if HAVE_VIRDOMAINGETJOBSTATS
|
5109
|
+
|
5697
5110
|
rb_define_method(c_domain, "job_stats", libvirt_domain_job_stats, -1);
|
5698
|
-
#endif
|
5699
|
-
#if HAVE_VIRDOMAINGETBLOCKIOTUNE
|
5700
5111
|
rb_define_method(c_domain, "block_iotune",
|
5701
5112
|
libvirt_domain_block_iotune, -1);
|
5702
|
-
#endif
|
5703
|
-
#if HAVE_VIRDOMAINSETBLOCKIOTUNE
|
5704
5113
|
rb_define_method(c_domain, "block_iotune=",
|
5705
5114
|
libvirt_domain_block_iotune_equal, 1);
|
5706
|
-
#endif
|
5707
|
-
#if HAVE_VIRDOMAINBLOCKCOMMIT
|
5708
5115
|
rb_define_method(c_domain, "block_commit", libvirt_domain_block_commit, -1);
|
5709
|
-
#endif
|
5710
|
-
#if HAVE_VIRDOMAINBLOCKPULL
|
5711
5116
|
rb_define_method(c_domain, "block_pull", libvirt_domain_block_pull, -1);
|
5712
|
-
#endif
|
5713
|
-
#if HAVE_VIRDOMAINBLOCKJOBSETSPEED
|
5714
5117
|
rb_define_method(c_domain, "block_job_speed=",
|
5715
5118
|
libvirt_domain_block_job_speed_equal, 1);
|
5716
|
-
#endif
|
5717
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES
|
5718
5119
|
rb_define_const(c_domain, "BLOCK_JOB_SPEED_BANDWIDTH_BYTES",
|
5719
5120
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES));
|
5720
|
-
#endif
|
5721
|
-
#if HAVE_VIRDOMAINGETBLOCKJOBINFO
|
5722
5121
|
rb_define_method(c_domain, "block_job_info", libvirt_domain_block_job_info,
|
5723
5122
|
-1);
|
5724
|
-
#endif
|
5725
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES
|
5726
5123
|
rb_define_const(c_domain, "BLOCK_JOB_INFO_BANDWIDTH_BYTES",
|
5727
5124
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES));
|
5728
|
-
#endif
|
5729
5125
|
|
5730
|
-
#if HAVE_VIRDOMAINBLOCKJOBABORT
|
5731
5126
|
rb_define_method(c_domain, "block_job_abort",
|
5732
5127
|
libvirt_domain_block_job_abort, -1);
|
5733
|
-
#endif
|
5734
|
-
#if HAVE_VIRDOMAINGETINTERFACEPARAMETERS
|
5735
5128
|
rb_define_method(c_domain, "interface_parameters",
|
5736
5129
|
libvirt_domain_interface_parameters, -1);
|
5737
5130
|
rb_define_method(c_domain, "interface_parameters=",
|
5738
5131
|
libvirt_domain_interface_parameters_equal, 1);
|
5739
|
-
#endif
|
5740
|
-
#if HAVE_VIRDOMAINBLOCKSTATSFLAGS
|
5741
5132
|
rb_define_method(c_domain, "block_stats_flags",
|
5742
5133
|
libvirt_domain_block_stats_flags, -1);
|
5743
|
-
#endif
|
5744
|
-
#if HAVE_VIRDOMAINGETNUMAPARAMETERS
|
5745
5134
|
rb_define_method(c_domain, "numa_parameters",
|
5746
5135
|
libvirt_domain_numa_parameters, -1);
|
5747
5136
|
rb_define_method(c_domain, "numa_parameters=",
|
5748
5137
|
libvirt_domain_numa_parameters_equal, 1);
|
5749
|
-
#endif
|
5750
|
-
#if HAVE_VIRDOMAINLXCOPENNAMESPACE
|
5751
5138
|
rb_define_method(c_domain, "lxc_open_namespace",
|
5752
5139
|
libvirt_domain_lxc_open_namespace, -1);
|
5753
|
-
#endif
|
5754
|
-
#if HAVE_VIRDOMAINQEMUAGENTCOMMAND
|
5755
5140
|
rb_define_method(c_domain, "qemu_agent_command",
|
5756
5141
|
libvirt_domain_qemu_agent_command, -1);
|
5757
|
-
#endif
|
5758
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK
|
5759
5142
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_BLOCK",
|
5760
5143
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK));
|
5761
|
-
#endif
|
5762
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT
|
5763
5144
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_DEFAULT",
|
5764
5145
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT));
|
5765
|
-
#endif
|
5766
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT
|
5767
5146
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_NOWAIT",
|
5768
5147
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
|
5769
|
-
#endif
|
5770
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN
|
5771
5148
|
rb_define_const(c_domain, "QEMU_AGENT_COMMAND_SHUTDOWN",
|
5772
5149
|
INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN));
|
5773
|
-
#endif
|
5774
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT
|
5775
5150
|
rb_define_const(c_domain, "QEMU_MONITOR_COMMAND_DEFAULT",
|
5776
5151
|
INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
|
5777
|
-
#endif
|
5778
|
-
#if HAVE_CONST_VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP
|
5779
5152
|
rb_define_const(c_domain, "QEMU_MONITOR_COMMAND_HMP",
|
5780
5153
|
INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP));
|
5781
|
-
#endif
|
5782
|
-
#if HAVE_VIRDOMAINLXCENTERNAMESPACE
|
5783
5154
|
rb_define_method(c_domain, "lxc_enter_namespace",
|
5784
5155
|
libvirt_domain_lxc_enter_namespace, -1);
|
5785
|
-
#endif
|
5786
|
-
#if HAVE_VIRDOMAINMIGRATE3
|
5787
5156
|
rb_define_method(c_domain, "migrate3", libvirt_domain_migrate3, -1);
|
5788
5157
|
rb_define_method(c_domain, "migrate_to_uri3",
|
5789
5158
|
libvirt_domain_migrate_to_uri3, -1);
|
5790
|
-
#endif
|
5791
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_SHALLOW
|
5792
5159
|
rb_define_const(c_domain, "BLOCK_COMMIT_SHALLOW",
|
5793
5160
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW));
|
5794
|
-
#endif
|
5795
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_DELETE
|
5796
5161
|
rb_define_const(c_domain, "BLOCK_COMMIT_DELETE",
|
5797
5162
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_DELETE));
|
5798
|
-
#endif
|
5799
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_ACTIVE
|
5800
5163
|
rb_define_const(c_domain, "BLOCK_COMMIT_ACTIVE",
|
5801
5164
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_ACTIVE));
|
5802
|
-
#endif
|
5803
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
|
5804
5165
|
rb_define_const(c_domain, "BLOCK_COMMIT_RELATIVE",
|
5805
5166
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_RELATIVE));
|
5806
|
-
#endif
|
5807
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES
|
5808
5167
|
rb_define_const(c_domain, "BLOCK_COMMIT_BANDWIDTH_BYTES",
|
5809
5168
|
INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES));
|
5810
|
-
#endif
|
5811
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN
|
5812
5169
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_UNKNOWN",
|
5813
5170
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN));
|
5814
|
-
#endif
|
5815
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_PULL
|
5816
5171
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_PULL",
|
5817
5172
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_PULL));
|
5818
|
-
#endif
|
5819
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_COPY
|
5820
5173
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_COPY",
|
5821
5174
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_COPY));
|
5822
|
-
#endif
|
5823
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT
|
5824
5175
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_COMMIT",
|
5825
5176
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT));
|
5826
|
-
#endif
|
5827
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT
|
5828
5177
|
rb_define_const(c_domain, "BLOCK_JOB_TYPE_ACTIVE_COMMIT",
|
5829
5178
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT));
|
5830
|
-
#endif
|
5831
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC
|
5832
5179
|
rb_define_const(c_domain, "BLOCK_JOB_ABORT_ASYNC",
|
5833
5180
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC));
|
5834
|
-
#endif
|
5835
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT
|
5836
5181
|
rb_define_const(c_domain, "BLOCK_JOB_ABORT_PIVOT",
|
5837
5182
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT));
|
5838
|
-
#endif
|
5839
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_COMPLETED
|
5840
5183
|
rb_define_const(c_domain, "BLOCK_JOB_COMPLETED",
|
5841
5184
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_COMPLETED));
|
5842
|
-
#endif
|
5843
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_FAILED
|
5844
5185
|
rb_define_const(c_domain, "BLOCK_JOB_FAILED",
|
5845
5186
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_FAILED));
|
5846
|
-
#endif
|
5847
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_CANCELED
|
5848
5187
|
rb_define_const(c_domain, "BLOCK_JOB_CANCELED",
|
5849
5188
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_CANCELED));
|
5850
|
-
#endif
|
5851
|
-
#if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_READY
|
5852
5189
|
rb_define_const(c_domain, "BLOCK_JOB_READY",
|
5853
5190
|
INT2NUM(VIR_DOMAIN_BLOCK_JOB_READY));
|
5854
|
-
#endif
|
5855
|
-
#if HAVE_VIRDOMAINGETCPUSTATS
|
5856
5191
|
rb_define_method(c_domain, "cpu_stats", libvirt_domain_cpu_stats, -1);
|
5857
|
-
#endif
|
5858
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_RAW
|
5859
5192
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_RAW",
|
5860
5193
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_RAW));
|
5861
|
-
#endif
|
5862
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB
|
5863
5194
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_ZLIB",
|
5864
5195
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB));
|
5865
|
-
#endif
|
5866
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO
|
5867
5196
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_LZO",
|
5868
5197
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO));
|
5869
|
-
#endif
|
5870
|
-
#if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY
|
5871
5198
|
rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_SNAPPY",
|
5872
5199
|
INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY));
|
5873
|
-
#endif
|
5874
|
-
#if HAVE_VIRDOMAINGETTIME
|
5875
5200
|
rb_define_method(c_domain, "time", libvirt_domain_get_time, -1);
|
5876
|
-
#endif
|
5877
|
-
#if HAVE_VIRDOMAINSETTIME
|
5878
5201
|
rb_define_method(c_domain, "time=", libvirt_domain_time_equal, 1);
|
5879
|
-
#endif
|
5880
|
-
#if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
|
5881
5202
|
rb_define_method(c_domain, "core_dump_with_format",
|
5882
5203
|
libvirt_domain_core_dump_with_format, -1);
|
5883
|
-
#endif
|
5884
|
-
#if HAVE_VIRDOMAINFSFREEZE
|
5885
5204
|
rb_define_method(c_domain, "fs_freeze", libvirt_domain_fs_freeze, -1);
|
5886
|
-
#endif
|
5887
|
-
#if HAVE_VIRDOMAINFSTHAW
|
5888
5205
|
rb_define_method(c_domain, "fs_thaw", libvirt_domain_fs_thaw, -1);
|
5889
|
-
#endif
|
5890
|
-
#if HAVE_VIRDOMAINGETFSINFO
|
5891
5206
|
rb_define_method(c_domain, "fs_info", libvirt_domain_fs_info, -1);
|
5892
|
-
#endif
|
5893
|
-
#if HAVE_VIRDOMAINRENAME
|
5894
5207
|
rb_define_method(c_domain, "rename", libvirt_domain_rename, -1);
|
5895
|
-
#endif
|
5896
|
-
#if HAVE_VIRDOMAINSETUSERPASSWORD
|
5897
5208
|
rb_define_method(c_domain, "user_password=", libvirt_domain_user_password_equal, 1);
|
5898
|
-
#endif
|
5899
|
-
#if HAVE_CONST_VIR_DOMAIN_PASSWORD_ENCRYPTED
|
5900
5209
|
rb_define_const(c_domain, "PASSWORD_ENCRYPTED",
|
5901
5210
|
INT2NUM(VIR_DOMAIN_PASSWORD_ENCRYPTED));
|
5902
|
-
#endif
|
5903
|
-
#if HAVE_CONST_VIR_DOMAIN_TIME_SYNC
|
5904
5211
|
rb_define_const(c_domain, "TIME_SYNC", INT2NUM(VIR_DOMAIN_TIME_SYNC));
|
5905
|
-
#endif
|
5906
5212
|
}
|