ruby-libvirt 0.8.0 → 0.8.2

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