ruby-libvirt 0.5.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/libvirt/domain.c CHANGED
@@ -2,7 +2,7 @@
2
2
  * domain.c: virDomain methods
3
3
  *
4
4
  * Copyright (C) 2007,2010 Red Hat Inc.
5
- * Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
5
+ * Copyright (C) 2013-2016 Chris Lalancette <clalancette@gmail.com>
6
6
  *
7
7
  * This library is free software; you can redistribute it and/or
8
8
  * modify it under the terms of the GNU Lesser General Public
@@ -23,7 +23,7 @@
23
23
  #include <unistd.h>
24
24
  #include <ruby.h>
25
25
  /* we need to include st.h since ruby 1.8 needs it for RHash */
26
- #include <st.h>
26
+ #include <ruby/st.h>
27
27
  #include <libvirt/libvirt.h>
28
28
  #if HAVE_VIRDOMAINQEMUMONITORCOMMAND
29
29
  #include <libvirt/libvirt-qemu.h>
@@ -129,7 +129,7 @@ static void domain_input_to_fixnum_and_flags(VALUE in, VALUE *hash, VALUE *flags
129
129
  * call-seq:
130
130
  * dom.migrate(dconn, flags=0, dname=nil, uri=nil, bandwidth=0) -> Libvirt::Domain
131
131
  *
132
- * Call virDomainMigrate[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrate]
132
+ * Call virDomainMigrate[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate]
133
133
  * to migrate a domain from the host on this connection to the connection
134
134
  * referenced in dconn.
135
135
  */
@@ -159,7 +159,7 @@ static VALUE libvirt_domain_migrate(int argc, VALUE *argv, VALUE d)
159
159
  * call-seq:
160
160
  * dom.migrate_to_uri(duri, flags=0, dname=nil, bandwidth=0) -> nil
161
161
  *
162
- * Call virDomainMigrateToURI[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI]
162
+ * Call virDomainMigrateToURI[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI]
163
163
  * to migrate a domain from the host on this connection to the host whose
164
164
  * libvirt URI is duri.
165
165
  */
@@ -183,7 +183,7 @@ static VALUE libvirt_domain_migrate_to_uri(int argc, VALUE *argv, VALUE d)
183
183
  * call-seq:
184
184
  * dom.migrate_set_max_downtime(downtime, flags=0) -> nil
185
185
  *
186
- * Call virDomainMigrateSetMaxDowntime[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetMaxDowntime]
186
+ * Call virDomainMigrateSetMaxDowntime[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime]
187
187
  * to set the maximum downtime desired for live migration. Deprecated; use
188
188
  * dom.migrate_max_downtime= instead.
189
189
  */
@@ -205,7 +205,7 @@ static VALUE libvirt_domain_migrate_set_max_downtime(int argc, VALUE *argv,
205
205
  * call-seq:
206
206
  * dom.migrate_max_downtime = downtime,flags=0
207
207
  *
208
- * Call virDomainMigrateSetMaxDowntime[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetMaxDowntime]
208
+ * Call virDomainMigrateSetMaxDowntime[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime]
209
209
  * to set the maximum downtime desired for live migration.
210
210
  */
211
211
  static VALUE libvirt_domain_migrate_max_downtime_equal(VALUE d, VALUE in)
@@ -227,7 +227,7 @@ static VALUE libvirt_domain_migrate_max_downtime_equal(VALUE d, VALUE in)
227
227
  * call-seq:
228
228
  * dom.migrate2(dconn, dxml=nil, flags=0, dname=nil, uri=nil, bandwidth=0) -> Libvirt::Domain
229
229
  *
230
- * Call virDomainMigrate2[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrate2]
230
+ * Call virDomainMigrate2[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate2]
231
231
  * to migrate a domain from the host on this connection to the connection
232
232
  * referenced in dconn.
233
233
  */
@@ -257,7 +257,7 @@ static VALUE libvirt_domain_migrate2(int argc, VALUE *argv, VALUE d)
257
257
  * call-seq:
258
258
  * dom.migrate_to_uri2(duri=nil, migrate_uri=nil, dxml=nil, flags=0, dname=nil, bandwidth=0) -> nil
259
259
  *
260
- * Call virDomainMigrateToURI2[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI2]
260
+ * Call virDomainMigrateToURI2[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI2]
261
261
  * to migrate a domain from the host on this connection to the host whose
262
262
  * libvirt URI is duri.
263
263
  */
@@ -283,7 +283,7 @@ static VALUE libvirt_domain_migrate_to_uri2(int argc, VALUE *argv, VALUE d)
283
283
  * call-seq:
284
284
  * dom.migrate_set_max_speed(bandwidth, flags=0) -> nil
285
285
  *
286
- * Call virDomainMigrateSetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetMaxSpeed]
286
+ * Call virDomainMigrateSetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed]
287
287
  * to set the maximum bandwidth allowed for live migration. Deprecated; use
288
288
  * dom.migrate_max_speed= instead.
289
289
  */
@@ -305,7 +305,7 @@ static VALUE libvirt_domain_migrate_set_max_speed(int argc, VALUE *argv,
305
305
  * call-seq:
306
306
  * dom.migrate_max_speed = bandwidth,flags=0
307
307
  *
308
- * Call virDomainMigrateSetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetMaxSpeed]
308
+ * Call virDomainMigrateSetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxSpeed]
309
309
  * to set the maximum bandwidth allowed for live migration.
310
310
  */
311
311
  static VALUE libvirt_domain_migrate_max_speed_equal(VALUE d, VALUE in)
@@ -326,7 +326,7 @@ static VALUE libvirt_domain_migrate_max_speed_equal(VALUE d, VALUE in)
326
326
  * call-seq:
327
327
  * dom.shutdown(flags=0) -> nil
328
328
  *
329
- * Call virDomainShutdown[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainShutdown]
329
+ * Call virDomainShutdown[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainShutdown]
330
330
  * to do a soft shutdown of the domain. The mechanism for doing the shutdown
331
331
  * is hypervisor specific, and may require software running inside the domain
332
332
  * to succeed.
@@ -357,7 +357,7 @@ static VALUE libvirt_domain_shutdown(int argc, VALUE *argv, VALUE d)
357
357
  * call-seq:
358
358
  * dom.reboot(flags=0) -> nil
359
359
  *
360
- * Call virDomainReboot[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainReboot]
360
+ * Call virDomainReboot[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot]
361
361
  * to do a reboot of the domain.
362
362
  */
363
363
  static VALUE libvirt_domain_reboot(int argc, VALUE *argv, VALUE d)
@@ -375,7 +375,7 @@ static VALUE libvirt_domain_reboot(int argc, VALUE *argv, VALUE d)
375
375
  * call-seq:
376
376
  * dom.destroy(flags=0) -> nil
377
377
  *
378
- * Call virDomainDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainDestroy]
378
+ * Call virDomainDestroy[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainDestroy]
379
379
  * to do a hard power-off of the domain.
380
380
  */
381
381
  static VALUE libvirt_domain_destroy(int argc, VALUE *argv, VALUE d)
@@ -403,7 +403,7 @@ static VALUE libvirt_domain_destroy(int argc, VALUE *argv, VALUE d)
403
403
  * call-seq:
404
404
  * dom.suspend -> nil
405
405
  *
406
- * Call virDomainSuspend[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSuspend]
406
+ * Call virDomainSuspend[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSuspend]
407
407
  * to stop the domain from executing. The domain will still continue to
408
408
  * consume memory, but will not take any CPU time.
409
409
  */
@@ -418,7 +418,7 @@ static VALUE libvirt_domain_suspend(VALUE d)
418
418
  * call-seq:
419
419
  * dom.resume -> nil
420
420
  *
421
- * Call virDomainResume[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainResume]
421
+ * Call virDomainResume[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume]
422
422
  * to resume a suspended domain. After this call the domain will start
423
423
  * consuming CPU resources again.
424
424
  */
@@ -432,7 +432,7 @@ static VALUE libvirt_domain_resume(VALUE d)
432
432
  * call-seq:
433
433
  * dom.save(filename, dxml=nil, flags=0) -> nil
434
434
  *
435
- * Call virDomainSave[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSave]
435
+ * Call virDomainSave[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSave]
436
436
  * to save the domain state to filename. After this call, the domain will no
437
437
  * longer be consuming any resources.
438
438
  */
@@ -467,7 +467,7 @@ static VALUE libvirt_domain_save(int argc, VALUE *argv, VALUE d)
467
467
  * call-seq:
468
468
  * dom.managed_save(flags=0) -> nil
469
469
  *
470
- * Call virDomainManagedSave[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainManagedSave]
470
+ * Call virDomainManagedSave[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSave]
471
471
  * to do a managed save of the domain. The domain will be saved to a place
472
472
  * of libvirt's choosing.
473
473
  */
@@ -487,7 +487,7 @@ static VALUE libvirt_domain_managed_save(int argc, VALUE *argv, VALUE d)
487
487
  * call-seq:
488
488
  * dom.has_managed_save?(flags=0) -> [True|False]
489
489
  *
490
- * Call virDomainHasManagedSaveImage[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainHasManagedSaveImage]
490
+ * Call virDomainHasManagedSaveImage[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasManagedSaveImage]
491
491
  * to determine if a particular domain has a managed save image.
492
492
  */
493
493
  static VALUE libvirt_domain_has_managed_save(int argc, VALUE *argv, VALUE d)
@@ -506,7 +506,7 @@ static VALUE libvirt_domain_has_managed_save(int argc, VALUE *argv, VALUE d)
506
506
  * call-seq:
507
507
  * dom.managed_save_remove(flags=0) -> nil
508
508
  *
509
- * Call virDomainManagedSaveRemove[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainManagedSaveRemove]
509
+ * Call virDomainManagedSaveRemove[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSaveRemove]
510
510
  * to remove the managed save image for a domain.
511
511
  */
512
512
  static VALUE libvirt_domain_managed_save_remove(int argc, VALUE *argv, VALUE d)
@@ -526,7 +526,7 @@ static VALUE libvirt_domain_managed_save_remove(int argc, VALUE *argv, VALUE d)
526
526
  * call-seq:
527
527
  * dom.core_dump(filename, flags=0) -> nil
528
528
  *
529
- * Call virDomainCoreDump[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainCoreDump]
529
+ * Call virDomainCoreDump[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump]
530
530
  * to do a full memory dump of the domain to filename.
531
531
  */
532
532
  static VALUE libvirt_domain_core_dump(int argc, VALUE *argv, VALUE d)
@@ -546,7 +546,7 @@ static VALUE libvirt_domain_core_dump(int argc, VALUE *argv, VALUE d)
546
546
  * call-seq:
547
547
  * Libvirt::Domain::restore(conn, filename) -> nil
548
548
  *
549
- * Call virDomainRestore[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainRestore]
549
+ * Call virDomainRestore[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainRestore]
550
550
  * to restore the domain from the filename.
551
551
  */
552
552
  static VALUE libvirt_domain_s_restore(VALUE RUBY_LIBVIRT_UNUSED(klass), VALUE c,
@@ -562,7 +562,7 @@ static VALUE libvirt_domain_s_restore(VALUE RUBY_LIBVIRT_UNUSED(klass), VALUE c,
562
562
  * call-seq:
563
563
  * dom.info -> Libvirt::Domain::Info
564
564
  *
565
- * Call virDomainGetInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetInfo]
565
+ * Call virDomainGetInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInfo]
566
566
  * to retrieve domain information.
567
567
  */
568
568
  static VALUE libvirt_domain_info(VALUE d)
@@ -590,7 +590,7 @@ static VALUE libvirt_domain_info(VALUE d)
590
590
  * call-seq:
591
591
  * dom.security_label -> Libvirt::Domain::SecurityLabel
592
592
  *
593
- * Call virDomainGetSecurityLabel[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetSecurityLabel]
593
+ * Call virDomainGetSecurityLabel[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabel]
594
594
  * to retrieve the security label applied to this domain.
595
595
  */
596
596
  static VALUE libvirt_domain_security_label(VALUE d)
@@ -616,7 +616,7 @@ static VALUE libvirt_domain_security_label(VALUE d)
616
616
  * call-seq:
617
617
  * dom.block_stats(path) -> Libvirt::Domain::BlockStats
618
618
  *
619
- * Call virDomainBlockStats[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockStats]
619
+ * Call virDomainBlockStats[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockStats]
620
620
  * to retrieve statistics about domain block device path.
621
621
  */
622
622
  static VALUE libvirt_domain_block_stats(VALUE d, VALUE path)
@@ -645,7 +645,7 @@ static VALUE libvirt_domain_block_stats(VALUE d, VALUE path)
645
645
  * call-seq:
646
646
  * dom.memory_stats(flags=0) -> [ Libvirt::Domain::MemoryStats ]
647
647
  *
648
- * Call virDomainMemoryStats[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMemoryStats]
648
+ * Call virDomainMemoryStats[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryStats]
649
649
  * to retrieve statistics about the amount of memory consumed by a domain.
650
650
  */
651
651
  static VALUE libvirt_domain_memory_stats(int argc, VALUE *argv, VALUE d)
@@ -689,7 +689,7 @@ static VALUE libvirt_domain_memory_stats(int argc, VALUE *argv, VALUE d)
689
689
  * call-seq:
690
690
  * dom.blockinfo(path, flags=0) -> Libvirt::Domain::BlockInfo
691
691
  *
692
- * Call virDomainGetBlockInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetBlockInfo]
692
+ * Call virDomainGetBlockInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockInfo]
693
693
  * to retrieve information about the backing file path for the domain.
694
694
  */
695
695
  static VALUE libvirt_domain_block_info(int argc, VALUE *argv, VALUE d)
@@ -718,9 +718,9 @@ static VALUE libvirt_domain_block_info(int argc, VALUE *argv, VALUE d)
718
718
  #if HAVE_VIRDOMAINBLOCKPEEK
719
719
  /*
720
720
  * call-seq:
721
- * dom.block_peek(path, offset, size, flags=0) -> string
721
+ * dom.block_peek(path, offset, size, flags=0) -> String
722
722
  *
723
- * Call virDomainBlockPeek[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockPeek]
723
+ * Call virDomainBlockPeek[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPeek]
724
724
  * to read size number of bytes, starting at offset offset from domain backing
725
725
  * file path. Due to limitations of the libvirt remote protocol, the user
726
726
  * should never request more than 64k bytes.
@@ -748,9 +748,9 @@ static VALUE libvirt_domain_block_peek(int argc, VALUE *argv, VALUE d)
748
748
  #if HAVE_VIRDOMAINMEMORYPEEK
749
749
  /*
750
750
  * call-seq:
751
- * dom.memory_peek(start, size, flags=Libvirt::Domain::MEMORY_VIRTUAL) -> string
751
+ * dom.memory_peek(start, size, flags=Libvirt::Domain::MEMORY_VIRTUAL) -> String
752
752
  *
753
- * Call virDomainMemoryPeek[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMemoryPeek]
753
+ * Call virDomainMemoryPeek[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryPeek]
754
754
  * to read size number of bytes from offset start from the domain memory.
755
755
  * Due to limitations of the libvirt remote protocol, the user
756
756
  * should never request more than 64k bytes.
@@ -781,7 +781,7 @@ static VALUE libvirt_domain_memory_peek(int argc, VALUE *argv, VALUE d)
781
781
  /* call-seq:
782
782
  * dom.vcpus -> [ Libvirt::Domain::VCPUInfo ]
783
783
  *
784
- * Call virDomainGetVcpus[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetVcpus]
784
+ * Call virDomainGetVcpus[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpus]
785
785
  * to retrieve detailed information about the state of a domain's virtual CPUs.
786
786
  */
787
787
  static VALUE libvirt_domain_vcpus(VALUE d)
@@ -803,7 +803,7 @@ static VALUE libvirt_domain_vcpus(VALUE d)
803
803
 
804
804
  cpumaplen = VIR_CPU_MAPLEN(maxcpus);
805
805
 
806
- cpumap = alloca(cpumaplen);
806
+ cpumap = alloca(sizeof(unsigned char) * cpumaplen * dominfo.nrVirtCpu);
807
807
 
808
808
  r = virDomainGetVcpus(ruby_libvirt_domain_get(d), cpuinfo,
809
809
  dominfo.nrVirtCpu, cpumap, cpumaplen);
@@ -832,15 +832,16 @@ static VALUE libvirt_domain_vcpus(VALUE d)
832
832
 
833
833
  result = rb_ary_new();
834
834
 
835
- for (i = 0; i < dominfo.nrVirtCpu; i++) {
835
+ for (i = 0; i < r; i++) {
836
836
  vcpuinfo = rb_class_new_instance(0, NULL, c_domain_vcpuinfo);
837
- rb_iv_set(vcpuinfo, "@number", UINT2NUM(i));
838
837
  if (cpuinfo != NULL) {
838
+ rb_iv_set(vcpuinfo, "@number", INT2NUM(cpuinfo[i].number));
839
839
  rb_iv_set(vcpuinfo, "@state", INT2NUM(cpuinfo[i].state));
840
840
  rb_iv_set(vcpuinfo, "@cpu_time", ULL2NUM(cpuinfo[i].cpuTime));
841
841
  rb_iv_set(vcpuinfo, "@cpu", INT2NUM(cpuinfo[i].cpu));
842
842
  }
843
843
  else {
844
+ rb_iv_set(vcpuinfo, "@number", Qnil);
844
845
  rb_iv_set(vcpuinfo, "@state", Qnil);
845
846
  rb_iv_set(vcpuinfo, "@cpu_time", Qnil);
846
847
  rb_iv_set(vcpuinfo, "@cpu", Qnil);
@@ -865,7 +866,7 @@ static VALUE libvirt_domain_vcpus(VALUE d)
865
866
  * call-seq:
866
867
  * dom.active? -> [true|false]
867
868
  *
868
- * Call virDomainIsActive[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainIsActive]
869
+ * Call virDomainIsActive[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive]
869
870
  * to determine if this domain is currently active.
870
871
  */
871
872
  static VALUE libvirt_domain_active_p(VALUE d)
@@ -881,7 +882,7 @@ static VALUE libvirt_domain_active_p(VALUE d)
881
882
  * call-seq:
882
883
  * dom.persistent? -> [true|false]
883
884
  *
884
- * Call virDomainIsPersistent[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainIsPersistent]
885
+ * Call virDomainIsPersistent[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsPersistent]
885
886
  * to determine if this is a persistent domain.
886
887
  */
887
888
  static VALUE libvirt_domain_persistent_p(VALUE d)
@@ -896,7 +897,7 @@ static VALUE libvirt_domain_persistent_p(VALUE d)
896
897
  * call-seq:
897
898
  * dom.ifinfo(if) -> Libvirt::Domain::IfInfo
898
899
  *
899
- * Call virDomainInterfaceStats[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainInterfaceStats]
900
+ * Call virDomainInterfaceStats[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceStats]
900
901
  * to retrieve statistics about domain interface if.
901
902
  */
902
903
  static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
@@ -928,9 +929,9 @@ static VALUE libvirt_domain_if_stats(VALUE d, VALUE sif)
928
929
 
929
930
  /*
930
931
  * call-seq:
931
- * dom.name -> string
932
+ * dom.name -> String
932
933
  *
933
- * Call virDomainGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetName]
934
+ * Call virDomainGetName[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetName]
934
935
  * to retrieve the name of this domain.
935
936
  */
936
937
  static VALUE libvirt_domain_name(VALUE d)
@@ -942,9 +943,9 @@ static VALUE libvirt_domain_name(VALUE d)
942
943
 
943
944
  /*
944
945
  * call-seq:
945
- * dom.id -> fixnum
946
+ * dom.id -> Fixnum
946
947
  *
947
- * Call virDomainGetID[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetID]
948
+ * Call virDomainGetID[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetID]
948
949
  * to retrieve the ID of this domain. If the domain isn't running, this will
949
950
  * be -1.
950
951
  */
@@ -967,9 +968,9 @@ static VALUE libvirt_domain_id(VALUE d)
967
968
 
968
969
  /*
969
970
  * call-seq:
970
- * dom.uuid -> string
971
+ * dom.uuid -> String
971
972
  *
972
- * Call virDomainGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetUUIDString]
973
+ * Call virDomainGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString]
973
974
  * to retrieve the UUID of this domain.
974
975
  */
975
976
  static VALUE libvirt_domain_uuid(VALUE d)
@@ -981,9 +982,9 @@ static VALUE libvirt_domain_uuid(VALUE d)
981
982
 
982
983
  /*
983
984
  * call-seq:
984
- * dom.os_type -> string
985
+ * dom.os_type -> String
985
986
  *
986
- * Call virDomainGetOSType[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetOSType]
987
+ * Call virDomainGetOSType[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetOSType]
987
988
  * to retrieve the os_type of this domain. In libvirt terms, os_type determines
988
989
  * whether this domain is fully virtualized, paravirtualized, or a container.
989
990
  */
@@ -996,9 +997,9 @@ static VALUE libvirt_domain_os_type(VALUE d)
996
997
 
997
998
  /*
998
999
  * call-seq:
999
- * dom.max_memory -> fixnum
1000
+ * dom.max_memory -> Fixnum
1000
1001
  *
1001
- * Call virDomainGetMaxMemory[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetMaxMemory]
1002
+ * Call virDomainGetMaxMemory[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxMemory]
1002
1003
  * to retrieve the maximum amount of memory this domain is allowed to access.
1003
1004
  * Note that the current amount of memory this domain is allowed to access may
1004
1005
  * be different (see dom.memory_set).
@@ -1019,7 +1020,7 @@ static VALUE libvirt_domain_max_memory(VALUE d)
1019
1020
  * call-seq:
1020
1021
  * dom.max_memory = Fixnum
1021
1022
  *
1022
- * Call virDomainSetMaxMemory[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetMaxMemory]
1023
+ * Call virDomainSetMaxMemory[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMaxMemory]
1023
1024
  * to set the maximum amount of memory (in kilobytes) this domain should be
1024
1025
  * allowed to access.
1025
1026
  */
@@ -1040,7 +1041,7 @@ static VALUE libvirt_domain_max_memory_equal(VALUE d, VALUE max_memory)
1040
1041
  * call-seq:
1041
1042
  * dom.memory = Fixnum,flags=0
1042
1043
  *
1043
- * Call virDomainSetMemory[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetMemory]
1044
+ * Call virDomainSetMemory[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemory]
1044
1045
  * to set the amount of memory (in kilobytes) this domain should currently
1045
1046
  * have. Note this will only succeed if both the hypervisor and the domain on
1046
1047
  * this connection support ballooning.
@@ -1070,9 +1071,9 @@ static VALUE libvirt_domain_memory_equal(VALUE d, VALUE in)
1070
1071
 
1071
1072
  /*
1072
1073
  * call-seq:
1073
- * dom.max_vcpus -> fixnum
1074
+ * dom.max_vcpus -> Fixnum
1074
1075
  *
1075
- * Call virDomainGetMaxVcpus[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetMaxVcpus]
1076
+ * Call virDomainGetMaxVcpus[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus]
1076
1077
  * to retrieve the maximum number of virtual CPUs this domain can use.
1077
1078
  */
1078
1079
  static VALUE libvirt_domain_max_vcpus(VALUE d)
@@ -1084,9 +1085,9 @@ static VALUE libvirt_domain_max_vcpus(VALUE d)
1084
1085
 
1085
1086
  #if HAVE_VIRDOMAINGETVCPUSFLAGS
1086
1087
  /* call-seq:
1087
- * dom.num_vcpus(flags) -> fixnum
1088
+ * dom.num_vcpus(flags) -> Fixnum
1088
1089
  *
1089
- * Call virDomainGetVcpusFlags[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetVcpusFlags]
1090
+ * Call virDomainGetVcpusFlags[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetVcpusFlags]
1090
1091
  * to retrieve the number of virtual CPUs assigned to this domain.
1091
1092
  */
1092
1093
  static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
@@ -1102,7 +1103,7 @@ static VALUE libvirt_domain_num_vcpus(VALUE d, VALUE flags)
1102
1103
  * call-seq:
1103
1104
  * dom.vcpus = Fixnum,flags=0
1104
1105
  *
1105
- * Call virDomainSetVcpus[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetVcpus]
1106
+ * Call virDomainSetVcpus[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpus]
1106
1107
  * to set the current number of virtual CPUs this domain should have. Note
1107
1108
  * that this will only work if both the hypervisor and domain on this
1108
1109
  * connection support virtual CPU hotplug/hot-unplug.
@@ -1152,7 +1153,7 @@ static VALUE libvirt_domain_vcpus_equal(VALUE d, VALUE in)
1152
1153
  * dom.vcpus_flags = Fixnum,flags=0
1153
1154
  *
1154
1155
 
1155
- * Call virDomainSetVcpusFlags[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetVcpusFlags]
1156
+ * Call virDomainSetVcpusFlags[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetVcpusFlags]
1156
1157
  * to set the current number of virtual CPUs this domain should have. The
1157
1158
  * flags parameter controls whether the change is made to the running domain
1158
1159
  * the domain configuration, or both, and must not be 0. Deprecated;
@@ -1175,7 +1176,7 @@ static VALUE libvirt_domain_vcpus_flags_equal(VALUE d, VALUE in)
1175
1176
  * call-seq:
1176
1177
  * dom.pin_vcpu(vcpu, cpulist, flags=0) -> nil
1177
1178
  *
1178
- * Call virDomainPinVcpu[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPinVcpu]
1179
+ * Call virDomainPinVcpu[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
1179
1180
  * to pin a particular virtual CPU to a range of physical processors. The
1180
1181
  * cpulist should be an array of Fixnums representing the physical processors
1181
1182
  * this virtual CPU should be allowed to be scheduled on.
@@ -1194,7 +1195,7 @@ static VALUE libvirt_domain_pin_vcpu(int argc, VALUE *argv, VALUE d)
1194
1195
 
1195
1196
  cpumaplen = VIR_CPU_MAPLEN(maxcpus);
1196
1197
 
1197
- cpumap = alloca(cpumaplen);
1198
+ cpumap = alloca(sizeof(unsigned char) * cpumaplen);
1198
1199
  MEMZERO(cpumap, unsigned char, cpumaplen);
1199
1200
 
1200
1201
  for (i = 0; i < RARRAY_LEN(cpulist); i++) {
@@ -1222,9 +1223,9 @@ static VALUE libvirt_domain_pin_vcpu(int argc, VALUE *argv, VALUE d)
1222
1223
 
1223
1224
  /*
1224
1225
  * call-seq:
1225
- * dom.xml_desc(flags=0) -> string
1226
+ * dom.xml_desc(flags=0) -> String
1226
1227
  *
1227
- * Call virDomainGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetXMLDesc]
1228
+ * Call virDomainGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc]
1228
1229
  * to retrieve the XML describing this domain.
1229
1230
  */
1230
1231
  static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
@@ -1243,7 +1244,7 @@ static VALUE libvirt_domain_xml_desc(int argc, VALUE *argv, VALUE d)
1243
1244
  * call-seq:
1244
1245
  * dom.undefine(flags=0) -> nil
1245
1246
  *
1246
- * Call virDomainUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainUndefine]
1247
+ * Call virDomainUndefine[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefine]
1247
1248
  * to undefine the domain. After this call, the domain object is no longer
1248
1249
  * valid.
1249
1250
  */
@@ -1273,7 +1274,7 @@ static VALUE libvirt_domain_undefine(int argc, VALUE *argv, VALUE d)
1273
1274
  * call-seq:
1274
1275
  * dom.create(flags=0) -> nil
1275
1276
  *
1276
- * Call virDomainCreate[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainCreate]
1277
+ * Call virDomainCreate[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreate]
1277
1278
  * to start an already defined domain.
1278
1279
  */
1279
1280
  static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
@@ -1300,7 +1301,7 @@ static VALUE libvirt_domain_create(int argc, VALUE *argv, VALUE d)
1300
1301
  * call-seq:
1301
1302
  * dom.autostart -> [true|false]
1302
1303
  *
1303
- * Call virDomainGetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetAutostart]
1304
+ * Call virDomainGetAutostart[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetAutostart]
1304
1305
  * to find out the state of the autostart flag for a domain.
1305
1306
  */
1306
1307
  static VALUE libvirt_domain_autostart(VALUE d)
@@ -1318,7 +1319,7 @@ static VALUE libvirt_domain_autostart(VALUE d)
1318
1319
  * call-seq:
1319
1320
  * dom.autostart = [true|false]
1320
1321
  *
1321
- * Call virDomainSetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetAutostart]
1322
+ * Call virDomainSetAutostart[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetAutostart]
1322
1323
  * to make this domain autostart when libvirtd starts up.
1323
1324
  */
1324
1325
  static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
@@ -1338,7 +1339,7 @@ static VALUE libvirt_domain_autostart_equal(VALUE d, VALUE autostart)
1338
1339
  * call-seq:
1339
1340
  * dom.attach_device(device_xml, flags=0) -> nil
1340
1341
  *
1341
- * Call virDomainAttachDevice[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainAttachDevice]
1342
+ * Call virDomainAttachDevice[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDevice]
1342
1343
  * to attach the device described by the device_xml to the domain.
1343
1344
  */
1344
1345
  static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
@@ -1368,7 +1369,7 @@ static VALUE libvirt_domain_attach_device(int argc, VALUE *argv, VALUE d)
1368
1369
  * call-seq:
1369
1370
  * dom.detach_device(device_xml, flags=0) -> nil
1370
1371
  *
1371
- * Call virDomainDetachDevice[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainDetachDevice]
1372
+ * Call virDomainDetachDevice[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDevice]
1372
1373
  * to detach the device described by the device_xml from the domain.
1373
1374
  */
1374
1375
  static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
@@ -1399,7 +1400,7 @@ static VALUE libvirt_domain_detach_device(int argc, VALUE *argv, VALUE d)
1399
1400
  * call-seq:
1400
1401
  * dom.update_device(device_xml, flags=0) -> nil
1401
1402
  *
1402
- * Call virDomainUpdateDeviceFlags[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainUpdateDeviceFlags]
1403
+ * Call virDomainUpdateDeviceFlags[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags]
1403
1404
  * to update the device described by the device_xml.
1404
1405
  */
1405
1406
  static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
@@ -1420,7 +1421,7 @@ static VALUE libvirt_domain_update_device(int argc, VALUE *argv, VALUE d)
1420
1421
  * call-seq:
1421
1422
  * dom.free -> nil
1422
1423
  *
1423
- * Call virDomainFree[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainFree]
1424
+ * Call virDomainFree[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainFree]
1424
1425
  * to free a domain object.
1425
1426
  */
1426
1427
  static VALUE libvirt_domain_free(VALUE d)
@@ -1455,7 +1456,7 @@ static virDomainSnapshotPtr domain_snapshot_get(VALUE d)
1455
1456
  * call-seq:
1456
1457
  * dom.snapshot_create_xml(snapshot_xml, flags=0) -> Libvirt::Domain::Snapshot
1457
1458
  *
1458
- * Call virDomainSnapshotCreateXML[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotCreateXML]
1459
+ * Call virDomainSnapshotCreateXML[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotCreateXML]
1459
1460
  * to create a new snapshot based on snapshot_xml.
1460
1461
  */
1461
1462
  static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
@@ -1478,9 +1479,9 @@ static VALUE libvirt_domain_snapshot_create_xml(int argc, VALUE *argv, VALUE d)
1478
1479
 
1479
1480
  /*
1480
1481
  * call-seq:
1481
- * dom.num_of_snapshots(flags=0) -> fixnum
1482
+ * dom.num_of_snapshots(flags=0) -> Fixnum
1482
1483
  *
1483
- * Call virDomainSnapshotNum[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotNum]
1484
+ * Call virDomainSnapshotNum[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNum]
1484
1485
  * to retrieve the number of available snapshots for this domain.
1485
1486
  */
1486
1487
  static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
@@ -1499,7 +1500,7 @@ static VALUE libvirt_domain_num_of_snapshots(int argc, VALUE *argv, VALUE d)
1499
1500
  * call-seq:
1500
1501
  * dom.list_snapshots(flags=0) -> list
1501
1502
  *
1502
- * Call virDomainSnapshotListNames[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotListNames]
1503
+ * Call virDomainSnapshotListNames[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListNames]
1503
1504
  * to retrieve a list of snapshot names available for this domain.
1504
1505
  */
1505
1506
  static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
@@ -1539,7 +1540,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
1539
1540
  * call-seq:
1540
1541
  * dom.lookup_snapshot_by_name(name, flags=0) -> Libvirt::Domain::Snapshot
1541
1542
  *
1542
- * Call virDomainSnapshotLookupByName[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotLookupByName]
1543
+ * Call virDomainSnapshotLookupByName[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotLookupByName]
1543
1544
  * to retrieve a snapshot object corresponding to snapshot name.
1544
1545
  */
1545
1546
  static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
@@ -1564,7 +1565,7 @@ static VALUE libvirt_domain_lookup_snapshot_by_name(int argc, VALUE *argv,
1564
1565
  * call-seq:
1565
1566
  * dom.has_current_snapshot?(flags=0) -> [true|false]
1566
1567
  *
1567
- * Call virDomainHasCurrentSnapshot[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainHasCurrentSnapshot]
1568
+ * Call virDomainHasCurrentSnapshot[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainHasCurrentSnapshot]
1568
1569
  * to find out if this domain has a snapshot active.
1569
1570
  */
1570
1571
  static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
@@ -1584,7 +1585,7 @@ static VALUE libvirt_domain_has_current_snapshot_p(int argc, VALUE *argv,
1584
1585
  * call-seq:
1585
1586
  * dom.revert_to_snapshot(snapshot_object, flags=0) -> nil
1586
1587
  *
1587
- * Call virDomainRevertToSnapshot[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainRevertToSnapshot]
1588
+ * Call virDomainRevertToSnapshot[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainRevertToSnapshot]
1588
1589
  * to restore this domain to a previously saved snapshot.
1589
1590
  */
1590
1591
  static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
@@ -1603,7 +1604,7 @@ static VALUE libvirt_domain_revert_to_snapshot(int argc, VALUE *argv, VALUE d)
1603
1604
  * call-seq:
1604
1605
  * dom.current_snapshot(flags=0) -> Libvirt::Domain::Snapshot
1605
1606
  *
1606
- * Call virDomainCurrentSnapshot[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainCurrentSnapshot]
1607
+ * Call virDomainCurrentSnapshot[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainCurrentSnapshot]
1607
1608
  * to retrieve the current snapshot for this domain (if any).
1608
1609
  */
1609
1610
  static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
@@ -1624,9 +1625,9 @@ static VALUE libvirt_domain_current_snapshot(int argc, VALUE *argv, VALUE d)
1624
1625
 
1625
1626
  /*
1626
1627
  * call-seq:
1627
- * snapshot.xml_desc(flags=0) -> string
1628
+ * snapshot.xml_desc(flags=0) -> String
1628
1629
  *
1629
- * Call virDomainSnapshotGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotGetXMLDesc]
1630
+ * Call virDomainSnapshotGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetXMLDesc]
1630
1631
  * to retrieve the xml description for this snapshot.
1631
1632
  */
1632
1633
  static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
@@ -1645,7 +1646,7 @@ static VALUE libvirt_domain_snapshot_xml_desc(int argc, VALUE *argv, VALUE s)
1645
1646
  * call-seq:
1646
1647
  * snapshot.delete(flags=0) -> nil
1647
1648
  *
1648
- * Call virDomainSnapshotDelete[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotDelete]
1649
+ * Call virDomainSnapshotDelete[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotDelete]
1649
1650
  * to delete this snapshot.
1650
1651
  */
1651
1652
  static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
@@ -1664,7 +1665,7 @@ static VALUE libvirt_domain_snapshot_delete(int argc, VALUE *argv, VALUE s)
1664
1665
  * call-seq:
1665
1666
  * snapshot.free -> nil
1666
1667
  *
1667
- * Call virDomainSnapshotFree[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotFree]
1668
+ * Call virDomainSnapshotFree[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotFree]
1668
1669
  * to free up the snapshot object. After this call the snapshot object is
1669
1670
  * no longer valid.
1670
1671
  */
@@ -1678,9 +1679,9 @@ static VALUE libvirt_domain_snapshot_free(VALUE s)
1678
1679
  #if HAVE_VIRDOMAINSNAPSHOTGETNAME
1679
1680
  /*
1680
1681
  * call-seq:
1681
- * snapshot.name -> string
1682
+ * snapshot.name -> String
1682
1683
  *
1683
- * Call virDomainSnapshotGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotGetName]
1684
+ * Call virDomainSnapshotGetName[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetName]
1684
1685
  * to get the name associated with a snapshot.
1685
1686
  */
1686
1687
  static VALUE libvirt_domain_snapshot_name(VALUE s)
@@ -1697,7 +1698,7 @@ static VALUE libvirt_domain_snapshot_name(VALUE s)
1697
1698
  * call-seq:
1698
1699
  * dom.job_info -> Libvirt::Domain::JobInfo
1699
1700
  *
1700
- * Call virDomainGetJobInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetJobInfo]
1701
+ * Call virDomainGetJobInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo]
1701
1702
  * to retrieve the current state of the running domain job.
1702
1703
  */
1703
1704
  static VALUE libvirt_domain_job_info(VALUE d)
@@ -1731,7 +1732,7 @@ static VALUE libvirt_domain_job_info(VALUE d)
1731
1732
  * call-seq:
1732
1733
  * dom.abort_job -> nil
1733
1734
  *
1734
- * Call virDomainAbortJob[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainAbortJob]
1735
+ * Call virDomainAbortJob[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainAbortJob]
1735
1736
  * to abort the currently running job on this domain.
1736
1737
  */
1737
1738
  static VALUE libvirt_domain_abort_job(VALUE d)
@@ -1766,7 +1767,7 @@ static VALUE create_sched_type_array(VALUE input)
1766
1767
  * call-seq:
1767
1768
  * dom.scheduler_type -> [type, #params]
1768
1769
  *
1769
- * Call virDomainGetSchedulerType[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetSchedulerType]
1770
+ * Call virDomainGetSchedulerType[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerType]
1770
1771
  * to retrieve the scheduler type used on this domain.
1771
1772
  */
1772
1773
  static VALUE libvirt_domain_scheduler_type(VALUE d)
@@ -1796,7 +1797,7 @@ static VALUE libvirt_domain_scheduler_type(VALUE d)
1796
1797
  #if HAVE_VIRDOMAINQEMUMONITORCOMMAND
1797
1798
  /*
1798
1799
  * call-seq:
1799
- * dom.qemu_monitor_command(cmd, flags=0) -> string
1800
+ * dom.qemu_monitor_command(cmd, flags=0) -> String
1800
1801
  *
1801
1802
  * Call virDomainQemuMonitorCommand
1802
1803
  * to send a qemu command directly to the monitor. Note that this will only
@@ -1816,7 +1817,11 @@ static VALUE libvirt_domain_qemu_monitor_command(int argc, VALUE *argv, VALUE d)
1816
1817
  type = virConnectGetType(ruby_libvirt_connect_get(d));
1817
1818
  ruby_libvirt_raise_error_if(type == NULL, e_Error, "virConnectGetType",
1818
1819
  ruby_libvirt_connect_get(d));
1819
- if (strcmp(type, "QEMU") != 0) {
1820
+ /* The type != NULL check is actually redundant, since if type was NULL
1821
+ * we would have raised an exception above. It's here to shut clang,
1822
+ * since clang can't tell that we would never reach this.
1823
+ */
1824
+ if (type != NULL && strcmp(type, "QEMU") != 0) {
1820
1825
  rb_raise(rb_eTypeError,
1821
1826
  "Tried to use virDomainQemuMonitor command on %s connection",
1822
1827
  type);
@@ -1844,7 +1849,7 @@ static VALUE libvirt_domain_qemu_monitor_command(int argc, VALUE *argv, VALUE d)
1844
1849
  * call-seq:
1845
1850
  * dom.updated? -> [True|False]
1846
1851
  *
1847
- * Call virDomainIsUpdated[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainIsUpdated]
1852
+ * Call virDomainIsUpdated[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsUpdated]
1848
1853
  * to determine whether the definition for this domain has been updated.
1849
1854
  */
1850
1855
  static VALUE libvirt_domain_is_updated(VALUE d)
@@ -1924,7 +1929,7 @@ static const char *scheduler_set(VALUE d, unsigned int flags,
1924
1929
  * call-seq:
1925
1930
  * dom.scheduler_parameters(flags=0) -> Hash
1926
1931
  *
1927
- * Call virDomainGetSchedulerParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetSchedulerParameters]
1932
+ * Call virDomainGetSchedulerParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSchedulerParameters]
1928
1933
  * to retrieve all of the scheduler parameters for this domain. The keys and
1929
1934
  * values in the hash that is returned are hypervisor specific.
1930
1935
  */
@@ -1944,12 +1949,8 @@ static struct ruby_libvirt_typed_param domain_scheduler_allowed[] = {
1944
1949
  {VIR_DOMAIN_SCHEDULER_CPU_SHARES, VIR_TYPED_PARAM_ULLONG},
1945
1950
  {VIR_DOMAIN_SCHEDULER_VCPU_PERIOD, VIR_TYPED_PARAM_ULLONG},
1946
1951
  {VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, VIR_TYPED_PARAM_LLONG},
1947
- #if HAVE_CONST_VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD
1948
1952
  {VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD, VIR_TYPED_PARAM_ULLONG},
1949
- #endif
1950
- #if HAVE_CONST_VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA
1951
1953
  {VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA, VIR_TYPED_PARAM_LLONG},
1952
- #endif
1953
1954
  {VIR_DOMAIN_SCHEDULER_WEIGHT, VIR_TYPED_PARAM_UINT},
1954
1955
  {VIR_DOMAIN_SCHEDULER_CAP, VIR_TYPED_PARAM_UINT},
1955
1956
  {VIR_DOMAIN_SCHEDULER_RESERVATION, VIR_TYPED_PARAM_LLONG},
@@ -1961,7 +1962,7 @@ static struct ruby_libvirt_typed_param domain_scheduler_allowed[] = {
1961
1962
  * call-seq:
1962
1963
  * dom.scheduler_parameters = Hash
1963
1964
  *
1964
- * Call virDomainSetSchedulerParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetSchedulerParameters]
1965
+ * Call virDomainSetSchedulerParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetSchedulerParameters]
1965
1966
  * to set the scheduler parameters for this domain. The keys and values in
1966
1967
  * the input hash are hypervisor specific. If an empty hash is given, no
1967
1968
  * changes are made (and no error is raised).
@@ -2032,7 +2033,7 @@ static const char *memory_set(VALUE d, unsigned int flags,
2032
2033
  * call-seq:
2033
2034
  * dom.memory_parameters(flags=0) -> Hash
2034
2035
  *
2035
- * Call virDomainGetMemoryParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetMemoryParameters]
2036
+ * Call virDomainGetMemoryParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMemoryParameters]
2036
2037
  * to retrieve all of the memory parameters for this domain. The keys and
2037
2038
  * values in the hash that is returned are hypervisor specific.
2038
2039
  */
@@ -2058,7 +2059,7 @@ static struct ruby_libvirt_typed_param domain_memory_allowed[] = {
2058
2059
  * call-seq:
2059
2060
  * dom.memory_parameters = Hash,flags=0
2060
2061
  *
2061
- * Call virDomainSetMemoryParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetMemoryParameters]
2062
+ * Call virDomainSetMemoryParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryParameters]
2062
2063
  * to set the memory parameters for this domain. The keys and values in
2063
2064
  * the input hash are hypervisor specific.
2064
2065
  */
@@ -2129,7 +2130,7 @@ static const char *blkio_set(VALUE d, unsigned int flags,
2129
2130
  * call-seq:
2130
2131
  * dom.blkio_parameters(flags=0) -> Hash
2131
2132
  *
2132
- * Call virDomainGetBlkioParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetBlkioParameters]
2133
+ * Call virDomainGetBlkioParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlkioParameters]
2133
2134
  * to retrieve all of the blkio parameters for this domain. The keys and
2134
2135
  * values in the hash that is returned are hypervisor specific.
2135
2136
  */
@@ -2153,7 +2154,7 @@ static struct ruby_libvirt_typed_param blkio_allowed[] = {
2153
2154
  * call-seq:
2154
2155
  * dom.blkio_parameters = Hash,flags=0
2155
2156
  *
2156
- * Call virDomainSetBlkioParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetBlkioParameters]
2157
+ * Call virDomainSetBlkioParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlkioParameters]
2157
2158
  * to set the blkio parameters for this domain. The keys and values in
2158
2159
  * the input hash are hypervisor specific.
2159
2160
  */
@@ -2175,7 +2176,7 @@ static VALUE libvirt_domain_blkio_parameters_equal(VALUE d, VALUE in)
2175
2176
  * call-seq:
2176
2177
  * dom.state(flags=0) -> state, reason
2177
2178
  *
2178
- * Call virDomainGetState[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetState]
2179
+ * Call virDomainGetState[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetState]
2179
2180
  * to get the current state of the domain.
2180
2181
  */
2181
2182
  static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
@@ -2204,7 +2205,7 @@ static VALUE libvirt_domain_state(int argc, VALUE *argv, VALUE d)
2204
2205
  * call-seq:
2205
2206
  * dom.open_console(device, stream, flags=0) -> nil
2206
2207
  *
2207
- * Call virDomainOpenConsole[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainOpenConsole]
2208
+ * Call virDomainOpenConsole[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenConsole]
2208
2209
  * to open up a console to device over stream.
2209
2210
  */
2210
2211
  static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
@@ -2227,7 +2228,7 @@ static VALUE libvirt_domain_open_console(int argc, VALUE *argv, VALUE d)
2227
2228
  * call-seq:
2228
2229
  * dom.screenshot(stream, screen, flags=0) -> nil
2229
2230
  *
2230
- * Call virDomainScreenshot[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainScreenshot]
2231
+ * Call virDomainScreenshot[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainScreenshot]
2231
2232
  * to take a screenshot of the domain console as a stream.
2232
2233
  */
2233
2234
  static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
@@ -2250,7 +2251,7 @@ static VALUE libvirt_domain_screenshot(int argc, VALUE *argv, VALUE d)
2250
2251
  * call-seq:
2251
2252
  * dom.inject_nmi(flags=0) -> nil
2252
2253
  *
2253
- * Call virDomainInjectNMI[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainInjectNMI]
2254
+ * Call virDomainInjectNMI[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI]
2254
2255
  * to send an NMI to the guest.
2255
2256
  */
2256
2257
  static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
@@ -2271,7 +2272,7 @@ static VALUE libvirt_domain_inject_nmi(int argc, VALUE *argv, VALUE d)
2271
2272
  * call-seq:
2272
2273
  * dom.control_info(flags=0) -> Libvirt::Domain::ControlInfo
2273
2274
  *
2274
- * Call virDomainGetControlInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetControlInfo]
2275
+ * Call virDomainGetControlInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetControlInfo]
2275
2276
  * to retrieve domain control interface information.
2276
2277
  */
2277
2278
  static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
@@ -2302,7 +2303,7 @@ static VALUE libvirt_domain_control_info(int argc, VALUE *argv, VALUE d)
2302
2303
  * call-seq:
2303
2304
  * dom.send_key(codeset, holdtime, keycodes)
2304
2305
  *
2305
- * Call virDomainSendKey[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSendKey]
2306
+ * Call virDomainSendKey[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey]
2306
2307
  * to send key(s) to the domain. Keycodes has to be an array of keys to send.
2307
2308
  */
2308
2309
  VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
@@ -2330,9 +2331,9 @@ VALUE libvirt_domain_send_key(VALUE d, VALUE codeset, VALUE holdtime,
2330
2331
  #if HAVE_VIRDOMAINMIGRATEGETMAXSPEED
2331
2332
  /*
2332
2333
  * call-seq:
2333
- * dom.migrate_max_speed(flags=0) -> fixnum
2334
+ * dom.migrate_max_speed(flags=0) -> Fixnum
2334
2335
  *
2335
- * Call virDomainMigrateGetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateGetMaxSpeed]
2336
+ * Call virDomainMigrateGetMaxSpeed[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetMaxSpeed]
2336
2337
  * to retrieve the maximum speed a migration can use.
2337
2338
  */
2338
2339
  static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
@@ -2358,7 +2359,7 @@ static VALUE libvirt_domain_migrate_max_speed(int argc, VALUE *argv, VALUE d)
2358
2359
  * call-seq:
2359
2360
  * dom.reset(flags=0) -> nil
2360
2361
  *
2361
- * Call virDomainReset[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainReset]
2362
+ * Call virDomainReset[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainReset]
2362
2363
  * to reset a domain immediately.
2363
2364
  */
2364
2365
  static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
@@ -2378,7 +2379,7 @@ static VALUE libvirt_domain_reset(int argc, VALUE *argv, VALUE d)
2378
2379
  * call-seq:
2379
2380
  * dom.hostname(flags=0) -> nil
2380
2381
  *
2381
- * Call virDomainGetHostname[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetHostname]
2382
+ * Call virDomainGetHostname[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetHostname]
2382
2383
  * to get the hostname from a domain.
2383
2384
  */
2384
2385
  static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
@@ -2397,9 +2398,9 @@ static VALUE libvirt_domain_hostname(int argc, VALUE *argv, VALUE d)
2397
2398
  #if HAVE_VIRDOMAINGETMETADATA
2398
2399
  /*
2399
2400
  * call-seq:
2400
- * dom.metadata(type, uri=nil, flags=0) -> string
2401
+ * dom.metadata(type, uri=nil, flags=0) -> String
2401
2402
  *
2402
- * Call virDomainGetMetadata[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetMetadata]
2403
+ * Call virDomainGetMetadata[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata]
2403
2404
  * to get the metadata from a domain.
2404
2405
  */
2405
2406
  static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
@@ -2421,7 +2422,7 @@ static VALUE libvirt_domain_metadata(int argc, VALUE *argv, VALUE d)
2421
2422
  * call-seq:
2422
2423
  * dom.metadata = Fixnum,string/nil,key=nil,uri=nil,flags=0 -> nil
2423
2424
  *
2424
- * Call virDomainSetMetadata[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetMetadata]
2425
+ * Call virDomainSetMetadata[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata]
2425
2426
  * to set the metadata for a domain.
2426
2427
  */
2427
2428
  static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
@@ -2467,7 +2468,7 @@ static VALUE libvirt_domain_metadata_equal(VALUE d, VALUE in)
2467
2468
  * call-seq:
2468
2469
  * dom.send_process_signal(pid, signum, flags=0) -> nil
2469
2470
  *
2470
- * Call virDomainSendProcessSignal[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSendProcessSignal]
2471
+ * Call virDomainSendProcessSignal[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal]
2471
2472
  * to send a signal to a process inside the domain.
2472
2473
  */
2473
2474
  static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
@@ -2487,9 +2488,9 @@ static VALUE libvirt_domain_send_process_signal(int argc, VALUE *argv, VALUE d)
2487
2488
  #if HAVE_VIRDOMAINLISTALLSNAPSHOTS
2488
2489
  /*
2489
2490
  * call-seq:
2490
- * dom.list_all_snapshots(flags=0) -> array
2491
+ * dom.list_all_snapshots(flags=0) -> Array
2491
2492
  *
2492
- * Call virDomainListAllSnapshots[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainListAllSnapshots]
2493
+ * Call virDomainListAllSnapshots[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainListAllSnapshots]
2493
2494
  * to get an array of snapshot objects for all snapshots.
2494
2495
  */
2495
2496
  static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
@@ -2505,9 +2506,9 @@ static VALUE libvirt_domain_list_all_snapshots(int argc, VALUE *argv, VALUE d)
2505
2506
  #if HAVE_VIRDOMAINSNAPSHOTNUMCHILDREN
2506
2507
  /*
2507
2508
  * call-seq:
2508
- * snapshot.num_children(flags=0) -> fixnum
2509
+ * snapshot.num_children(flags=0) -> Fixnum
2509
2510
  *
2510
- * Call virDomainSnapshotNumChildren[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotNumChildren]
2511
+ * Call virDomainSnapshotNumChildren[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotNumChildren]
2511
2512
  * to get the number of children snapshots of this snapshot.
2512
2513
  */
2513
2514
  static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
@@ -2527,18 +2528,18 @@ static VALUE libvirt_domain_snapshot_num_children(int argc, VALUE *argv,
2527
2528
  #if HAVE_VIRDOMAINSNAPSHOTLISTCHILDRENNAMES
2528
2529
  /*
2529
2530
  * call-seq:
2530
- * snapshot.list_children_names(flags=0) -> array
2531
+ * snapshot.list_children_names(flags=0) -> Array
2531
2532
  *
2532
- * Call virDomainSnapshotListChildrenNames[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotListChildrenNames]
2533
+ * Call virDomainSnapshotListChildrenNames[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListChildrenNames]
2533
2534
  * to get an array of strings representing the children of this snapshot.
2534
2535
  */
2535
2536
  static VALUE libvirt_domain_snapshot_list_children_names(int argc, VALUE *argv,
2536
2537
  VALUE s)
2537
2538
  {
2538
- VALUE flags, result, str;
2539
+ VALUE flags, result;
2539
2540
  char **children;
2540
2541
  int num_children, ret, i, j, exception = 0;
2541
- struct ruby_libvirt_ary_store_arg arg;
2542
+ struct ruby_libvirt_str_new2_and_ary_store_arg arg;
2542
2543
 
2543
2544
  rb_scan_args(argc, argv, "01", &flags);
2544
2545
 
@@ -2564,16 +2565,11 @@ static VALUE libvirt_domain_snapshot_list_children_names(int argc, VALUE *argv,
2564
2565
  ruby_libvirt_connect_get(s));
2565
2566
 
2566
2567
  for (i = 0; i < ret; i++) {
2567
- str = rb_protect(ruby_libvirt_str_new2_wrap, (VALUE)&(children[i]),
2568
- &exception);
2569
- if (exception) {
2570
- goto error;
2571
- }
2572
-
2573
2568
  arg.arr = result;
2574
2569
  arg.index = i;
2575
- arg.elem = str;
2576
- rb_protect(ruby_libvirt_ary_store_wrap, (VALUE)&arg, &exception);
2570
+ arg.value = children[i];
2571
+ rb_protect(ruby_libvirt_str_new2_and_ary_store_wrap, (VALUE)&arg,
2572
+ &exception);
2577
2573
  if (exception) {
2578
2574
  goto error;
2579
2575
  }
@@ -2596,9 +2592,9 @@ error:
2596
2592
  #if HAVE_VIRDOMAINSNAPSHOTLISTALLCHILDREN
2597
2593
  /*
2598
2594
  * call-seq:
2599
- * snapshot.list_all_children(flags=0) -> array
2595
+ * snapshot.list_all_children(flags=0) -> Array
2600
2596
  *
2601
- * Call virDomainSnapshotListAllChildren[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotListAllChildren]
2597
+ * Call virDomainSnapshotListAllChildren[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotListAllChildren]
2602
2598
  * to get an array of snapshot objects that are children of this snapshot.
2603
2599
  */
2604
2600
  static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
@@ -2617,7 +2613,7 @@ static VALUE libvirt_domain_snapshot_list_all_children(int argc, VALUE *argv,
2617
2613
  * call-seq:
2618
2614
  * snapshot.parent(flags=0) -> [Libvirt::Domain::Snapshot|nil]
2619
2615
  *
2620
- * Call virDomainSnapshotGetParent[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotGetParent]
2616
+ * Call virDomainSnapshotGetParent[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotGetParent]
2621
2617
  * to get the parent of this snapshot (nil will be returned if this is a root
2622
2618
  * snapshot).
2623
2619
  */
@@ -2654,7 +2650,7 @@ static VALUE libvirt_domain_snapshot_parent(int argc, VALUE *argv, VALUE s)
2654
2650
  * call-seq:
2655
2651
  * snapshot.current?(flags=0) -> [true|false]
2656
2652
  *
2657
- * Call virDomainSnapshotIsCurrent[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotIsCurrent]
2653
+ * Call virDomainSnapshotIsCurrent[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotIsCurrent]
2658
2654
  * to determine if the snapshot is the domain's current snapshot.
2659
2655
  */
2660
2656
  static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
@@ -2675,7 +2671,7 @@ static VALUE libvirt_domain_snapshot_current_p(int argc, VALUE *argv, VALUE s)
2675
2671
  * call-seq:
2676
2672
  * snapshot.has_metadata?(flags=0) -> [true|false]
2677
2673
  *
2678
- * Call virDomainSnapshotHasMetadata[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotHasMetadata]
2674
+ * Call virDomainSnapshotHasMetadata[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSnapshotHasMetadata]
2679
2675
  * to determine if the snapshot is associated with libvirt metadata.
2680
2676
  */
2681
2677
  static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
@@ -2697,7 +2693,7 @@ static VALUE libvirt_domain_snapshot_has_metadata_p(int argc, VALUE *argv,
2697
2693
  * call-seq:
2698
2694
  * dom.memory_stats_period = Fixnum,flags=0
2699
2695
  *
2700
- * Call virDomainSetMemoryStatsPeriod[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetMemoryStatsPeriod]
2696
+ * Call virDomainSetMemoryStatsPeriod[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryStatsPeriod]
2701
2697
  * to set the memory statistics collection period.
2702
2698
  */
2703
2699
  static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
@@ -2719,7 +2715,7 @@ static VALUE libvirt_domain_memory_stats_period(VALUE d, VALUE in)
2719
2715
  * call-seq:
2720
2716
  * dom.fstrim(mountpoint=nil, minimum=0, flags=0) -> nil
2721
2717
  *
2722
- * Call virDomainFSTrim[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainFSTrim]
2718
+ * Call virDomainFSTrim[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSTrim]
2723
2719
  * to call FITRIM within the guest.
2724
2720
  */
2725
2721
  static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
@@ -2741,7 +2737,7 @@ static VALUE libvirt_domain_fstrim(int argc, VALUE *argv, VALUE d)
2741
2737
  * call-seq:
2742
2738
  * dom.block_rebase(disk, base=nil, bandwidth=0, flags=0) -> nil
2743
2739
  *
2744
- * Call virDomainBlockRebase[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockRebase]
2740
+ * Call virDomainBlockRebase[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase]
2745
2741
  * to populate a disk image with data from its backing image chain.
2746
2742
  */
2747
2743
  static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
@@ -2765,7 +2761,7 @@ static VALUE libvirt_domain_block_rebase(int argc, VALUE *argv, VALUE d)
2765
2761
  * call-seq:
2766
2762
  * dom.open_channel(name, stream, flags=0) -> nil
2767
2763
  *
2768
- * Call virDomainOpenChannel[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainOpenChannel]
2764
+ * Call virDomainOpenChannel[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenChannel]
2769
2765
  * to open a channel on a guest. Note that name may be nil, in which case the
2770
2766
  * first channel on the guest is opened.
2771
2767
  */
@@ -2789,7 +2785,7 @@ static VALUE libvirt_domain_open_channel(int argc, VALUE *argv, VALUE d)
2789
2785
  * call-seq:
2790
2786
  * dom.create_with_files(fds=nil, flags=0) -> nil
2791
2787
  *
2792
- * Call virDomainCreateWithFiles[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainCreateWithFiles]
2788
+ * Call virDomainCreateWithFiles[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFiles]
2793
2789
  * to launch a defined domain with a set of open file descriptors.
2794
2790
  */
2795
2791
  static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
@@ -2828,7 +2824,7 @@ static VALUE libvirt_domain_create_with_files(int argc, VALUE *argv, VALUE d)
2828
2824
  * call-seq:
2829
2825
  * dom.open_graphics(fd, idx=0, flags=0) -> nil
2830
2826
  *
2831
- * Call virDomainOpenGraphics[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainOpenGraphics]
2827
+ * Call virDomainOpenGraphics[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainOpenGraphics]
2832
2828
  * to connect a file descriptor to the graphics backend of the domain.
2833
2829
  */
2834
2830
  static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
@@ -2850,7 +2846,7 @@ static VALUE libvirt_domain_open_graphics(int argc, VALUE *argv, VALUE d)
2850
2846
  * call-seq:
2851
2847
  * dom.pmwakeup(flags=0) -> nil
2852
2848
  *
2853
- * Call virDomainPMWakeup[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPMWakeup]
2849
+ * Call virDomainPMWakeup[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup]
2854
2850
  * to inject a wakeup into the guest.
2855
2851
  */
2856
2852
  static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
@@ -2871,7 +2867,7 @@ static VALUE libvirt_domain_pmwakeup(int argc, VALUE *argv, VALUE d)
2871
2867
  * call-seq:
2872
2868
  * dom.block_resize(disk, size, flags=0) -> nil
2873
2869
  *
2874
- * Call virDomainBlockResize[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockResize]
2870
+ * Call virDomainBlockResize[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockResize]
2875
2871
  * to resize a block device of domain.
2876
2872
  */
2877
2873
  static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
@@ -2883,7 +2879,7 @@ static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
2883
2879
  ruby_libvirt_generate_call_nil(virDomainBlockResize,
2884
2880
  ruby_libvirt_connect_get(d),
2885
2881
  ruby_libvirt_domain_get(d),
2886
- StringValueCStr(size), NUM2ULL(size),
2882
+ StringValueCStr(disk), NUM2ULL(size),
2887
2883
  ruby_libvirt_value_to_uint(flags));
2888
2884
  }
2889
2885
  #endif
@@ -2893,7 +2889,7 @@ static VALUE libvirt_domain_block_resize(int argc, VALUE *argv, VALUE d)
2893
2889
  * call-seq:
2894
2890
  * dom.pmsuspend_for_duration(target, duration, flags=0) -> nil
2895
2891
  *
2896
- * Call virDomainPMSuspendForDuration[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPMSuspendForDuration]
2892
+ * Call virDomainPMSuspendForDuration[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMSuspendForDuration]
2897
2893
  * to have the domain enter the target power management suspend level.
2898
2894
  */
2899
2895
  static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
@@ -2916,7 +2912,7 @@ static VALUE libvirt_domain_pmsuspend_for_duration(int argc, VALUE *argv,
2916
2912
  * call-seq:
2917
2913
  * dom.migrate_compression_cache(flags=0) -> Fixnum
2918
2914
  *
2919
- * Call virDomainMigrateGetCompressionCache[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateGetCompressionCache]
2915
+ * Call virDomainMigrateGetCompressionCache[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetCompressionCache]
2920
2916
  * to get the current size of the migration cache.
2921
2917
  */
2922
2918
  static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
@@ -2944,7 +2940,7 @@ static VALUE libvirt_domain_migrate_compression_cache(int argc, VALUE *argv,
2944
2940
  * call-seq:
2945
2941
  * dom.migrate_compression_cache = Fixnum,flags=0
2946
2942
  *
2947
- * Call virDomainMigrateSetCompressionCache[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetCompressionCache]
2943
+ * Call virDomainMigrateSetCompressionCache[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetCompressionCache]
2948
2944
  * to set the current size of the migration cache.
2949
2945
  */
2950
2946
  static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
@@ -2966,7 +2962,7 @@ static VALUE libvirt_domain_migrate_compression_cache_equal(VALUE d, VALUE in)
2966
2962
  * call-seq:
2967
2963
  * dom.disk_errors(flags=0) -> Hash
2968
2964
  *
2969
- * Call virDomainGetDiskErrors[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetDiskErrors]
2965
+ * Call virDomainGetDiskErrors[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors]
2970
2966
  * to get errors on disks in the domain.
2971
2967
  */
2972
2968
  static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
@@ -3007,7 +3003,7 @@ static VALUE libvirt_domain_disk_errors(int argc, VALUE *argv, VALUE d)
3007
3003
  * call-seq:
3008
3004
  * dom.emulator_pin_info(flags=0) -> Array
3009
3005
  *
3010
- * Call virDomainGetEmulatorPinInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetEmulatorPinInfo]
3006
+ * Call virDomainGetEmulatorPinInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo]
3011
3007
  * to an array representing the mapping of emulator threads to physical CPUs.
3012
3008
  * For each physical CPU in the machine, the array offset corresponding to that
3013
3009
  * CPU is 'true' if an emulator thread is running on that CPU, and 'false'
@@ -3026,7 +3022,7 @@ static VALUE libvirt_domain_emulator_pin_info(int argc, VALUE *argv, VALUE d)
3026
3022
 
3027
3023
  cpumaplen = VIR_CPU_MAPLEN(maxcpus);
3028
3024
 
3029
- cpumap = alloca(cpumaplen);
3025
+ cpumap = alloca(sizeof(unsigned char) * cpumaplen);
3030
3026
 
3031
3027
  ret = virDomainGetEmulatorPinInfo(ruby_libvirt_domain_get(d), cpumap,
3032
3028
  cpumaplen,
@@ -3051,7 +3047,7 @@ static VALUE libvirt_domain_emulator_pin_info(int argc, VALUE *argv, VALUE d)
3051
3047
  * call-seq:
3052
3048
  * dom.pin_emulator(cpulist, flags=0) -> nil
3053
3049
  *
3054
- * Call virDomainPinVcpu[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPinVcpu]
3050
+ * Call virDomainPinVcpu[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinVcpu]
3055
3051
  * to pin the emulator to a range of physical processors. The cpulist should
3056
3052
  * be an array of Fixnums representing the physical processors this domain's
3057
3053
  * emulator should be allowed to be scheduled on.
@@ -3070,7 +3066,7 @@ static VALUE libvirt_domain_pin_emulator(int argc, VALUE *argv, VALUE d)
3070
3066
 
3071
3067
  cpumaplen = VIR_CPU_MAPLEN(maxcpus);
3072
3068
 
3073
- cpumap = alloca(cpumaplen);
3069
+ cpumap = alloca(sizeof(unsigned char) * cpumaplen);
3074
3070
  MEMZERO(cpumap, unsigned char, cpumaplen);
3075
3071
 
3076
3072
  for (i = 0; i < RARRAY_LEN(cpulist); i++) {
@@ -3091,7 +3087,7 @@ static VALUE libvirt_domain_pin_emulator(int argc, VALUE *argv, VALUE d)
3091
3087
  * call-seq:
3092
3088
  * dom.security_label_list -> [ Libvirt::Domain::SecurityLabel ]
3093
3089
  *
3094
- * Call virDomainGetSecurityLabelList[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetSecurityLabelList]
3090
+ * Call virDomainGetSecurityLabelList[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetSecurityLabelList]
3095
3091
  * to retrieve the security labels applied to this domain.
3096
3092
  */
3097
3093
  static VALUE libvirt_domain_security_label_list(VALUE d)
@@ -3142,7 +3138,7 @@ static VALUE params_to_hash(VALUE in)
3142
3138
  * call-seq:
3143
3139
  * dom.job_stats -> Hash
3144
3140
  *
3145
- * Call virDomainGetJobStats[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetJobStats]
3141
+ * Call virDomainGetJobStats[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats]
3146
3142
  * to retrieve information about progress of a background job on a domain.
3147
3143
  */
3148
3144
  static VALUE libvirt_domain_job_stats(int argc, VALUE *argv, VALUE d)
@@ -3238,7 +3234,7 @@ static const char *iotune_set(VALUE d, unsigned int flags,
3238
3234
  * call-seq:
3239
3235
  * dom.block_iotune(disk=nil, flags=0) -> Hash
3240
3236
  *
3241
- * Call virDomainGetBlockIoTune[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetBlockIoTune]
3237
+ * Call virDomainGetBlockIoTune[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockIoTune]
3242
3238
  * to retrieve all of the block IO tune parameters for this domain. The keys
3243
3239
  * and values in the hash that is returned are hypervisor specific.
3244
3240
  */
@@ -3263,13 +3259,14 @@ static struct ruby_libvirt_typed_param iotune_allowed[] = {
3263
3259
  {VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
3264
3260
  {VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
3265
3261
  {VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
3262
+ {VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC, VIR_TYPED_PARAM_ULLONG},
3266
3263
  };
3267
3264
 
3268
3265
  /*
3269
3266
  * call-seq:
3270
3267
  * dom.block_iotune = disk,Hash,flags=0
3271
3268
  *
3272
- * Call virDomainSetBlockIoTune[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetBlockIoTune]
3269
+ * Call virDomainSetBlockIoTune[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune]
3273
3270
  * to set the block IO tune parameters for the supplied disk on this domain.
3274
3271
  * The keys and values in the input hash are hypervisor specific.
3275
3272
  */
@@ -3306,7 +3303,7 @@ static VALUE libvirt_domain_block_iotune_equal(VALUE d, VALUE in)
3306
3303
  * call-seq:
3307
3304
  * dom.block_commit(disk, base=nil, top=nil, bandwidth=0, flags=0) -> nil
3308
3305
  *
3309
- * Call virDomainBlockCommit[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockCommit]
3306
+ * Call virDomainBlockCommit[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCommit]
3310
3307
  * to commit changes from a top-level backing file into a lower level base file.
3311
3308
  */
3312
3309
  static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
@@ -3331,12 +3328,12 @@ static VALUE libvirt_domain_block_commit(int argc, VALUE *argv, VALUE d)
3331
3328
  * call-seq:
3332
3329
  * dom.block_pull(disk, bandwidth=0, flags=0) -> nil
3333
3330
  *
3334
- * Call virDomainBlockPull[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockPull]
3331
+ * Call virDomainBlockPull[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull]
3335
3332
  * to pull changes from a backing file into a disk image.
3336
3333
  */
3337
3334
  static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
3338
3335
  {
3339
- VALUE disk, bandwidth, flags;
3336
+ VALUE disk, bandwidth = RUBY_Qnil, flags = RUBY_Qnil;
3340
3337
 
3341
3338
  rb_scan_args(argc, argv, "12", &disk, &bandwidth, &flags);
3342
3339
 
@@ -3354,7 +3351,7 @@ static VALUE libvirt_domain_block_pull(int argc, VALUE *argv, VALUE d)
3354
3351
  * call-seq:
3355
3352
  * dom.block_job_speed = disk,bandwidth=0,flags=0
3356
3353
  *
3357
- * Call virDomainBlockJobSetSpeed[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockJobSetSpeed]
3354
+ * Call virDomainBlockJobSetSpeed[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobSetSpeed]
3358
3355
  * to set the maximum allowable bandwidth a block job may consume.
3359
3356
  */
3360
3357
  static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
@@ -3400,12 +3397,12 @@ static VALUE libvirt_domain_block_job_speed_equal(VALUE d, VALUE in)
3400
3397
  * call-seq:
3401
3398
  * dom.block_job_info(disk, flags=0) -> Libvirt::Domain::BlockJobInfo
3402
3399
  *
3403
- * Call virDomainGetBlockJobInfo[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetBlockJobInfo]
3400
+ * Call virDomainGetBlockJobInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo]
3404
3401
  * to get block job information for a given disk.
3405
3402
  */
3406
3403
  static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
3407
3404
  {
3408
- VALUE disk, flags, result;
3405
+ VALUE disk, flags = RUBY_Qnil, result;
3409
3406
  virDomainBlockJobInfo info;
3410
3407
  int r;
3411
3408
 
@@ -3435,12 +3432,12 @@ static VALUE libvirt_domain_block_job_info(int argc, VALUE *argv, VALUE d)
3435
3432
  * call-seq:
3436
3433
  * dom.block_job_abort(disk, flags=0) -> nil
3437
3434
  *
3438
- * Call virDomainBlockJobAbort[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainBlockJobAbort]
3435
+ * Call virDomainBlockJobAbort[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockJobAbort]
3439
3436
  * to cancel an active block job on the given disk.
3440
3437
  */
3441
3438
  static VALUE libvirt_domain_block_job_abort(int argc, VALUE *argv, VALUE d)
3442
3439
  {
3443
- VALUE disk, flags;
3440
+ VALUE disk, flags = RUBY_Qnil;
3444
3441
 
3445
3442
  rb_scan_args(argc, argv, "11", &disk, &flags);
3446
3443
 
@@ -3500,13 +3497,13 @@ static const char *interface_set(VALUE d, unsigned int flags,
3500
3497
  * call-seq:
3501
3498
  * dom.interface_parameters(interface, flags=0) -> Hash
3502
3499
  *
3503
- * Call virDomainGetInterfaceParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetInterfaceParameters]
3500
+ * Call virDomainGetInterfaceParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetInterfaceParameters]
3504
3501
  * to retrieve the interface parameters for the given interface on this domain.
3505
3502
  * The keys and values in the hash that is returned are hypervisor specific.
3506
3503
  */
3507
3504
  static VALUE libvirt_domain_interface_parameters(int argc, VALUE *argv, VALUE d)
3508
3505
  {
3509
- VALUE device, flags;
3506
+ VALUE device = RUBY_Qnil, flags = RUBY_Qnil;
3510
3507
 
3511
3508
  rb_scan_args(argc, argv, "11", &device, &flags);
3512
3509
 
@@ -3531,7 +3528,7 @@ static struct ruby_libvirt_typed_param interface_allowed[] = {
3531
3528
  * call-seq:
3532
3529
  * dom.interface_parameters = device,Hash,flags=0
3533
3530
  *
3534
- * Call virDomainSetInterfaceParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetInterfaceParameters]
3531
+ * Call virDomainSetInterfaceParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetInterfaceParameters]
3535
3532
  * to set the interface parameters for the supplied device on this domain.
3536
3533
  * The keys and values in the input hash are hypervisor specific.
3537
3534
  */
@@ -3597,13 +3594,13 @@ static const char *block_stats_get(VALUE d, unsigned int flags,
3597
3594
  * call-seq:
3598
3595
  * dom.block_stats_flags(disk, flags=0) -> Hash
3599
3596
  *
3600
- * Call virDomainGetBlockStatsFlags[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetBlockStatsFlags]
3597
+ * Call virDomainGetBlockStatsFlags[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockStatsFlags]
3601
3598
  * to retrieve the block statistics for the given disk on this domain.
3602
3599
  * The keys and values in the hash that is returned are hypervisor specific.
3603
3600
  */
3604
3601
  static VALUE libvirt_domain_block_stats_flags(int argc, VALUE *argv, VALUE d)
3605
3602
  {
3606
- VALUE disk, flags;
3603
+ VALUE disk = RUBY_Qnil, flags = RUBY_Qnil;
3607
3604
 
3608
3605
  rb_scan_args(argc, argv, "11", &disk, &flags);
3609
3606
 
@@ -3658,13 +3655,13 @@ static const char *numa_set(VALUE d, unsigned int flags,
3658
3655
  * call-seq:
3659
3656
  * dom.numa_parameters(flags=0) -> Hash
3660
3657
  *
3661
- * Call virDomainGetNumaParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetNumaParameters]
3658
+ * Call virDomainGetNumaParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetNumaParameters]
3662
3659
  * to retrieve the numa parameters for this domain. The keys and values in
3663
3660
  * the hash that is returned are hypervisor specific.
3664
3661
  */
3665
3662
  static VALUE libvirt_domain_numa_parameters(int argc, VALUE *argv, VALUE d)
3666
3663
  {
3667
- VALUE flags;
3664
+ VALUE flags = RUBY_Qnil;
3668
3665
 
3669
3666
  rb_scan_args(argc, argv, "01", &flags);
3670
3667
 
@@ -3682,7 +3679,7 @@ static struct ruby_libvirt_typed_param numa_allowed[] = {
3682
3679
  * call-seq:
3683
3680
  * dom.numa_parameters = Hash,flags=0
3684
3681
  *
3685
- * Call virDomainSetNumaParameters[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSetNumaParameters]
3682
+ * Call virDomainSetNumaParameters[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetNumaParameters]
3686
3683
  * to set the numa parameters for this domain. The keys and values in the input
3687
3684
  * hash are hypervisor specific.
3688
3685
  */
@@ -3705,14 +3702,14 @@ static VALUE libvirt_domain_numa_parameters_equal(VALUE d, VALUE in)
3705
3702
  * call-seq:
3706
3703
  * dom.lxc_open_namespace(flags=0) -> Array
3707
3704
  *
3708
- * Call virDomainLxcOpenNamespace[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainLxcOpenNamespace]
3705
+ * Call virDomainLxcOpenNamespace[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcOpenNamespace]
3709
3706
  * to open an LXC namespace. Note that this will only work on connections to
3710
3707
  * the LXC driver. The call will return an array of open file descriptors;
3711
3708
  * these should be closed when use of them is finished.
3712
3709
  */
3713
3710
  static VALUE libvirt_domain_lxc_open_namespace(int argc, VALUE *argv, VALUE d)
3714
3711
  {
3715
- VALUE flags, result;
3712
+ VALUE flags = RUBY_Qnil, result;
3716
3713
  int *fdlist = NULL;
3717
3714
  int ret, i, exception = 0;
3718
3715
  struct ruby_libvirt_ary_store_arg args;
@@ -3762,17 +3759,21 @@ error:
3762
3759
  * call-seq:
3763
3760
  * dom.qemu_agent_command(command, timeout=0, flags=0) -> String
3764
3761
  *
3765
- * Call virDomainQemuAgentCommand[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainQemuAgentCommand]
3762
+ * Call virDomainQemuAgentCommand[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainQemuAgentCommand]
3766
3763
  * to run an arbitrary command on the Qemu Agent.
3767
3764
  */
3768
3765
  static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
3769
3766
  {
3770
- VALUE command, timeout, flags, result;
3767
+ VALUE command, timeout = RUBY_Qnil, flags = RUBY_Qnil, result;
3771
3768
  char *ret;
3772
3769
  int exception = 0;
3773
3770
 
3774
3771
  rb_scan_args(argc, argv, "12", &command, &timeout, &flags);
3775
3772
 
3773
+ if (NIL_P(timeout)) {
3774
+ timeout = INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT);
3775
+ }
3776
+
3776
3777
  ret = virDomainQemuAgentCommand(ruby_libvirt_domain_get(d),
3777
3778
  StringValueCStr(command),
3778
3779
  ruby_libvirt_value_to_int(timeout),
@@ -3796,7 +3797,7 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
3796
3797
  * call-seq:
3797
3798
  * dom.lxc_enter_namespace(fds, flags=0) -> Array
3798
3799
  *
3799
- * Call virDomainLxcEnterNamespace[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainLxcEnterNamespace]
3800
+ * Call virDomainLxcEnterNamespace[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainLxcEnterNamespace]
3800
3801
  * to attach the process to the namespaces associated with the file descriptors
3801
3802
  * in the fds array. Note that this call does not actually enter the namespace;
3802
3803
  * the next call to fork will do that. Also note that this function will return
@@ -3805,7 +3806,7 @@ static VALUE libvirt_domain_qemu_agent_command(int argc, VALUE *argv, VALUE d)
3805
3806
  */
3806
3807
  static VALUE libvirt_domain_lxc_enter_namespace(int argc, VALUE *argv, VALUE d)
3807
3808
  {
3808
- VALUE fds, flags, result;
3809
+ VALUE fds = RUBY_Qnil, flags = RUBY_Qnil, result;
3809
3810
  int *fdlist;
3810
3811
  int ret, exception = 0;
3811
3812
  int *oldfdlist;
@@ -3864,22 +3865,20 @@ static struct ruby_libvirt_typed_param migrate3_allowed[] = {
3864
3865
  {VIR_MIGRATE_PARAM_DEST_XML, VIR_TYPED_PARAM_STRING},
3865
3866
  {VIR_MIGRATE_PARAM_BANDWIDTH, VIR_TYPED_PARAM_ULLONG},
3866
3867
  {VIR_MIGRATE_PARAM_GRAPHICS_URI, VIR_TYPED_PARAM_STRING},
3867
- #if HAVE_CONST_VIR_MIGRATE_PARAM_LISTEN_ADDRESS
3868
3868
  {VIR_MIGRATE_PARAM_LISTEN_ADDRESS, VIR_TYPED_PARAM_STRING},
3869
- #endif
3870
3869
  };
3871
3870
 
3872
3871
  /*
3873
3872
  * call-seq:
3874
3873
  * dom.migrate3(dconn, Hash=nil, flags=0) -> Libvirt::Domain
3875
3874
  *
3876
- * Call virDomainMigrate3[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrate2]
3875
+ * Call virDomainMigrate3[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3]
3877
3876
  * to migrate a domain from the host on this connection to the connection
3878
3877
  * referenced in dconn.
3879
3878
  */
3880
3879
  static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
3881
3880
  {
3882
- VALUE dconn, hash, flags;
3881
+ VALUE dconn = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
3883
3882
  virDomainPtr ddom = NULL;
3884
3883
  struct ruby_libvirt_parameter_assign_args args;
3885
3884
  unsigned long hashsize;
@@ -3917,13 +3916,13 @@ static VALUE libvirt_domain_migrate3(int argc, VALUE *argv, VALUE d)
3917
3916
  * call-seq:
3918
3917
  * dom.migrate_to_uri3(duri=nil, Hash=nil, flags=0) -> nil
3919
3918
  *
3920
- * Call virDomainMigrateToURI3[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI3]
3919
+ * Call virDomainMigrateToURI3[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateToURI3]
3921
3920
  * to migrate a domain from the host on this connection to the host whose
3922
3921
  * libvirt URI is duri.
3923
3922
  */
3924
3923
  static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
3925
3924
  {
3926
- VALUE duri, hash, flags;
3925
+ VALUE duri = RUBY_Qnil, hash = RUBY_Qnil, flags = RUBY_Qnil;
3927
3926
  struct ruby_libvirt_parameter_assign_args args;
3928
3927
  unsigned long hashsize;
3929
3928
 
@@ -3955,12 +3954,12 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
3955
3954
  }
3956
3955
  #endif
3957
3956
 
3958
- #if HAVE_VIRNODEGETCPUSTATS
3957
+ #if HAVE_VIRDOMAINGETCPUSTATS
3959
3958
  /*
3960
3959
  * call-seq:
3961
3960
  * dom.cpu_stats(start_cpu=-1, numcpus=1, flags=0) -> Hash
3962
3961
  *
3963
- * Call virDomainGetCPUStats[http://www.libvirt.org/html/libvirt-libvirt.html#virDomainGetCPUStats]
3962
+ * Call virDomainGetCPUStats[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetCPUStats]
3964
3963
  * to get statistics about CPU usage attributable to a single domain. If
3965
3964
  * start_cpu is -1, then numcpus must be 1 and statistics attributable to the
3966
3965
  * entire domain is returned. If start_cpu is any positive number, then it
@@ -3969,7 +3968,7 @@ static VALUE libvirt_domain_migrate_to_uri3(int argc, VALUE *argv, VALUE d)
3969
3968
  */
3970
3969
  static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
3971
3970
  {
3972
- VALUE start_cpu, numcpus, flags, result, tmp;
3971
+ VALUE start_cpu = RUBY_Qnil, numcpus = RUBY_Qnil, flags = RUBY_Qnil, result, tmp;
3973
3972
  int ret, nparams, j;
3974
3973
  unsigned int i;
3975
3974
  virTypedParameterPtr params;
@@ -4048,6 +4047,297 @@ static VALUE libvirt_domain_cpu_stats(int argc, VALUE *argv, VALUE d)
4048
4047
  }
4049
4048
  #endif
4050
4049
 
4050
+ #if HAVE_VIRDOMAINGETTIME
4051
+ /*
4052
+ * call-seq:
4053
+ * dom.time(flags=0) -> Hash
4054
+ * Call virDomainGetTime[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime]
4055
+ * to get information about the guest time.
4056
+ */
4057
+ static VALUE libvirt_domain_get_time(int argc, VALUE *argv, VALUE d)
4058
+ {
4059
+ VALUE flags = RUBY_Qnil, result;
4060
+ long long seconds;
4061
+ unsigned int nseconds;
4062
+ int ret;
4063
+
4064
+ rb_scan_args(argc, argv, "01", &flags);
4065
+
4066
+ ret = virDomainGetTime(ruby_libvirt_domain_get(d), &seconds, &nseconds,
4067
+ ruby_libvirt_value_to_uint(flags));
4068
+ ruby_libvirt_raise_error_if(ret < 0, e_Error, "virDomainGetTime",
4069
+ ruby_libvirt_connect_get(d));
4070
+
4071
+ result = rb_hash_new();
4072
+ rb_hash_aset(result, rb_str_new2("seconds"), LL2NUM(seconds));
4073
+ rb_hash_aset(result, rb_str_new2("nseconds"), UINT2NUM(nseconds));
4074
+
4075
+ return result;
4076
+ }
4077
+ #endif
4078
+
4079
+ #if HAVE_VIRDOMAINSETTIME
4080
+ /*
4081
+ * call-seq:
4082
+ * dom.time = Hash,flags=0
4083
+ * Call virDomainSetTime[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetTime]
4084
+ * to set guest time.
4085
+ */
4086
+ static VALUE libvirt_domain_time_equal(VALUE d, VALUE in)
4087
+ {
4088
+ VALUE hash, flags, seconds, nseconds;
4089
+
4090
+ ruby_libvirt_assign_hash_and_flags(in, &hash, &flags);
4091
+
4092
+ seconds = rb_hash_aref(hash, rb_str_new2("seconds"));
4093
+ nseconds = rb_hash_aref(hash, rb_str_new2("nseconds"));
4094
+
4095
+ ruby_libvirt_generate_call_nil(virDomainSetTime,
4096
+ ruby_libvirt_connect_get(d),
4097
+ ruby_libvirt_domain_get(d),
4098
+ NUM2LL(seconds), NUM2UINT(nseconds),
4099
+ NUM2UINT(flags));
4100
+ }
4101
+ #endif
4102
+
4103
+ #if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
4104
+ /*
4105
+ * call-seq:
4106
+ * dom.core_dump_with_format(filename, dumpformat, flags=0) -> nil
4107
+ *
4108
+ * Call virDomainCoreDumpWithFormat[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDump]
4109
+ * to do a full memory dump of the domain to filename.
4110
+ */
4111
+ static VALUE libvirt_domain_core_dump_with_format(int argc, VALUE *argv, VALUE d)
4112
+ {
4113
+ VALUE to, dumpformat = RUBY_Qnil, flags = RUBY_Qnil;
4114
+
4115
+ rb_scan_args(argc, argv, "21", &to, &dumpformat, &flags);
4116
+
4117
+ ruby_libvirt_generate_call_nil(virDomainCoreDumpWithFormat,
4118
+ ruby_libvirt_connect_get(d),
4119
+ ruby_libvirt_domain_get(d),
4120
+ StringValueCStr(to),
4121
+ NUM2UINT(dumpformat),
4122
+ ruby_libvirt_value_to_uint(flags));
4123
+ }
4124
+ #endif
4125
+
4126
+ #if HAVE_VIRDOMAINFSFREEZE
4127
+ /*
4128
+ * call-seq:
4129
+ * dom.fs_freeze(mountpoints=nil, flags=0) -> Fixnum
4130
+ *
4131
+ * Call virDomainFSFreeze[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSFreeze]
4132
+ * to freeze the specified filesystems within the guest.
4133
+ */
4134
+ static VALUE libvirt_domain_fs_freeze(int argc, VALUE *argv, VALUE d)
4135
+ {
4136
+ VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
4137
+ const char **mnt;
4138
+ unsigned int nmountpoints;
4139
+ int i;
4140
+
4141
+ rb_scan_args(argc, argv, "02", &mountpoints, &flags);
4142
+
4143
+ if (NIL_P(mountpoints)) {
4144
+ mnt = NULL;
4145
+ nmountpoints = 0;
4146
+ }
4147
+ else {
4148
+ Check_Type(mountpoints, T_ARRAY);
4149
+
4150
+ nmountpoints = RARRAY_LEN(mountpoints);
4151
+ mnt = alloca(nmountpoints * sizeof(char *));
4152
+
4153
+ for (i = 0; i < nmountpoints; i++) {
4154
+ entry = rb_ary_entry(mountpoints, i);
4155
+ mnt[i] = StringValueCStr(entry);
4156
+ }
4157
+ }
4158
+
4159
+ ruby_libvirt_generate_call_int(virDomainFSFreeze,
4160
+ ruby_libvirt_connect_get(d),
4161
+ ruby_libvirt_domain_get(d),
4162
+ mnt, nmountpoints,
4163
+ ruby_libvirt_value_to_uint(flags));
4164
+ }
4165
+ #endif
4166
+
4167
+ #if HAVE_VIRDOMAINFSTHAW
4168
+ /*
4169
+ * call-seq:
4170
+ * dom.fs_thaw(mountpoints=nil, flags=0) -> Fixnum
4171
+ *
4172
+ * Call virDomainFSThaw[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainFSThaw]
4173
+ * to thaw the specified filesystems within the guest.
4174
+ */
4175
+ static VALUE libvirt_domain_fs_thaw(int argc, VALUE *argv, VALUE d)
4176
+ {
4177
+ VALUE mountpoints = RUBY_Qnil, flags = RUBY_Qnil, entry;
4178
+ const char **mnt;
4179
+ unsigned int nmountpoints;
4180
+ int i;
4181
+
4182
+ rb_scan_args(argc, argv, "02", &mountpoints, &flags);
4183
+
4184
+ if (NIL_P(mountpoints)) {
4185
+ mnt = NULL;
4186
+ nmountpoints = 0;
4187
+ }
4188
+ else {
4189
+ Check_Type(mountpoints, T_ARRAY);
4190
+
4191
+ nmountpoints = RARRAY_LEN(mountpoints);
4192
+ mnt = alloca(nmountpoints * sizeof(char *));
4193
+
4194
+ for (i = 0; i < nmountpoints; i++) {
4195
+ entry = rb_ary_entry(mountpoints, i);
4196
+ mnt[i] = StringValueCStr(entry);
4197
+ }
4198
+ }
4199
+
4200
+ ruby_libvirt_generate_call_int(virDomainFSThaw,
4201
+ ruby_libvirt_connect_get(d),
4202
+ ruby_libvirt_domain_get(d),
4203
+ mnt, nmountpoints,
4204
+ ruby_libvirt_value_to_uint(flags));
4205
+ }
4206
+ #endif
4207
+
4208
+ #if HAVE_VIRDOMAINGETFSINFO
4209
+ struct fs_info_arg {
4210
+ virDomainFSInfoPtr *info;
4211
+ int ninfo;
4212
+ };
4213
+
4214
+ static VALUE fs_info_wrap(VALUE arg)
4215
+ {
4216
+ struct fs_info_arg *e = (struct fs_info_arg *)arg;
4217
+ VALUE aliases, entry, result;
4218
+ int i, j;
4219
+
4220
+ result = rb_ary_new2(e->ninfo);
4221
+
4222
+ for (i = 0; i < e->ninfo; i++) {
4223
+ aliases = rb_ary_new2(e->info[i]->ndevAlias);
4224
+ for (j = 0; j < e->info[i]->ndevAlias; j++) {
4225
+ rb_ary_store(aliases, j, rb_str_new2(e->info[i]->devAlias[j]));
4226
+ }
4227
+
4228
+ entry = rb_hash_new();
4229
+ rb_hash_aset(entry, rb_str_new2("mountpoint"),
4230
+ rb_str_new2(e->info[i]->mountpoint));
4231
+ rb_hash_aset(entry, rb_str_new2("name"),
4232
+ rb_str_new2(e->info[i]->name));
4233
+ rb_hash_aset(entry, rb_str_new2("fstype"),
4234
+ rb_str_new2(e->info[i]->fstype));
4235
+ rb_hash_aset(entry, rb_str_new2("aliases"), aliases);
4236
+
4237
+ rb_ary_store(result, i, entry);
4238
+ }
4239
+
4240
+ return result;
4241
+ }
4242
+
4243
+ /*
4244
+ * call-seq:
4245
+ * dom.fs_info(flags=0) -> [Hash]
4246
+ *
4247
+ * Call virDomainGetFSInfo[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetFSInfo]
4248
+ * to get information about the guest filesystems.
4249
+ */
4250
+ static VALUE libvirt_domain_fs_info(int argc, VALUE *argv, VALUE d)
4251
+ {
4252
+ VALUE flags = RUBY_Qnil, result;
4253
+ virDomainFSInfoPtr *info;
4254
+ int ret, i = 0, exception;
4255
+ struct fs_info_arg args;
4256
+
4257
+ rb_scan_args(argc, argv, "01", &flags);
4258
+
4259
+ ret = virDomainGetFSInfo(ruby_libvirt_domain_get(d), &info,
4260
+ ruby_libvirt_value_to_uint(flags));
4261
+ ruby_libvirt_raise_error_if(ret < 0, e_Error, "virDomainGetFSInfo",
4262
+ ruby_libvirt_connect_get(d));
4263
+
4264
+ args.info = info;
4265
+ args.ninfo = ret;
4266
+ result = rb_protect(fs_info_wrap, (VALUE)&args, &exception);
4267
+
4268
+ for (i = 0; i < ret; i++) {
4269
+ virDomainFSInfoFree(info[i]);
4270
+ }
4271
+ free(info);
4272
+
4273
+ if (exception) {
4274
+ rb_jump_tag(exception);
4275
+ }
4276
+
4277
+ return result;
4278
+ }
4279
+ #endif
4280
+
4281
+ #if HAVE_VIRDOMAINRENAME
4282
+ /*
4283
+ * call-seq:
4284
+ * dom.rename(name, flags=0) -> nil
4285
+ *
4286
+ * Call virDomainRename[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainRename]
4287
+ * to rename a domain.
4288
+ */
4289
+ static VALUE libvirt_domain_rename(int argc, VALUE *argv, VALUE d)
4290
+ {
4291
+ VALUE flags = RUBY_Qnil, name;
4292
+
4293
+ rb_scan_args(argc, argv, "11", &name, &flags);
4294
+
4295
+ ruby_libvirt_generate_call_nil(virDomainRename,
4296
+ ruby_libvirt_connect_get(d),
4297
+ ruby_libvirt_domain_get(d),
4298
+ StringValueCStr(name),
4299
+ ruby_libvirt_value_to_uint(flags));
4300
+ }
4301
+ #endif
4302
+
4303
+ #if HAVE_VIRDOMAINSETUSERPASSWORD
4304
+ /*
4305
+ * call-seq:
4306
+ * dom.user_password = user,password,flags=0 -> nil
4307
+ *
4308
+ * Call virDomainSetUserPassword[http://www.libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetUserPassword]
4309
+ * to set the user password on a domain.
4310
+ */
4311
+ static VALUE libvirt_domain_user_password_equal(VALUE d, VALUE in)
4312
+ {
4313
+ VALUE user, password, flags;
4314
+
4315
+ Check_Type(in, T_ARRAY);
4316
+
4317
+ if (RARRAY_LEN(in) == 2) {
4318
+ user = rb_ary_entry(in, 0);
4319
+ password = rb_ary_entry(in, 1);
4320
+ flags = INT2NUM(0);
4321
+ }
4322
+ else if (RARRAY_LEN(in) == 3) {
4323
+ user = rb_ary_entry(in, 0);
4324
+ password = rb_ary_entry(in, 1);
4325
+ flags = rb_ary_entry(in, 2);
4326
+ }
4327
+ else {
4328
+ rb_raise(rb_eArgError, "wrong number of arguments (%ld for 2 or 3)",
4329
+ RARRAY_LEN(in));
4330
+ }
4331
+
4332
+ ruby_libvirt_generate_call_nil(virDomainSetUserPassword,
4333
+ ruby_libvirt_connect_get(d),
4334
+ ruby_libvirt_domain_get(d),
4335
+ StringValueCStr(user),
4336
+ StringValueCStr(password),
4337
+ ruby_libvirt_value_to_uint(flags));
4338
+ }
4339
+ #endif
4340
+
4051
4341
  /*
4052
4342
  * Class Libvirt::Domain
4053
4343
  */
@@ -4115,6 +4405,14 @@ void ruby_libvirt_domain_init(void)
4115
4405
  rb_define_const(c_domain, "MIGRATE_ABORT_ON_ERROR",
4116
4406
  INT2NUM(VIR_MIGRATE_ABORT_ON_ERROR));
4117
4407
  #endif
4408
+ #if HAVE_CONST_VIR_MIGRATE_AUTO_CONVERGE
4409
+ rb_define_const(c_domain, "MIGRATE_AUTO_CONVERGE",
4410
+ INT2NUM(VIR_MIGRATE_AUTO_CONVERGE));
4411
+ #endif
4412
+ #if HAVE_CONST_VIR_MIGRATE_RDMA_PIN_ALL
4413
+ rb_define_const(c_domain, "MIGRATE_RDMA_PIN_ALL",
4414
+ INT2NUM(VIR_MIGRATE_RDMA_PIN_ALL));
4415
+ #endif
4118
4416
 
4119
4417
  /* Ideally we would just have the "XML_SECURE" constant. Unfortunately
4120
4418
  * we screwed up long ago, and we have to leave "DOMAIN_XML_SECURE" for
@@ -4238,7 +4536,10 @@ void ruby_libvirt_domain_init(void)
4238
4536
  rb_define_const(c_domain, "UNDEFINE_SNAPSHOTS_METADATA",
4239
4537
  INT2NUM(VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA));
4240
4538
  #endif
4241
-
4539
+ #if HAVE_CONST_VIR_DOMAIN_UNDEFINE_NVRAM
4540
+ rb_define_const(c_domain, "UNDEFINE_NVRAM",
4541
+ INT2NUM(VIR_DOMAIN_UNDEFINE_NVRAM));
4542
+ #endif
4242
4543
  rb_define_attr(c_domain, "connection", 1, 0);
4243
4544
 
4244
4545
  #if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_DEFAULT
@@ -4260,6 +4561,10 @@ void ruby_libvirt_domain_init(void)
4260
4561
  #if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_SIGNAL
4261
4562
  rb_define_const(c_domain, "SHUTDOWN_SIGNAL",
4262
4563
  INT2NUM(VIR_DOMAIN_SHUTDOWN_SIGNAL));
4564
+ #endif
4565
+ #if HAVE_CONST_VIR_DOMAIN_SHUTDOWN_PARAVIRT
4566
+ rb_define_const(c_domain, "SHUTDOWN_PARAVIRT",
4567
+ INT2NUM(VIR_DOMAIN_SHUTDOWN_PARAVIRT));
4263
4568
  #endif
4264
4569
  rb_define_method(c_domain, "shutdown", libvirt_domain_shutdown, -1);
4265
4570
 
@@ -4282,6 +4587,10 @@ void ruby_libvirt_domain_init(void)
4282
4587
  #if HAVE_CONST_VIR_DOMAIN_REBOOT_SIGNAL
4283
4588
  rb_define_const(c_domain, "REBOOT_SIGNAL",
4284
4589
  INT2NUM(VIR_DOMAIN_REBOOT_SIGNAL));
4590
+ #endif
4591
+ #if HAVE_CONST_VIR_DOMAIN_REBOOT_PARAVIRT
4592
+ rb_define_const(c_domain, "REBOOT_PARAVIRT",
4593
+ INT2NUM(VIR_DOMAIN_REBOOT_PARAVIRT));
4285
4594
  #endif
4286
4595
  rb_define_method(c_domain, "reboot", libvirt_domain_reboot, -1);
4287
4596
  #if HAVE_CONST_VIR_DOMAIN_DESTROY_DEFAULT
@@ -5402,10 +5711,19 @@ void ruby_libvirt_domain_init(void)
5402
5711
  rb_define_method(c_domain, "block_job_speed=",
5403
5712
  libvirt_domain_block_job_speed_equal, 1);
5404
5713
  #endif
5714
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES
5715
+ rb_define_const(c_domain, "BLOCK_JOB_SPEED_BANDWIDTH_BYTES",
5716
+ INT2NUM(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES));
5717
+ #endif
5405
5718
  #if HAVE_VIRDOMAINGETBLOCKJOBINFO
5406
5719
  rb_define_method(c_domain, "block_job_info", libvirt_domain_block_job_info,
5407
5720
  -1);
5408
5721
  #endif
5722
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES
5723
+ rb_define_const(c_domain, "BLOCK_JOB_INFO_BANDWIDTH_BYTES",
5724
+ INT2NUM(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES));
5725
+ #endif
5726
+
5409
5727
  #if HAVE_VIRDOMAINBLOCKJOBABORT
5410
5728
  rb_define_method(c_domain, "block_job_abort",
5411
5729
  libvirt_domain_block_job_abort, -1);
@@ -5446,6 +5764,10 @@ void ruby_libvirt_domain_init(void)
5446
5764
  rb_define_const(c_domain, "QEMU_AGENT_COMMAND_NOWAIT",
5447
5765
  INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
5448
5766
  #endif
5767
+ #if HAVE_CONST_VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN
5768
+ rb_define_const(c_domain, "QEMU_AGENT_COMMAND_SHUTDOWN",
5769
+ INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN));
5770
+ #endif
5449
5771
  #if HAVE_CONST_VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT
5450
5772
  rb_define_const(c_domain, "QEMU_MONITOR_COMMAND_DEFAULT",
5451
5773
  INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
@@ -5471,6 +5793,18 @@ void ruby_libvirt_domain_init(void)
5471
5793
  rb_define_const(c_domain, "BLOCK_COMMIT_DELETE",
5472
5794
  INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_DELETE));
5473
5795
  #endif
5796
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_ACTIVE
5797
+ rb_define_const(c_domain, "BLOCK_COMMIT_ACTIVE",
5798
+ INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_ACTIVE));
5799
+ #endif
5800
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
5801
+ rb_define_const(c_domain, "BLOCK_COMMIT_RELATIVE",
5802
+ INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_RELATIVE));
5803
+ #endif
5804
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES
5805
+ rb_define_const(c_domain, "BLOCK_COMMIT_BANDWIDTH_BYTES",
5806
+ INT2NUM(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES));
5807
+ #endif
5474
5808
  #if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN
5475
5809
  rb_define_const(c_domain, "BLOCK_JOB_TYPE_UNKNOWN",
5476
5810
  INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN));
@@ -5487,6 +5821,10 @@ void ruby_libvirt_domain_init(void)
5487
5821
  rb_define_const(c_domain, "BLOCK_JOB_TYPE_COMMIT",
5488
5822
  INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT));
5489
5823
  #endif
5824
+ #if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT
5825
+ rb_define_const(c_domain, "BLOCK_JOB_TYPE_ACTIVE_COMMIT",
5826
+ INT2NUM(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT));
5827
+ #endif
5490
5828
  #if HAVE_CONST_VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC
5491
5829
  rb_define_const(c_domain, "BLOCK_JOB_ABORT_ASYNC",
5492
5830
  INT2NUM(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC));
@@ -5514,4 +5852,52 @@ void ruby_libvirt_domain_init(void)
5514
5852
  #if HAVE_VIRDOMAINGETCPUSTATS
5515
5853
  rb_define_method(c_domain, "cpu_stats", libvirt_domain_cpu_stats, -1);
5516
5854
  #endif
5855
+ #if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_RAW
5856
+ rb_define_const(c_domain, "CORE_DUMP_FORMAT_RAW",
5857
+ INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_RAW));
5858
+ #endif
5859
+ #if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB
5860
+ rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_ZLIB",
5861
+ INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB));
5862
+ #endif
5863
+ #if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO
5864
+ rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_LZO",
5865
+ INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO));
5866
+ #endif
5867
+ #if HAVE_CONST_VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY
5868
+ rb_define_const(c_domain, "CORE_DUMP_FORMAT_KDUMP_SNAPPY",
5869
+ INT2NUM(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY));
5870
+ #endif
5871
+ #if HAVE_VIRDOMAINGETTIME
5872
+ rb_define_method(c_domain, "time", libvirt_domain_get_time, -1);
5873
+ #endif
5874
+ #if HAVE_VIRDOMAINSETTIME
5875
+ rb_define_method(c_domain, "time=", libvirt_domain_time_equal, 1);
5876
+ #endif
5877
+ #if HAVE_VIRDOMAINCOREDUMPWITHFORMAT
5878
+ rb_define_method(c_domain, "core_dump_with_format",
5879
+ libvirt_domain_core_dump_with_format, -1);
5880
+ #endif
5881
+ #if HAVE_VIRDOMAINFSFREEZE
5882
+ rb_define_method(c_domain, "fs_freeze", libvirt_domain_fs_freeze, -1);
5883
+ #endif
5884
+ #if HAVE_VIRDOMAINFSTHAW
5885
+ rb_define_method(c_domain, "fs_thaw", libvirt_domain_fs_thaw, -1);
5886
+ #endif
5887
+ #if HAVE_VIRDOMAINGETFSINFO
5888
+ rb_define_method(c_domain, "fs_info", libvirt_domain_fs_info, -1);
5889
+ #endif
5890
+ #if HAVE_VIRDOMAINRENAME
5891
+ rb_define_method(c_domain, "rename", libvirt_domain_rename, -1);
5892
+ #endif
5893
+ #if HAVE_VIRDOMAINSETUSERPASSWORD
5894
+ rb_define_method(c_domain, "user_password=", libvirt_domain_user_password_equal, 1);
5895
+ #endif
5896
+ #if HAVE_CONST_VIR_DOMAIN_PASSWORD_ENCRYPTED
5897
+ rb_define_const(c_domain, "PASSWORD_ENCRYPTED",
5898
+ INT2NUM(VIR_DOMAIN_PASSWORD_ENCRYPTED));
5899
+ #endif
5900
+ #if HAVE_CONST_VIR_DOMAIN_TIME_SYNC
5901
+ rb_define_const(c_domain, "TIME_SYNC", INT2NUM(VIR_DOMAIN_TIME_SYNC));
5902
+ #endif
5517
5903
  }