1 /* !!! WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!!
3 * THIS FILE IS AUTOMATICALLY GENERATED BY 'generator.pl'.
5 * Any changes you make to this file may be overwritten.
8 /* OCaml bindings for libvirt.
9 * (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc.
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 #include <libvirt/libvirt.h>
34 #include <libvirt/virterror.h>
36 #include <caml/config.h>
37 #include <caml/alloc.h>
38 #include <caml/callback.h>
39 #include <caml/custom.h>
40 #include <caml/fail.h>
41 #include <caml/memory.h>
42 #include <caml/misc.h>
43 #include <caml/mlvalues.h>
44 #include <caml/signals.h>
46 #include "libvirt_c_prologue.c"
48 #include "libvirt_c_oneoffs.c"
50 /* Automatically generated binding for virConnectClose.
51 * Function signature in generator.pl is "conn : free"
55 ocaml_libvirt_connect_close (value connv)
59 virConnectPtr conn = Connect_val (connv);
62 NONBLOCKING (r = virConnectClose (conn));
63 CHECK_ERROR (r == -1, conn, "virConnectClose");
65 /* So that we don't double-free in the finalizer: */
66 Connect_val (connv) = NULL;
68 CAMLreturn (Val_unit);
71 /* Automatically generated binding for virConnectGetHostname.
72 * Function signature in generator.pl is "conn : string"
75 #ifdef HAVE_WEAK_SYMBOLS
76 #ifdef HAVE_VIRCONNECTGETHOSTNAME
77 extern char *virConnectGetHostname (virConnectPtr conn) __attribute__((weak));
82 ocaml_libvirt_connect_get_hostname (value connv)
85 #ifndef HAVE_VIRCONNECTGETHOSTNAME
86 /* Symbol virConnectGetHostname not found at compile time. */
87 not_supported ("virConnectGetHostname");
88 /* Suppresses a compiler warning. */
91 /* Check that the symbol virConnectGetHostname
92 * is in runtime version of libvirt.
94 WEAK_SYMBOL_CHECK (virConnectGetHostname);
97 virConnectPtr conn = Connect_val (connv);
100 NONBLOCKING (r = virConnectGetHostname (conn));
101 CHECK_ERROR (!r, conn, "virConnectGetHostname");
103 rv = caml_copy_string (r);
109 /* Automatically generated binding for virConnectGetURI.
110 * Function signature in generator.pl is "conn : string"
113 #ifdef HAVE_WEAK_SYMBOLS
114 #ifdef HAVE_VIRCONNECTGETURI
115 extern char *virConnectGetURI (virConnectPtr conn) __attribute__((weak));
120 ocaml_libvirt_connect_get_uri (value connv)
123 #ifndef HAVE_VIRCONNECTGETURI
124 /* Symbol virConnectGetURI not found at compile time. */
125 not_supported ("virConnectGetURI");
126 /* Suppresses a compiler warning. */
129 /* Check that the symbol virConnectGetURI
130 * is in runtime version of libvirt.
132 WEAK_SYMBOL_CHECK (virConnectGetURI);
135 virConnectPtr conn = Connect_val (connv);
138 NONBLOCKING (r = virConnectGetURI (conn));
139 CHECK_ERROR (!r, conn, "virConnectGetURI");
141 rv = caml_copy_string (r);
147 /* Automatically generated binding for virConnectGetType.
148 * Function signature in generator.pl is "conn : static string"
152 ocaml_libvirt_connect_get_type (value connv)
157 virConnectPtr conn = Connect_val (connv);
160 NONBLOCKING (r = virConnectGetType (conn));
161 CHECK_ERROR (!r, conn, "virConnectGetType");
163 rv = caml_copy_string (r);
167 /* Automatically generated binding for virConnectNumOfDomains.
168 * Function signature in generator.pl is "conn : int"
172 ocaml_libvirt_connect_num_of_domains (value connv)
176 virConnectPtr conn = Connect_val (connv);
179 NONBLOCKING (r = virConnectNumOfDomains (conn));
180 CHECK_ERROR (r == -1, conn, "virConnectNumOfDomains");
182 CAMLreturn (Val_int (r));
185 /* Automatically generated binding for virConnectListDomains.
186 * Function signature in generator.pl is "conn, int : int array"
190 ocaml_libvirt_connect_list_domains (value connv, value iv)
192 CAMLparam2 (connv, iv);
195 virConnectPtr conn = Connect_val (connv);
196 int i = Int_val (iv);
199 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
200 CHECK_ERROR (r == -1, conn, "virConnectListDomains");
202 rv = caml_alloc (r, 0);
203 for (i = 0; i < r; ++i)
204 Store_field (rv, i, Val_int (ids[i]));
209 /* Automatically generated binding for virConnectNumOfDefinedDomains.
210 * Function signature in generator.pl is "conn : int"
214 ocaml_libvirt_connect_num_of_defined_domains (value connv)
218 virConnectPtr conn = Connect_val (connv);
221 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
222 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedDomains");
224 CAMLreturn (Val_int (r));
227 /* Automatically generated binding for virConnectListDefinedDomains.
228 * Function signature in generator.pl is "conn, int : string array"
232 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
234 CAMLparam2 (connv, iv);
236 CAMLlocal2 (rv, strv);
237 virConnectPtr conn = Connect_val (connv);
238 int i = Int_val (iv);
242 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
243 CHECK_ERROR (r == -1, conn, "virConnectListDefinedDomains");
245 rv = caml_alloc (r, 0);
246 for (i = 0; i < r; ++i) {
247 strv = caml_copy_string (names[i]);
248 Store_field (rv, i, strv);
255 /* Automatically generated binding for virConnectNumOfNetworks.
256 * Function signature in generator.pl is "conn : int"
260 ocaml_libvirt_connect_num_of_networks (value connv)
264 virConnectPtr conn = Connect_val (connv);
267 NONBLOCKING (r = virConnectNumOfNetworks (conn));
268 CHECK_ERROR (r == -1, conn, "virConnectNumOfNetworks");
270 CAMLreturn (Val_int (r));
273 /* Automatically generated binding for virConnectListNetworks.
274 * Function signature in generator.pl is "conn, int : string array"
278 ocaml_libvirt_connect_list_networks (value connv, value iv)
280 CAMLparam2 (connv, iv);
282 CAMLlocal2 (rv, strv);
283 virConnectPtr conn = Connect_val (connv);
284 int i = Int_val (iv);
288 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
289 CHECK_ERROR (r == -1, conn, "virConnectListNetworks");
291 rv = caml_alloc (r, 0);
292 for (i = 0; i < r; ++i) {
293 strv = caml_copy_string (names[i]);
294 Store_field (rv, i, strv);
301 /* Automatically generated binding for virConnectNumOfDefinedNetworks.
302 * Function signature in generator.pl is "conn : int"
306 ocaml_libvirt_connect_num_of_defined_networks (value connv)
310 virConnectPtr conn = Connect_val (connv);
313 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
314 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedNetworks");
316 CAMLreturn (Val_int (r));
319 /* Automatically generated binding for virConnectListDefinedNetworks.
320 * Function signature in generator.pl is "conn, int : string array"
324 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
326 CAMLparam2 (connv, iv);
328 CAMLlocal2 (rv, strv);
329 virConnectPtr conn = Connect_val (connv);
330 int i = Int_val (iv);
334 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
335 CHECK_ERROR (r == -1, conn, "virConnectListDefinedNetworks");
337 rv = caml_alloc (r, 0);
338 for (i = 0; i < r; ++i) {
339 strv = caml_copy_string (names[i]);
340 Store_field (rv, i, strv);
347 /* Automatically generated binding for virConnectNumOfStoragePools.
348 * Function signature in generator.pl is "conn : int"
351 #ifdef HAVE_WEAK_SYMBOLS
352 #ifdef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
353 extern int virConnectNumOfStoragePools (virConnectPtr conn) __attribute__((weak));
358 ocaml_libvirt_connect_num_of_storage_pools (value connv)
361 #ifndef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
362 /* Symbol virConnectNumOfStoragePools not found at compile time. */
363 not_supported ("virConnectNumOfStoragePools");
364 /* Suppresses a compiler warning. */
367 /* Check that the symbol virConnectNumOfStoragePools
368 * is in runtime version of libvirt.
370 WEAK_SYMBOL_CHECK (virConnectNumOfStoragePools);
372 virConnectPtr conn = Connect_val (connv);
375 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
376 CHECK_ERROR (r == -1, conn, "virConnectNumOfStoragePools");
378 CAMLreturn (Val_int (r));
382 /* Automatically generated binding for virConnectListStoragePools.
383 * Function signature in generator.pl is "conn, int : string array"
386 #ifdef HAVE_WEAK_SYMBOLS
387 #ifdef HAVE_VIRCONNECTLISTSTORAGEPOOLS
388 extern int virConnectListStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
393 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
395 CAMLparam2 (connv, iv);
396 #ifndef HAVE_VIRCONNECTLISTSTORAGEPOOLS
397 /* Symbol virConnectListStoragePools not found at compile time. */
398 not_supported ("virConnectListStoragePools");
399 /* Suppresses a compiler warning. */
402 /* Check that the symbol virConnectListStoragePools
403 * is in runtime version of libvirt.
405 WEAK_SYMBOL_CHECK (virConnectListStoragePools);
407 CAMLlocal2 (rv, strv);
408 virConnectPtr conn = Connect_val (connv);
409 int i = Int_val (iv);
413 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
414 CHECK_ERROR (r == -1, conn, "virConnectListStoragePools");
416 rv = caml_alloc (r, 0);
417 for (i = 0; i < r; ++i) {
418 strv = caml_copy_string (names[i]);
419 Store_field (rv, i, strv);
427 /* Automatically generated binding for virConnectNumOfDefinedStoragePools.
428 * Function signature in generator.pl is "conn : int"
431 #ifdef HAVE_WEAK_SYMBOLS
432 #ifdef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
433 extern int virConnectNumOfDefinedStoragePools (virConnectPtr conn) __attribute__((weak));
438 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
441 #ifndef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
442 /* Symbol virConnectNumOfDefinedStoragePools not found at compile time. */
443 not_supported ("virConnectNumOfDefinedStoragePools");
444 /* Suppresses a compiler warning. */
447 /* Check that the symbol virConnectNumOfDefinedStoragePools
448 * is in runtime version of libvirt.
450 WEAK_SYMBOL_CHECK (virConnectNumOfDefinedStoragePools);
452 virConnectPtr conn = Connect_val (connv);
455 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
456 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedStoragePools");
458 CAMLreturn (Val_int (r));
462 /* Automatically generated binding for virConnectListDefinedStoragePools.
463 * Function signature in generator.pl is "conn, int : string array"
466 #ifdef HAVE_WEAK_SYMBOLS
467 #ifdef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
468 extern int virConnectListDefinedStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
473 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
475 CAMLparam2 (connv, iv);
476 #ifndef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
477 /* Symbol virConnectListDefinedStoragePools not found at compile time. */
478 not_supported ("virConnectListDefinedStoragePools");
479 /* Suppresses a compiler warning. */
482 /* Check that the symbol virConnectListDefinedStoragePools
483 * is in runtime version of libvirt.
485 WEAK_SYMBOL_CHECK (virConnectListDefinedStoragePools);
487 CAMLlocal2 (rv, strv);
488 virConnectPtr conn = Connect_val (connv);
489 int i = Int_val (iv);
493 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
494 CHECK_ERROR (r == -1, conn, "virConnectListDefinedStoragePools");
496 rv = caml_alloc (r, 0);
497 for (i = 0; i < r; ++i) {
498 strv = caml_copy_string (names[i]);
499 Store_field (rv, i, strv);
507 /* Automatically generated binding for virConnectGetCapabilities.
508 * Function signature in generator.pl is "conn : string"
512 ocaml_libvirt_connect_get_capabilities (value connv)
517 virConnectPtr conn = Connect_val (connv);
520 NONBLOCKING (r = virConnectGetCapabilities (conn));
521 CHECK_ERROR (!r, conn, "virConnectGetCapabilities");
523 rv = caml_copy_string (r);
528 /* Automatically generated binding for virDomainCreateLinux.
529 * Function signature in generator.pl is "conn, string, 0U : dom"
533 ocaml_libvirt_domain_create_linux (value connv, value strv)
535 CAMLparam2 (connv, strv);
538 virConnectPtr conn = Connect_val (connv);
539 char *str = String_val (strv);
542 NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
543 CHECK_ERROR (!r, conn, "virDomainCreateLinux");
545 rv = Val_domain (r, connv);
550 /* Automatically generated binding for virDomainCreateLinuxJob.
551 * Function signature in generator.pl is "conn, string, 0U : job"
554 #ifdef HAVE_WEAK_SYMBOLS
555 #ifdef HAVE_VIRDOMAINCREATELINUXJOB
556 extern virJobPtr virDomainCreateLinuxJob (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
561 ocaml_libvirt_domain_create_linux_job (value connv, value strv)
563 CAMLparam2 (connv, strv);
564 #ifndef HAVE_VIRDOMAINCREATELINUXJOB
565 /* Symbol virDomainCreateLinuxJob not found at compile time. */
566 not_supported ("virDomainCreateLinuxJob");
567 /* Suppresses a compiler warning. */
570 /* Check that the symbol virDomainCreateLinuxJob
571 * is in runtime version of libvirt.
573 WEAK_SYMBOL_CHECK (virDomainCreateLinuxJob);
576 virConnectPtr conn = Connect_val (connv);
577 char *str = String_val (strv);
580 NONBLOCKING (r = virDomainCreateLinuxJob (conn, str, 0));
581 CHECK_ERROR (!r, conn, "virDomainCreateLinuxJob");
583 rv = Val_job (r, connv);
589 /* Automatically generated binding for virDomainFree.
590 * Function signature in generator.pl is "dom : free"
594 ocaml_libvirt_domain_free (value domv)
598 virDomainPtr dom = Domain_val (domv);
599 virConnectPtr conn = Connect_domv (domv);
602 NONBLOCKING (r = virDomainFree (dom));
603 CHECK_ERROR (r == -1, conn, "virDomainFree");
605 /* So that we don't double-free in the finalizer: */
606 Domain_val (domv) = NULL;
608 CAMLreturn (Val_unit);
611 /* Automatically generated binding for virDomainDestroy.
612 * Function signature in generator.pl is "dom : free"
616 ocaml_libvirt_domain_destroy (value domv)
620 virDomainPtr dom = Domain_val (domv);
621 virConnectPtr conn = Connect_domv (domv);
624 NONBLOCKING (r = virDomainDestroy (dom));
625 CHECK_ERROR (r == -1, conn, "virDomainDestroy");
627 /* So that we don't double-free in the finalizer: */
628 Domain_val (domv) = NULL;
630 CAMLreturn (Val_unit);
633 /* Automatically generated binding for virDomainLookupByName.
634 * Function signature in generator.pl is "conn, string : dom"
638 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
640 CAMLparam2 (connv, strv);
643 virConnectPtr conn = Connect_val (connv);
644 char *str = String_val (strv);
647 NONBLOCKING (r = virDomainLookupByName (conn, str));
648 CHECK_ERROR (!r, conn, "virDomainLookupByName");
650 rv = Val_domain (r, connv);
655 /* Automatically generated binding for virDomainLookupByID.
656 * Function signature in generator.pl is "conn, int : dom"
660 ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
662 CAMLparam2 (connv, iv);
665 virConnectPtr conn = Connect_val (connv);
666 int i = Int_val (iv);
669 NONBLOCKING (r = virDomainLookupByID (conn, i));
670 CHECK_ERROR (!r, conn, "virDomainLookupByID");
672 rv = Val_domain (r, connv);
677 /* Automatically generated binding for virDomainLookupByUUID.
678 * Function signature in generator.pl is "conn, uuid : dom"
682 ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
684 CAMLparam2 (connv, uuidv);
687 virConnectPtr conn = Connect_val (connv);
688 unsigned char *uuid = (unsigned char *) String_val (uuidv);
691 NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
692 CHECK_ERROR (!r, conn, "virDomainLookupByUUID");
694 rv = Val_domain (r, connv);
699 /* Automatically generated binding for virDomainLookupByUUIDString.
700 * Function signature in generator.pl is "conn, string : dom"
704 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
706 CAMLparam2 (connv, strv);
709 virConnectPtr conn = Connect_val (connv);
710 char *str = String_val (strv);
713 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
714 CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
716 rv = Val_domain (r, connv);
721 /* Automatically generated binding for virDomainGetName.
722 * Function signature in generator.pl is "dom : static string"
726 ocaml_libvirt_domain_get_name (value domv)
731 virDomainPtr dom = Domain_val (domv);
732 virConnectPtr conn = Connect_domv (domv);
735 NONBLOCKING (r = virDomainGetName (dom));
736 CHECK_ERROR (!r, conn, "virDomainGetName");
738 rv = caml_copy_string (r);
742 /* Automatically generated binding for virDomainGetOSType.
743 * Function signature in generator.pl is "dom : string"
747 ocaml_libvirt_domain_get_os_type (value domv)
752 virDomainPtr dom = Domain_val (domv);
753 virConnectPtr conn = Connect_domv (domv);
756 NONBLOCKING (r = virDomainGetOSType (dom));
757 CHECK_ERROR (!r, conn, "virDomainGetOSType");
759 rv = caml_copy_string (r);
764 /* Automatically generated binding for virDomainGetXMLDesc.
765 * Function signature in generator.pl is "dom, 0 : string"
769 ocaml_libvirt_domain_get_xml_desc (value domv)
774 virDomainPtr dom = Domain_val (domv);
775 virConnectPtr conn = Connect_domv (domv);
778 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
779 CHECK_ERROR (!r, conn, "virDomainGetXMLDesc");
781 rv = caml_copy_string (r);
786 /* Automatically generated binding for virDomainGetUUID.
787 * Function signature in generator.pl is "dom : uuid"
791 ocaml_libvirt_domain_get_uuid (value domv)
796 virDomainPtr dom = Domain_val (domv);
797 virConnectPtr conn = Connect_domv (domv);
798 unsigned char uuid[VIR_UUID_BUFLEN];
801 NONBLOCKING (r = virDomainGetUUID (dom, uuid));
802 CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
804 rv = caml_copy_string ((char *) uuid);
808 /* Automatically generated binding for virDomainGetUUIDString.
809 * Function signature in generator.pl is "dom : uuid string"
813 ocaml_libvirt_domain_get_uuid_string (value domv)
818 virDomainPtr dom = Domain_val (domv);
819 virConnectPtr conn = Connect_domv (domv);
820 char uuid[VIR_UUID_STRING_BUFLEN];
823 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
824 CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
826 rv = caml_copy_string (uuid);
830 /* Automatically generated binding for virDomainGetMaxVcpus.
831 * Function signature in generator.pl is "dom : int"
835 ocaml_libvirt_domain_get_max_vcpus (value domv)
839 virDomainPtr dom = Domain_val (domv);
840 virConnectPtr conn = Connect_domv (domv);
843 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
844 CHECK_ERROR (r == -1, conn, "virDomainGetMaxVcpus");
846 CAMLreturn (Val_int (r));
849 /* Automatically generated binding for virDomainSave.
850 * Function signature in generator.pl is "dom, string : unit"
854 ocaml_libvirt_domain_save (value domv, value strv)
856 CAMLparam2 (domv, strv);
859 virDomainPtr dom = Domain_val (domv);
860 virConnectPtr conn = Connect_domv (domv);
861 char *str = String_val (strv);
864 NONBLOCKING (r = virDomainSave (dom, str));
865 CHECK_ERROR (r == -1, conn, "virDomainSave");
867 CAMLreturn (Val_unit);
870 /* Automatically generated binding for virDomainSaveJob.
871 * Function signature in generator.pl is "dom, string : job from dom"
874 #ifdef HAVE_WEAK_SYMBOLS
875 #ifdef HAVE_VIRDOMAINSAVEJOB
876 extern virJobPtr virDomainSaveJob (virDomainPtr dom, const char *str) __attribute__((weak));
881 ocaml_libvirt_domain_save_job (value domv, value strv)
883 CAMLparam2 (domv, strv);
884 #ifndef HAVE_VIRDOMAINSAVEJOB
885 /* Symbol virDomainSaveJob not found at compile time. */
886 not_supported ("virDomainSaveJob");
887 /* Suppresses a compiler warning. */
890 /* Check that the symbol virDomainSaveJob
891 * is in runtime version of libvirt.
893 WEAK_SYMBOL_CHECK (virDomainSaveJob);
895 CAMLlocal2 (rv, connv);
896 virDomainPtr dom = Domain_val (domv);
897 virConnectPtr conn = Connect_domv (domv);
898 char *str = String_val (strv);
901 NONBLOCKING (r = virDomainSaveJob (dom, str));
902 CHECK_ERROR (!r, conn, "virDomainSaveJob");
904 connv = Field (domv, 1);
905 rv = Val_job (r, connv);
911 /* Automatically generated binding for virDomainRestore.
912 * Function signature in generator.pl is "conn, string : unit"
916 ocaml_libvirt_domain_restore (value connv, value strv)
918 CAMLparam2 (connv, strv);
921 virConnectPtr conn = Connect_val (connv);
922 char *str = String_val (strv);
925 NONBLOCKING (r = virDomainRestore (conn, str));
926 CHECK_ERROR (r == -1, conn, "virDomainRestore");
928 CAMLreturn (Val_unit);
931 /* Automatically generated binding for virDomainRestoreJob.
932 * Function signature in generator.pl is "conn, string : job"
935 #ifdef HAVE_WEAK_SYMBOLS
936 #ifdef HAVE_VIRDOMAINRESTOREJOB
937 extern virJobPtr virDomainRestoreJob (virConnectPtr conn, const char *str) __attribute__((weak));
942 ocaml_libvirt_domain_restore_job (value connv, value strv)
944 CAMLparam2 (connv, strv);
945 #ifndef HAVE_VIRDOMAINRESTOREJOB
946 /* Symbol virDomainRestoreJob not found at compile time. */
947 not_supported ("virDomainRestoreJob");
948 /* Suppresses a compiler warning. */
951 /* Check that the symbol virDomainRestoreJob
952 * is in runtime version of libvirt.
954 WEAK_SYMBOL_CHECK (virDomainRestoreJob);
957 virConnectPtr conn = Connect_val (connv);
958 char *str = String_val (strv);
961 NONBLOCKING (r = virDomainRestoreJob (conn, str));
962 CHECK_ERROR (!r, conn, "virDomainRestoreJob");
964 rv = Val_job (r, connv);
970 /* Automatically generated binding for virDomainCoreDump.
971 * Function signature in generator.pl is "dom, string, 0 : unit"
975 ocaml_libvirt_domain_core_dump (value domv, value strv)
977 CAMLparam2 (domv, strv);
980 virDomainPtr dom = Domain_val (domv);
981 virConnectPtr conn = Connect_domv (domv);
982 char *str = String_val (strv);
985 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
986 CHECK_ERROR (!r, conn, "virDomainCoreDump");
988 CAMLreturn (Val_unit);
991 /* Automatically generated binding for virDomainCoreDumpJob.
992 * Function signature in generator.pl is "dom, string, 0 : job from dom"
995 #ifdef HAVE_WEAK_SYMBOLS
996 #ifdef HAVE_VIRDOMAINCOREDUMPJOB
997 extern virJobPtr virDomainCoreDumpJob (virDomainPtr dom, const char *str, int flags) __attribute__((weak));
1002 ocaml_libvirt_domain_core_dump_job (value domv, value strv)
1004 CAMLparam2 (domv, strv);
1005 #ifndef HAVE_VIRDOMAINCOREDUMPJOB
1006 /* Symbol virDomainCoreDumpJob not found at compile time. */
1007 not_supported ("virDomainCoreDumpJob");
1008 /* Suppresses a compiler warning. */
1011 /* Check that the symbol virDomainCoreDumpJob
1012 * is in runtime version of libvirt.
1014 WEAK_SYMBOL_CHECK (virDomainCoreDumpJob);
1016 CAMLlocal2 (rv, connv);
1017 virDomainPtr dom = Domain_val (domv);
1018 virConnectPtr conn = Connect_domv (domv);
1019 char *str = String_val (strv);
1022 NONBLOCKING (r = virDomainCoreDumpJob (dom, str, 0));
1023 CHECK_ERROR (!r, conn, "virDomainCoreDumpJob");
1025 connv = Field (domv, 1);
1026 rv = Val_job (r, connv);
1032 /* Automatically generated binding for virDomainSuspend.
1033 * Function signature in generator.pl is "dom : unit"
1037 ocaml_libvirt_domain_suspend (value domv)
1041 virDomainPtr dom = Domain_val (domv);
1042 virConnectPtr conn = Connect_domv (domv);
1045 NONBLOCKING (r = virDomainSuspend (dom));
1046 CHECK_ERROR (r == -1, conn, "virDomainSuspend");
1048 CAMLreturn (Val_unit);
1051 /* Automatically generated binding for virDomainResume.
1052 * Function signature in generator.pl is "dom : unit"
1056 ocaml_libvirt_domain_resume (value domv)
1060 virDomainPtr dom = Domain_val (domv);
1061 virConnectPtr conn = Connect_domv (domv);
1064 NONBLOCKING (r = virDomainResume (dom));
1065 CHECK_ERROR (r == -1, conn, "virDomainResume");
1067 CAMLreturn (Val_unit);
1070 /* Automatically generated binding for virDomainShutdown.
1071 * Function signature in generator.pl is "dom : unit"
1075 ocaml_libvirt_domain_shutdown (value domv)
1079 virDomainPtr dom = Domain_val (domv);
1080 virConnectPtr conn = Connect_domv (domv);
1083 NONBLOCKING (r = virDomainShutdown (dom));
1084 CHECK_ERROR (r == -1, conn, "virDomainShutdown");
1086 CAMLreturn (Val_unit);
1089 /* Automatically generated binding for virDomainReboot.
1090 * Function signature in generator.pl is "dom, 0 : unit"
1094 ocaml_libvirt_domain_reboot (value domv)
1098 virDomainPtr dom = Domain_val (domv);
1099 virConnectPtr conn = Connect_domv (domv);
1102 NONBLOCKING (r = virDomainReboot (dom, 0));
1103 CHECK_ERROR (r == -1, conn, "virDomainReboot");
1105 CAMLreturn (Val_unit);
1108 /* Automatically generated binding for virDomainDefineXML.
1109 * Function signature in generator.pl is "conn, string : dom"
1113 ocaml_libvirt_domain_define_xml (value connv, value strv)
1115 CAMLparam2 (connv, strv);
1118 virConnectPtr conn = Connect_val (connv);
1119 char *str = String_val (strv);
1122 NONBLOCKING (r = virDomainDefineXML (conn, str));
1123 CHECK_ERROR (!r, conn, "virDomainDefineXML");
1125 rv = Val_domain (r, connv);
1130 /* Automatically generated binding for virDomainUndefine.
1131 * Function signature in generator.pl is "dom : unit"
1135 ocaml_libvirt_domain_undefine (value domv)
1139 virDomainPtr dom = Domain_val (domv);
1140 virConnectPtr conn = Connect_domv (domv);
1143 NONBLOCKING (r = virDomainUndefine (dom));
1144 CHECK_ERROR (r == -1, conn, "virDomainUndefine");
1146 CAMLreturn (Val_unit);
1149 /* Automatically generated binding for virDomainCreate.
1150 * Function signature in generator.pl is "dom : unit"
1154 ocaml_libvirt_domain_create (value domv)
1158 virDomainPtr dom = Domain_val (domv);
1159 virConnectPtr conn = Connect_domv (domv);
1162 NONBLOCKING (r = virDomainCreate (dom));
1163 CHECK_ERROR (r == -1, conn, "virDomainCreate");
1165 CAMLreturn (Val_unit);
1168 /* Automatically generated binding for virDomainCreateJob.
1169 * Function signature in generator.pl is "dom, 0U : job from dom"
1172 #ifdef HAVE_WEAK_SYMBOLS
1173 #ifdef HAVE_VIRDOMAINCREATEJOB
1174 extern virJobPtr virDomainCreateJob (virDomainPtr dom, unsigned int flags) __attribute__((weak));
1179 ocaml_libvirt_domain_create_job (value domv)
1182 #ifndef HAVE_VIRDOMAINCREATEJOB
1183 /* Symbol virDomainCreateJob not found at compile time. */
1184 not_supported ("virDomainCreateJob");
1185 /* Suppresses a compiler warning. */
1188 /* Check that the symbol virDomainCreateJob
1189 * is in runtime version of libvirt.
1191 WEAK_SYMBOL_CHECK (virDomainCreateJob);
1193 CAMLlocal2 (rv, connv);
1194 virDomainPtr dom = Domain_val (domv);
1195 virConnectPtr conn = Connect_domv (domv);
1198 NONBLOCKING (r = virDomainCreateJob (dom, 0));
1199 CHECK_ERROR (!r, conn, "virDomainCreateJob");
1201 connv = Field (domv, 1);
1202 rv = Val_job (r, connv);
1208 /* Automatically generated binding for virDomainAttachDevice.
1209 * Function signature in generator.pl is "dom, string : unit"
1213 ocaml_libvirt_domain_attach_device (value domv, value strv)
1215 CAMLparam2 (domv, strv);
1218 virDomainPtr dom = Domain_val (domv);
1219 virConnectPtr conn = Connect_domv (domv);
1220 char *str = String_val (strv);
1223 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1224 CHECK_ERROR (r == -1, conn, "virDomainAttachDevice");
1226 CAMLreturn (Val_unit);
1229 /* Automatically generated binding for virDomainDetachDevice.
1230 * Function signature in generator.pl is "dom, string : unit"
1234 ocaml_libvirt_domain_detach_device (value domv, value strv)
1236 CAMLparam2 (domv, strv);
1239 virDomainPtr dom = Domain_val (domv);
1240 virConnectPtr conn = Connect_domv (domv);
1241 char *str = String_val (strv);
1244 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1245 CHECK_ERROR (r == -1, conn, "virDomainDetachDevice");
1247 CAMLreturn (Val_unit);
1250 /* Automatically generated binding for virDomainGetAutostart.
1251 * Function signature in generator.pl is "dom : bool"
1255 ocaml_libvirt_domain_get_autostart (value domv)
1259 virDomainPtr dom = Domain_val (domv);
1260 virConnectPtr conn = Connect_domv (domv);
1263 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1264 CHECK_ERROR (r == -1, conn, "virDomainGetAutostart");
1266 CAMLreturn (b ? Val_true : Val_false);
1269 /* Automatically generated binding for virDomainSetAutostart.
1270 * Function signature in generator.pl is "dom, bool : unit"
1274 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1276 CAMLparam2 (domv, bv);
1278 virDomainPtr dom = Domain_val (domv);
1279 virConnectPtr conn = Connect_domv (domv);
1282 b = bv == Val_true ? 1 : 0;
1284 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1285 CHECK_ERROR (r == -1, conn, "virDomainSetAutostart");
1287 CAMLreturn (Val_unit);
1290 /* Automatically generated binding for virNetworkFree.
1291 * Function signature in generator.pl is "net : free"
1295 ocaml_libvirt_network_free (value netv)
1299 virNetworkPtr net = Network_val (netv);
1300 virConnectPtr conn = Connect_netv (netv);
1303 NONBLOCKING (r = virNetworkFree (net));
1304 CHECK_ERROR (r == -1, conn, "virNetworkFree");
1306 /* So that we don't double-free in the finalizer: */
1307 Network_val (netv) = NULL;
1309 CAMLreturn (Val_unit);
1312 /* Automatically generated binding for virNetworkDestroy.
1313 * Function signature in generator.pl is "net : free"
1317 ocaml_libvirt_network_destroy (value netv)
1321 virNetworkPtr net = Network_val (netv);
1322 virConnectPtr conn = Connect_netv (netv);
1325 NONBLOCKING (r = virNetworkDestroy (net));
1326 CHECK_ERROR (r == -1, conn, "virNetworkDestroy");
1328 /* So that we don't double-free in the finalizer: */
1329 Network_val (netv) = NULL;
1331 CAMLreturn (Val_unit);
1334 /* Automatically generated binding for virNetworkLookupByName.
1335 * Function signature in generator.pl is "conn, string : net"
1339 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1341 CAMLparam2 (connv, strv);
1344 virConnectPtr conn = Connect_val (connv);
1345 char *str = String_val (strv);
1348 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1349 CHECK_ERROR (!r, conn, "virNetworkLookupByName");
1351 rv = Val_network (r, connv);
1356 /* Automatically generated binding for virNetworkLookupByUUID.
1357 * Function signature in generator.pl is "conn, uuid : net"
1361 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1363 CAMLparam2 (connv, uuidv);
1366 virConnectPtr conn = Connect_val (connv);
1367 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1370 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1371 CHECK_ERROR (!r, conn, "virNetworkLookupByUUID");
1373 rv = Val_network (r, connv);
1378 /* Automatically generated binding for virNetworkLookupByUUIDString.
1379 * Function signature in generator.pl is "conn, string : net"
1383 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1385 CAMLparam2 (connv, strv);
1388 virConnectPtr conn = Connect_val (connv);
1389 char *str = String_val (strv);
1392 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1393 CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
1395 rv = Val_network (r, connv);
1400 /* Automatically generated binding for virNetworkGetName.
1401 * Function signature in generator.pl is "net : static string"
1405 ocaml_libvirt_network_get_name (value netv)
1410 virNetworkPtr net = Network_val (netv);
1411 virConnectPtr conn = Connect_netv (netv);
1414 NONBLOCKING (r = virNetworkGetName (net));
1415 CHECK_ERROR (!r, conn, "virNetworkGetName");
1417 rv = caml_copy_string (r);
1421 /* Automatically generated binding for virNetworkGetXMLDesc.
1422 * Function signature in generator.pl is "net, 0 : string"
1426 ocaml_libvirt_network_get_xml_desc (value netv)
1431 virNetworkPtr net = Network_val (netv);
1432 virConnectPtr conn = Connect_netv (netv);
1435 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1436 CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
1438 rv = caml_copy_string (r);
1443 /* Automatically generated binding for virNetworkGetBridgeName.
1444 * Function signature in generator.pl is "net : string"
1448 ocaml_libvirt_network_get_bridge_name (value netv)
1453 virNetworkPtr net = Network_val (netv);
1454 virConnectPtr conn = Connect_netv (netv);
1457 NONBLOCKING (r = virNetworkGetBridgeName (net));
1458 CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
1460 rv = caml_copy_string (r);
1465 /* Automatically generated binding for virNetworkGetUUID.
1466 * Function signature in generator.pl is "net : uuid"
1470 ocaml_libvirt_network_get_uuid (value netv)
1475 virNetworkPtr net = Network_val (netv);
1476 virConnectPtr conn = Connect_netv (netv);
1477 unsigned char uuid[VIR_UUID_BUFLEN];
1480 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1481 CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
1483 rv = caml_copy_string ((char *) uuid);
1487 /* Automatically generated binding for virNetworkGetUUIDString.
1488 * Function signature in generator.pl is "net : uuid string"
1492 ocaml_libvirt_network_get_uuid_string (value netv)
1497 virNetworkPtr net = Network_val (netv);
1498 virConnectPtr conn = Connect_netv (netv);
1499 char uuid[VIR_UUID_STRING_BUFLEN];
1502 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1503 CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
1505 rv = caml_copy_string (uuid);
1509 /* Automatically generated binding for virNetworkUndefine.
1510 * Function signature in generator.pl is "net : unit"
1514 ocaml_libvirt_network_undefine (value netv)
1518 virNetworkPtr net = Network_val (netv);
1519 virConnectPtr conn = Connect_netv (netv);
1522 NONBLOCKING (r = virNetworkUndefine (net));
1523 CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
1525 CAMLreturn (Val_unit);
1528 /* Automatically generated binding for virNetworkCreateXML.
1529 * Function signature in generator.pl is "conn, string : net"
1533 ocaml_libvirt_network_create_xml (value connv, value strv)
1535 CAMLparam2 (connv, strv);
1538 virConnectPtr conn = Connect_val (connv);
1539 char *str = String_val (strv);
1542 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1543 CHECK_ERROR (!r, conn, "virNetworkCreateXML");
1545 rv = Val_network (r, connv);
1550 /* Automatically generated binding for virNetworkCreateXMLJob.
1551 * Function signature in generator.pl is "conn, string : job"
1554 #ifdef HAVE_WEAK_SYMBOLS
1555 #ifdef HAVE_VIRNETWORKCREATEXMLJOB
1556 extern virJobPtr virNetworkCreateXMLJob (virConnectPtr conn, const char *str) __attribute__((weak));
1561 ocaml_libvirt_network_create_xml_job (value connv, value strv)
1563 CAMLparam2 (connv, strv);
1564 #ifndef HAVE_VIRNETWORKCREATEXMLJOB
1565 /* Symbol virNetworkCreateXMLJob not found at compile time. */
1566 not_supported ("virNetworkCreateXMLJob");
1567 /* Suppresses a compiler warning. */
1570 /* Check that the symbol virNetworkCreateXMLJob
1571 * is in runtime version of libvirt.
1573 WEAK_SYMBOL_CHECK (virNetworkCreateXMLJob);
1576 virConnectPtr conn = Connect_val (connv);
1577 char *str = String_val (strv);
1580 NONBLOCKING (r = virNetworkCreateXMLJob (conn, str));
1581 CHECK_ERROR (!r, conn, "virNetworkCreateXMLJob");
1583 rv = Val_job (r, connv);
1589 /* Automatically generated binding for virNetworkDefineXML.
1590 * Function signature in generator.pl is "conn, string : net"
1594 ocaml_libvirt_network_define_xml (value connv, value strv)
1596 CAMLparam2 (connv, strv);
1599 virConnectPtr conn = Connect_val (connv);
1600 char *str = String_val (strv);
1603 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1604 CHECK_ERROR (!r, conn, "virNetworkDefineXML");
1606 rv = Val_network (r, connv);
1611 /* Automatically generated binding for virNetworkCreate.
1612 * Function signature in generator.pl is "net : unit"
1616 ocaml_libvirt_network_create (value netv)
1620 virNetworkPtr net = Network_val (netv);
1621 virConnectPtr conn = Connect_netv (netv);
1624 NONBLOCKING (r = virNetworkCreate (net));
1625 CHECK_ERROR (r == -1, conn, "virNetworkCreate");
1627 CAMLreturn (Val_unit);
1630 /* Automatically generated binding for virNetworkCreateJob.
1631 * Function signature in generator.pl is "net : job from net"
1634 #ifdef HAVE_WEAK_SYMBOLS
1635 #ifdef HAVE_VIRNETWORKCREATEJOB
1636 extern virJobPtr virNetworkCreateJob (virNetworkPtr net) __attribute__((weak));
1641 ocaml_libvirt_network_create_job (value netv)
1644 #ifndef HAVE_VIRNETWORKCREATEJOB
1645 /* Symbol virNetworkCreateJob not found at compile time. */
1646 not_supported ("virNetworkCreateJob");
1647 /* Suppresses a compiler warning. */
1650 /* Check that the symbol virNetworkCreateJob
1651 * is in runtime version of libvirt.
1653 WEAK_SYMBOL_CHECK (virNetworkCreateJob);
1655 CAMLlocal2 (rv, connv);
1656 virNetworkPtr net = Network_val (netv);
1657 virConnectPtr conn = Connect_netv (netv);
1660 NONBLOCKING (r = virNetworkCreateJob (net));
1661 CHECK_ERROR (!r, conn, "virNetworkCreateJob");
1663 connv = Field (netv, 1);
1664 rv = Val_job (r, connv);
1670 /* Automatically generated binding for virNetworkGetAutostart.
1671 * Function signature in generator.pl is "net : bool"
1675 ocaml_libvirt_network_get_autostart (value netv)
1679 virNetworkPtr net = Network_val (netv);
1680 virConnectPtr conn = Connect_netv (netv);
1683 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1684 CHECK_ERROR (r == -1, conn, "virNetworkGetAutostart");
1686 CAMLreturn (b ? Val_true : Val_false);
1689 /* Automatically generated binding for virNetworkSetAutostart.
1690 * Function signature in generator.pl is "net, bool : unit"
1694 ocaml_libvirt_network_set_autostart (value netv, value bv)
1696 CAMLparam2 (netv, bv);
1698 virNetworkPtr net = Network_val (netv);
1699 virConnectPtr conn = Connect_netv (netv);
1702 b = bv == Val_true ? 1 : 0;
1704 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1705 CHECK_ERROR (r == -1, conn, "virNetworkSetAutostart");
1707 CAMLreturn (Val_unit);
1710 /* Automatically generated binding for virStoragePoolFree.
1711 * Function signature in generator.pl is "pool : free"
1714 #ifdef HAVE_WEAK_SYMBOLS
1715 #ifdef HAVE_VIRSTORAGEPOOLFREE
1716 extern int virStoragePoolFree (virStoragePoolPtr pool) __attribute__((weak));
1721 ocaml_libvirt_storage_pool_free (value poolv)
1724 #ifndef HAVE_VIRSTORAGEPOOLFREE
1725 /* Symbol virStoragePoolFree not found at compile time. */
1726 not_supported ("virStoragePoolFree");
1727 /* Suppresses a compiler warning. */
1730 /* Check that the symbol virStoragePoolFree
1731 * is in runtime version of libvirt.
1733 WEAK_SYMBOL_CHECK (virStoragePoolFree);
1735 virStoragePoolPtr pool = Pool_val (poolv);
1736 virConnectPtr conn = Connect_polv (poolv);
1739 NONBLOCKING (r = virStoragePoolFree (pool));
1740 CHECK_ERROR (r == -1, conn, "virStoragePoolFree");
1742 /* So that we don't double-free in the finalizer: */
1743 Pool_val (poolv) = NULL;
1745 CAMLreturn (Val_unit);
1749 /* Automatically generated binding for virStoragePoolDestroy.
1750 * Function signature in generator.pl is "pool : free"
1753 #ifdef HAVE_WEAK_SYMBOLS
1754 #ifdef HAVE_VIRSTORAGEPOOLDESTROY
1755 extern int virStoragePoolDestroy (virStoragePoolPtr pool) __attribute__((weak));
1760 ocaml_libvirt_storage_pool_destroy (value poolv)
1763 #ifndef HAVE_VIRSTORAGEPOOLDESTROY
1764 /* Symbol virStoragePoolDestroy not found at compile time. */
1765 not_supported ("virStoragePoolDestroy");
1766 /* Suppresses a compiler warning. */
1769 /* Check that the symbol virStoragePoolDestroy
1770 * is in runtime version of libvirt.
1772 WEAK_SYMBOL_CHECK (virStoragePoolDestroy);
1774 virStoragePoolPtr pool = Pool_val (poolv);
1775 virConnectPtr conn = Connect_polv (poolv);
1778 NONBLOCKING (r = virStoragePoolDestroy (pool));
1779 CHECK_ERROR (r == -1, conn, "virStoragePoolDestroy");
1781 /* So that we don't double-free in the finalizer: */
1782 Pool_val (poolv) = NULL;
1784 CAMLreturn (Val_unit);
1788 /* Automatically generated binding for virStoragePoolLookupByName.
1789 * Function signature in generator.pl is "conn, string : pool"
1792 #ifdef HAVE_WEAK_SYMBOLS
1793 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1794 extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, const char *str) __attribute__((weak));
1799 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1801 CAMLparam2 (connv, strv);
1802 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1803 /* Symbol virStoragePoolLookupByName not found at compile time. */
1804 not_supported ("virStoragePoolLookupByName");
1805 /* Suppresses a compiler warning. */
1808 /* Check that the symbol virStoragePoolLookupByName
1809 * is in runtime version of libvirt.
1811 WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
1814 virConnectPtr conn = Connect_val (connv);
1815 char *str = String_val (strv);
1816 virStoragePoolPtr r;
1818 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1819 CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
1821 rv = Val_pool (r, connv);
1827 /* Automatically generated binding for virStoragePoolLookupByUUID.
1828 * Function signature in generator.pl is "conn, uuid : pool"
1831 #ifdef HAVE_WEAK_SYMBOLS
1832 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1833 extern virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, const unsigned char *str) __attribute__((weak));
1838 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1840 CAMLparam2 (connv, uuidv);
1841 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1842 /* Symbol virStoragePoolLookupByUUID not found at compile time. */
1843 not_supported ("virStoragePoolLookupByUUID");
1844 /* Suppresses a compiler warning. */
1847 /* Check that the symbol virStoragePoolLookupByUUID
1848 * is in runtime version of libvirt.
1850 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUID);
1853 virConnectPtr conn = Connect_val (connv);
1854 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1855 virStoragePoolPtr r;
1857 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1858 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUID");
1860 rv = Val_pool (r, connv);
1866 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1867 * Function signature in generator.pl is "conn, string : pool"
1870 #ifdef HAVE_WEAK_SYMBOLS
1871 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1872 extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn, const char *str) __attribute__((weak));
1877 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1879 CAMLparam2 (connv, strv);
1880 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1881 /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
1882 not_supported ("virStoragePoolLookupByUUIDString");
1883 /* Suppresses a compiler warning. */
1886 /* Check that the symbol virStoragePoolLookupByUUIDString
1887 * is in runtime version of libvirt.
1889 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
1892 virConnectPtr conn = Connect_val (connv);
1893 char *str = String_val (strv);
1894 virStoragePoolPtr r;
1896 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1897 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
1899 rv = Val_pool (r, connv);
1905 /* Automatically generated binding for virStoragePoolGetName.
1906 * Function signature in generator.pl is "pool : static string"
1909 #ifdef HAVE_WEAK_SYMBOLS
1910 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
1911 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
1916 ocaml_libvirt_storage_pool_get_name (value poolv)
1919 #ifndef HAVE_VIRSTORAGEPOOLGETNAME
1920 /* Symbol virStoragePoolGetName not found at compile time. */
1921 not_supported ("virStoragePoolGetName");
1922 /* Suppresses a compiler warning. */
1925 /* Check that the symbol virStoragePoolGetName
1926 * is in runtime version of libvirt.
1928 WEAK_SYMBOL_CHECK (virStoragePoolGetName);
1931 virStoragePoolPtr pool = Pool_val (poolv);
1932 virConnectPtr conn = Connect_polv (poolv);
1935 NONBLOCKING (r = virStoragePoolGetName (pool));
1936 CHECK_ERROR (!r, conn, "virStoragePoolGetName");
1938 rv = caml_copy_string (r);
1943 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1944 * Function signature in generator.pl is "pool, 0 : string"
1947 #ifdef HAVE_WEAK_SYMBOLS
1948 #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC
1949 extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
1954 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1957 #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC
1958 /* Symbol virStoragePoolGetXMLDesc not found at compile time. */
1959 not_supported ("virStoragePoolGetXMLDesc");
1960 /* Suppresses a compiler warning. */
1963 /* Check that the symbol virStoragePoolGetXMLDesc
1964 * is in runtime version of libvirt.
1966 WEAK_SYMBOL_CHECK (virStoragePoolGetXMLDesc);
1969 virStoragePoolPtr pool = Pool_val (poolv);
1970 virConnectPtr conn = Connect_polv (poolv);
1973 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1974 CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
1976 rv = caml_copy_string (r);
1982 /* Automatically generated binding for virStoragePoolGetUUID.
1983 * Function signature in generator.pl is "pool : uuid"
1986 #ifdef HAVE_WEAK_SYMBOLS
1987 #ifdef HAVE_VIRSTORAGEPOOLGETUUID
1988 extern int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *) __attribute__((weak));
1993 ocaml_libvirt_storage_pool_get_uuid (value poolv)
1996 #ifndef HAVE_VIRSTORAGEPOOLGETUUID
1997 /* Symbol virStoragePoolGetUUID not found at compile time. */
1998 not_supported ("virStoragePoolGetUUID");
1999 /* Suppresses a compiler warning. */
2002 /* Check that the symbol virStoragePoolGetUUID
2003 * is in runtime version of libvirt.
2005 WEAK_SYMBOL_CHECK (virStoragePoolGetUUID);
2008 virStoragePoolPtr pool = Pool_val (poolv);
2009 virConnectPtr conn = Connect_polv (poolv);
2010 unsigned char uuid[VIR_UUID_BUFLEN];
2013 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
2014 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
2016 rv = caml_copy_string ((char *) uuid);
2021 /* Automatically generated binding for virStoragePoolGetUUIDString.
2022 * Function signature in generator.pl is "pool : uuid string"
2025 #ifdef HAVE_WEAK_SYMBOLS
2026 #ifdef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2027 extern int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *) __attribute__((weak));
2032 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
2035 #ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2036 /* Symbol virStoragePoolGetUUIDString not found at compile time. */
2037 not_supported ("virStoragePoolGetUUIDString");
2038 /* Suppresses a compiler warning. */
2041 /* Check that the symbol virStoragePoolGetUUIDString
2042 * is in runtime version of libvirt.
2044 WEAK_SYMBOL_CHECK (virStoragePoolGetUUIDString);
2047 virStoragePoolPtr pool = Pool_val (poolv);
2048 virConnectPtr conn = Connect_polv (poolv);
2049 char uuid[VIR_UUID_STRING_BUFLEN];
2052 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
2053 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
2055 rv = caml_copy_string (uuid);
2060 /* Automatically generated binding for virStoragePoolCreateXML.
2061 * Function signature in generator.pl is "conn, string : pool"
2064 #ifdef HAVE_WEAK_SYMBOLS
2065 #ifdef HAVE_VIRSTORAGEPOOLCREATEXML
2066 extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str) __attribute__((weak));
2071 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
2073 CAMLparam2 (connv, strv);
2074 #ifndef HAVE_VIRSTORAGEPOOLCREATEXML
2075 /* Symbol virStoragePoolCreateXML not found at compile time. */
2076 not_supported ("virStoragePoolCreateXML");
2077 /* Suppresses a compiler warning. */
2080 /* Check that the symbol virStoragePoolCreateXML
2081 * is in runtime version of libvirt.
2083 WEAK_SYMBOL_CHECK (virStoragePoolCreateXML);
2086 virConnectPtr conn = Connect_val (connv);
2087 char *str = String_val (strv);
2088 virStoragePoolPtr r;
2090 NONBLOCKING (r = virStoragePoolCreateXML (conn, str));
2091 CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
2093 rv = Val_pool (r, connv);
2099 /* Automatically generated binding for virStoragePoolDefineXML.
2100 * Function signature in generator.pl is "conn, string : pool"
2103 #ifdef HAVE_WEAK_SYMBOLS
2104 #ifdef HAVE_VIRSTORAGEPOOLDEFINEXML
2105 extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str) __attribute__((weak));
2110 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
2112 CAMLparam2 (connv, strv);
2113 #ifndef HAVE_VIRSTORAGEPOOLDEFINEXML
2114 /* Symbol virStoragePoolDefineXML not found at compile time. */
2115 not_supported ("virStoragePoolDefineXML");
2116 /* Suppresses a compiler warning. */
2119 /* Check that the symbol virStoragePoolDefineXML
2120 * is in runtime version of libvirt.
2122 WEAK_SYMBOL_CHECK (virStoragePoolDefineXML);
2125 virConnectPtr conn = Connect_val (connv);
2126 char *str = String_val (strv);
2127 virStoragePoolPtr r;
2129 NONBLOCKING (r = virStoragePoolDefineXML (conn, str));
2130 CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
2132 rv = Val_pool (r, connv);
2138 /* Automatically generated binding for virStoragePoolUndefine.
2139 * Function signature in generator.pl is "pool : unit"
2142 #ifdef HAVE_WEAK_SYMBOLS
2143 #ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
2144 extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
2149 ocaml_libvirt_storage_pool_undefine (value poolv)
2152 #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
2153 /* Symbol virStoragePoolUndefine not found at compile time. */
2154 not_supported ("virStoragePoolUndefine");
2155 /* Suppresses a compiler warning. */
2158 /* Check that the symbol virStoragePoolUndefine
2159 * is in runtime version of libvirt.
2161 WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
2163 virStoragePoolPtr pool = Pool_val (poolv);
2164 virConnectPtr conn = Connect_polv (poolv);
2167 NONBLOCKING (r = virStoragePoolUndefine (pool));
2168 CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
2170 CAMLreturn (Val_unit);
2174 /* Automatically generated binding for virStoragePoolCreate.
2175 * Function signature in generator.pl is "pool : unit"
2178 #ifdef HAVE_WEAK_SYMBOLS
2179 #ifdef HAVE_VIRSTORAGEPOOLCREATE
2180 extern int virStoragePoolCreate (virStoragePoolPtr pool) __attribute__((weak));
2185 ocaml_libvirt_storage_pool_create (value poolv)
2188 #ifndef HAVE_VIRSTORAGEPOOLCREATE
2189 /* Symbol virStoragePoolCreate not found at compile time. */
2190 not_supported ("virStoragePoolCreate");
2191 /* Suppresses a compiler warning. */
2194 /* Check that the symbol virStoragePoolCreate
2195 * is in runtime version of libvirt.
2197 WEAK_SYMBOL_CHECK (virStoragePoolCreate);
2199 virStoragePoolPtr pool = Pool_val (poolv);
2200 virConnectPtr conn = Connect_polv (poolv);
2203 NONBLOCKING (r = virStoragePoolCreate (pool));
2204 CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
2206 CAMLreturn (Val_unit);
2210 /* Automatically generated binding for virStoragePoolShutdown.
2211 * Function signature in generator.pl is "pool : unit"
2214 #ifdef HAVE_WEAK_SYMBOLS
2215 #ifdef HAVE_VIRSTORAGEPOOLSHUTDOWN
2216 extern int virStoragePoolShutdown (virStoragePoolPtr pool) __attribute__((weak));
2221 ocaml_libvirt_storage_pool_shutdown (value poolv)
2224 #ifndef HAVE_VIRSTORAGEPOOLSHUTDOWN
2225 /* Symbol virStoragePoolShutdown not found at compile time. */
2226 not_supported ("virStoragePoolShutdown");
2227 /* Suppresses a compiler warning. */
2230 /* Check that the symbol virStoragePoolShutdown
2231 * is in runtime version of libvirt.
2233 WEAK_SYMBOL_CHECK (virStoragePoolShutdown);
2235 virStoragePoolPtr pool = Pool_val (poolv);
2236 virConnectPtr conn = Connect_polv (poolv);
2239 NONBLOCKING (r = virStoragePoolShutdown (pool));
2240 CHECK_ERROR (r == -1, conn, "virStoragePoolShutdown");
2242 CAMLreturn (Val_unit);
2246 /* Automatically generated binding for virStoragePoolRefresh.
2247 * Function signature in generator.pl is "pool, 0U : unit"
2250 #ifdef HAVE_WEAK_SYMBOLS
2251 #ifdef HAVE_VIRSTORAGEPOOLREFRESH
2252 extern int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
2257 ocaml_libvirt_storage_pool_refresh (value poolv)
2260 #ifndef HAVE_VIRSTORAGEPOOLREFRESH
2261 /* Symbol virStoragePoolRefresh not found at compile time. */
2262 not_supported ("virStoragePoolRefresh");
2263 /* Suppresses a compiler warning. */
2266 /* Check that the symbol virStoragePoolRefresh
2267 * is in runtime version of libvirt.
2269 WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
2271 virStoragePoolPtr pool = Pool_val (poolv);
2272 virConnectPtr conn = Connect_polv (poolv);
2275 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
2276 CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
2278 CAMLreturn (Val_unit);
2282 /* Automatically generated binding for virStoragePoolGetAutostart.
2283 * Function signature in generator.pl is "pool : bool"
2286 #ifdef HAVE_WEAK_SYMBOLS
2287 #ifdef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2288 extern int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *r) __attribute__((weak));
2293 ocaml_libvirt_storage_pool_get_autostart (value poolv)
2296 #ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2297 /* Symbol virStoragePoolGetAutostart not found at compile time. */
2298 not_supported ("virStoragePoolGetAutostart");
2299 /* Suppresses a compiler warning. */
2302 /* Check that the symbol virStoragePoolGetAutostart
2303 * is in runtime version of libvirt.
2305 WEAK_SYMBOL_CHECK (virStoragePoolGetAutostart);
2307 virStoragePoolPtr pool = Pool_val (poolv);
2308 virConnectPtr conn = Connect_polv (poolv);
2311 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
2312 CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
2314 CAMLreturn (b ? Val_true : Val_false);
2318 /* Automatically generated binding for virStoragePoolSetAutostart.
2319 * Function signature in generator.pl is "pool, bool : unit"
2322 #ifdef HAVE_WEAK_SYMBOLS
2323 #ifdef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2324 extern int virStoragePoolSetAutostart (virStoragePoolPtr pool, int b) __attribute__((weak));
2329 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
2331 CAMLparam2 (poolv, bv);
2332 #ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2333 /* Symbol virStoragePoolSetAutostart not found at compile time. */
2334 not_supported ("virStoragePoolSetAutostart");
2335 /* Suppresses a compiler warning. */
2338 /* Check that the symbol virStoragePoolSetAutostart
2339 * is in runtime version of libvirt.
2341 WEAK_SYMBOL_CHECK (virStoragePoolSetAutostart);
2343 virStoragePoolPtr pool = Pool_val (poolv);
2344 virConnectPtr conn = Connect_polv (poolv);
2347 b = bv == Val_true ? 1 : 0;
2349 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
2350 CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
2352 CAMLreturn (Val_unit);
2356 /* Automatically generated binding for virStorageVolFree.
2357 * Function signature in generator.pl is "vol : free"
2360 #ifdef HAVE_WEAK_SYMBOLS
2361 #ifdef HAVE_VIRSTORAGEVOLFREE
2362 extern int virStorageVolFree (virStorageVolPtr vol) __attribute__((weak));
2367 ocaml_libvirt_storage_vol_free (value volv)
2370 #ifndef HAVE_VIRSTORAGEVOLFREE
2371 /* Symbol virStorageVolFree not found at compile time. */
2372 not_supported ("virStorageVolFree");
2373 /* Suppresses a compiler warning. */
2376 /* Check that the symbol virStorageVolFree
2377 * is in runtime version of libvirt.
2379 WEAK_SYMBOL_CHECK (virStorageVolFree);
2381 virStorageVolPtr vol = Volume_val (volv);
2382 virConnectPtr conn = Connect_volv (volv);
2385 NONBLOCKING (r = virStorageVolFree (vol));
2386 CHECK_ERROR (r == -1, conn, "virStorageVolFree");
2388 /* So that we don't double-free in the finalizer: */
2389 Volume_val (volv) = NULL;
2391 CAMLreturn (Val_unit);
2395 /* Automatically generated binding for virStorageVolDestroy.
2396 * Function signature in generator.pl is "vol : free"
2399 #ifdef HAVE_WEAK_SYMBOLS
2400 #ifdef HAVE_VIRSTORAGEVOLDESTROY
2401 extern int virStorageVolDestroy (virStorageVolPtr vol) __attribute__((weak));
2406 ocaml_libvirt_storage_vol_destroy (value volv)
2409 #ifndef HAVE_VIRSTORAGEVOLDESTROY
2410 /* Symbol virStorageVolDestroy not found at compile time. */
2411 not_supported ("virStorageVolDestroy");
2412 /* Suppresses a compiler warning. */
2415 /* Check that the symbol virStorageVolDestroy
2416 * is in runtime version of libvirt.
2418 WEAK_SYMBOL_CHECK (virStorageVolDestroy);
2420 virStorageVolPtr vol = Volume_val (volv);
2421 virConnectPtr conn = Connect_volv (volv);
2424 NONBLOCKING (r = virStorageVolDestroy (vol));
2425 CHECK_ERROR (r == -1, conn, "virStorageVolDestroy");
2427 /* So that we don't double-free in the finalizer: */
2428 Volume_val (volv) = NULL;
2430 CAMLreturn (Val_unit);
2434 /* Automatically generated binding for virStorageVolLookupByKey.
2435 * Function signature in generator.pl is "conn, string : vol"
2438 #ifdef HAVE_WEAK_SYMBOLS
2439 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2440 extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *str) __attribute__((weak));
2445 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
2447 CAMLparam2 (connv, strv);
2448 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2449 /* Symbol virStorageVolLookupByKey not found at compile time. */
2450 not_supported ("virStorageVolLookupByKey");
2451 /* Suppresses a compiler warning. */
2454 /* Check that the symbol virStorageVolLookupByKey
2455 * is in runtime version of libvirt.
2457 WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
2460 virConnectPtr conn = Connect_val (connv);
2461 char *str = String_val (strv);
2464 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
2465 CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
2467 rv = Val_volume (r, connv);
2473 /* Automatically generated binding for virStorageVolLookupByPath.
2474 * Function signature in generator.pl is "conn, string : vol"
2477 #ifdef HAVE_WEAK_SYMBOLS
2478 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2479 extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *str) __attribute__((weak));
2484 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
2486 CAMLparam2 (connv, strv);
2487 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2488 /* Symbol virStorageVolLookupByPath not found at compile time. */
2489 not_supported ("virStorageVolLookupByPath");
2490 /* Suppresses a compiler warning. */
2493 /* Check that the symbol virStorageVolLookupByPath
2494 * is in runtime version of libvirt.
2496 WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
2499 virConnectPtr conn = Connect_val (connv);
2500 char *str = String_val (strv);
2503 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
2504 CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
2506 rv = Val_volume (r, connv);
2512 /* Automatically generated binding for virStorageVolGetXMLDesc.
2513 * Function signature in generator.pl is "vol, 0 : string"
2516 #ifdef HAVE_WEAK_SYMBOLS
2517 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
2518 extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, int flags) __attribute__((weak));
2523 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
2526 #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
2527 /* Symbol virStorageVolGetXMLDesc not found at compile time. */
2528 not_supported ("virStorageVolGetXMLDesc");
2529 /* Suppresses a compiler warning. */
2532 /* Check that the symbol virStorageVolGetXMLDesc
2533 * is in runtime version of libvirt.
2535 WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
2538 virStorageVolPtr vol = Volume_val (volv);
2539 virConnectPtr conn = Connect_volv (volv);
2542 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
2543 CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
2545 rv = caml_copy_string (r);
2551 /* Automatically generated binding for virStorageVolGetPath.
2552 * Function signature in generator.pl is "vol : string"
2555 #ifdef HAVE_WEAK_SYMBOLS
2556 #ifdef HAVE_VIRSTORAGEVOLGETPATH
2557 extern char *virStorageVolGetPath (virStorageVolPtr vol) __attribute__((weak));
2562 ocaml_libvirt_storage_vol_get_path (value volv)
2565 #ifndef HAVE_VIRSTORAGEVOLGETPATH
2566 /* Symbol virStorageVolGetPath not found at compile time. */
2567 not_supported ("virStorageVolGetPath");
2568 /* Suppresses a compiler warning. */
2571 /* Check that the symbol virStorageVolGetPath
2572 * is in runtime version of libvirt.
2574 WEAK_SYMBOL_CHECK (virStorageVolGetPath);
2577 virStorageVolPtr vol = Volume_val (volv);
2578 virConnectPtr conn = Connect_volv (volv);
2581 NONBLOCKING (r = virStorageVolGetPath (vol));
2582 CHECK_ERROR (!r, conn, "virStorageVolGetPath");
2584 rv = caml_copy_string (r);
2590 /* Automatically generated binding for virStorageVolGetKey.
2591 * Function signature in generator.pl is "vol : static string"
2594 #ifdef HAVE_WEAK_SYMBOLS
2595 #ifdef HAVE_VIRSTORAGEVOLGETKEY
2596 extern const char *virStorageVolGetKey (virStorageVolPtr vol) __attribute__((weak));
2601 ocaml_libvirt_storage_vol_get_key (value volv)
2604 #ifndef HAVE_VIRSTORAGEVOLGETKEY
2605 /* Symbol virStorageVolGetKey not found at compile time. */
2606 not_supported ("virStorageVolGetKey");
2607 /* Suppresses a compiler warning. */
2610 /* Check that the symbol virStorageVolGetKey
2611 * is in runtime version of libvirt.
2613 WEAK_SYMBOL_CHECK (virStorageVolGetKey);
2616 virStorageVolPtr vol = Volume_val (volv);
2617 virConnectPtr conn = Connect_volv (volv);
2620 NONBLOCKING (r = virStorageVolGetKey (vol));
2621 CHECK_ERROR (!r, conn, "virStorageVolGetKey");
2623 rv = caml_copy_string (r);
2628 /* Automatically generated binding for virStorageVolGetName.
2629 * Function signature in generator.pl is "vol : static string"
2632 #ifdef HAVE_WEAK_SYMBOLS
2633 #ifdef HAVE_VIRSTORAGEVOLGETNAME
2634 extern const char *virStorageVolGetName (virStorageVolPtr vol) __attribute__((weak));
2639 ocaml_libvirt_storage_vol_get_name (value volv)
2642 #ifndef HAVE_VIRSTORAGEVOLGETNAME
2643 /* Symbol virStorageVolGetName not found at compile time. */
2644 not_supported ("virStorageVolGetName");
2645 /* Suppresses a compiler warning. */
2648 /* Check that the symbol virStorageVolGetName
2649 * is in runtime version of libvirt.
2651 WEAK_SYMBOL_CHECK (virStorageVolGetName);
2654 virStorageVolPtr vol = Volume_val (volv);
2655 virConnectPtr conn = Connect_volv (volv);
2658 NONBLOCKING (r = virStorageVolGetName (vol));
2659 CHECK_ERROR (!r, conn, "virStorageVolGetName");
2661 rv = caml_copy_string (r);
2666 /* Automatically generated binding for virStoragePoolLookupByVolume.
2667 * Function signature in generator.pl is "vol : pool from vol"
2670 #ifdef HAVE_WEAK_SYMBOLS
2671 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2672 extern virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol) __attribute__((weak));
2677 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2680 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2681 /* Symbol virStoragePoolLookupByVolume not found at compile time. */
2682 not_supported ("virStoragePoolLookupByVolume");
2683 /* Suppresses a compiler warning. */
2686 /* Check that the symbol virStoragePoolLookupByVolume
2687 * is in runtime version of libvirt.
2689 WEAK_SYMBOL_CHECK (virStoragePoolLookupByVolume);
2691 CAMLlocal2 (rv, connv);
2692 virStorageVolPtr vol = Volume_val (volv);
2693 virConnectPtr conn = Connect_volv (volv);
2694 virStoragePoolPtr r;
2696 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2697 CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
2699 connv = Field (volv, 1);
2700 rv = Val_pool (r, connv);
2706 /* Automatically generated binding for virJobFree.
2707 * Function signature in generator.pl is "job : free"
2710 #ifdef HAVE_WEAK_SYMBOLS
2711 #ifdef HAVE_VIRJOBFREE
2712 extern int virJobFree (virJobPtr job) __attribute__((weak));
2717 ocaml_libvirt_job_free (value jobv)
2720 #ifndef HAVE_VIRJOBFREE
2721 /* Symbol virJobFree not found at compile time. */
2722 not_supported ("virJobFree");
2723 /* Suppresses a compiler warning. */
2726 /* Check that the symbol virJobFree
2727 * is in runtime version of libvirt.
2729 WEAK_SYMBOL_CHECK (virJobFree);
2731 virJobPtr job = Job_val (jobv);
2732 virConnectPtr conn = Connect_jobv (jobv);
2735 NONBLOCKING (r = virJobFree (job));
2736 CHECK_ERROR (r == -1, conn, "virJobFree");
2738 /* So that we don't double-free in the finalizer: */
2739 Job_val (jobv) = NULL;
2741 CAMLreturn (Val_unit);
2745 /* Automatically generated binding for virJobCancel.
2746 * Function signature in generator.pl is "job : unit"
2749 #ifdef HAVE_WEAK_SYMBOLS
2750 #ifdef HAVE_VIRJOBCANCEL
2751 extern int virJobCancel (virJobPtr job) __attribute__((weak));
2756 ocaml_libvirt_job_cancel (value jobv)
2759 #ifndef HAVE_VIRJOBCANCEL
2760 /* Symbol virJobCancel not found at compile time. */
2761 not_supported ("virJobCancel");
2762 /* Suppresses a compiler warning. */
2765 /* Check that the symbol virJobCancel
2766 * is in runtime version of libvirt.
2768 WEAK_SYMBOL_CHECK (virJobCancel);
2770 virJobPtr job = Job_val (jobv);
2771 virConnectPtr conn = Connect_jobv (jobv);
2774 NONBLOCKING (r = virJobCancel (job));
2775 CHECK_ERROR (r == -1, conn, "virJobCancel");
2777 CAMLreturn (Val_unit);
2781 /* Automatically generated binding for virJobGetNetwork.
2782 * Function signature in generator.pl is "job : net from job"
2785 #ifdef HAVE_WEAK_SYMBOLS
2786 #ifdef HAVE_VIRJOBGETNETWORK
2787 extern virNetworkPtr virJobGetNetwork (virJobPtr job) __attribute__((weak));
2792 ocaml_libvirt_job_get_network (value jobv)
2795 #ifndef HAVE_VIRJOBGETNETWORK
2796 /* Symbol virJobGetNetwork not found at compile time. */
2797 not_supported ("virJobGetNetwork");
2798 /* Suppresses a compiler warning. */
2801 /* Check that the symbol virJobGetNetwork
2802 * is in runtime version of libvirt.
2804 WEAK_SYMBOL_CHECK (virJobGetNetwork);
2806 CAMLlocal2 (rv, connv);
2807 virJobPtr job = Job_val (jobv);
2808 virConnectPtr conn = Connect_jobv (jobv);
2811 NONBLOCKING (r = virJobGetNetwork (job));
2812 CHECK_ERROR (!r, conn, "virJobGetNetwork");
2814 connv = Field (jobv, 1);
2815 rv = Val_network (r, connv);
2821 /* Automatically generated binding for virJobGetDomain.
2822 * Function signature in generator.pl is "job : dom from job"
2825 #ifdef HAVE_WEAK_SYMBOLS
2826 #ifdef HAVE_VIRJOBGETDOMAIN
2827 extern virDomainPtr virJobGetDomain (virJobPtr job) __attribute__((weak));
2832 ocaml_libvirt_job_get_domain (value jobv)
2835 #ifndef HAVE_VIRJOBGETDOMAIN
2836 /* Symbol virJobGetDomain not found at compile time. */
2837 not_supported ("virJobGetDomain");
2838 /* Suppresses a compiler warning. */
2841 /* Check that the symbol virJobGetDomain
2842 * is in runtime version of libvirt.
2844 WEAK_SYMBOL_CHECK (virJobGetDomain);
2846 CAMLlocal2 (rv, connv);
2847 virJobPtr job = Job_val (jobv);
2848 virConnectPtr conn = Connect_jobv (jobv);
2851 NONBLOCKING (r = virJobGetDomain (job));
2852 CHECK_ERROR (!r, conn, "virJobGetDomain");
2854 connv = Field (jobv, 1);
2855 rv = Val_domain (r, connv);
2861 /* The following functions are unimplemented and always fail.
2862 * See generator.pl '@unimplemented'
2866 ocaml_libvirt_storage_vol_lookup_by_name ()
2868 failwith ("ocaml_libvirt_storage_vol_lookup_by_name is unimplemented");
2872 ocaml_libvirt_storage_vol_create_xml ()
2874 failwith ("ocaml_libvirt_storage_vol_create_xml is unimplemented");
2877 #include "libvirt_c_epilogue.c"