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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 * In generator.pl this function has signature "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 /* UUIDs are byte arrays with a fixed length. */
805 rv = caml_alloc_string (VIR_UUID_BUFLEN);
806 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
810 /* Automatically generated binding for virDomainGetUUIDString.
811 * In generator.pl this function has signature "dom : uuid string".
815 ocaml_libvirt_domain_get_uuid_string (value domv)
820 virDomainPtr dom = Domain_val (domv);
821 virConnectPtr conn = Connect_domv (domv);
822 char uuid[VIR_UUID_STRING_BUFLEN];
825 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
826 CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
828 rv = caml_copy_string (uuid);
832 /* Automatically generated binding for virDomainGetMaxVcpus.
833 * In generator.pl this function has signature "dom : int".
837 ocaml_libvirt_domain_get_max_vcpus (value domv)
841 virDomainPtr dom = Domain_val (domv);
842 virConnectPtr conn = Connect_domv (domv);
845 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
846 CHECK_ERROR (r == -1, conn, "virDomainGetMaxVcpus");
848 CAMLreturn (Val_int (r));
851 /* Automatically generated binding for virDomainSave.
852 * In generator.pl this function has signature "dom, string : unit".
856 ocaml_libvirt_domain_save (value domv, value strv)
858 CAMLparam2 (domv, strv);
861 virDomainPtr dom = Domain_val (domv);
862 virConnectPtr conn = Connect_domv (domv);
863 char *str = String_val (strv);
866 NONBLOCKING (r = virDomainSave (dom, str));
867 CHECK_ERROR (r == -1, conn, "virDomainSave");
869 CAMLreturn (Val_unit);
872 /* Automatically generated binding for virDomainSaveJob.
873 * In generator.pl this function has signature "dom, string : job from dom".
876 #ifdef HAVE_WEAK_SYMBOLS
877 #ifdef HAVE_VIRDOMAINSAVEJOB
878 extern virJobPtr virDomainSaveJob (virDomainPtr dom, const char *str) __attribute__((weak));
883 ocaml_libvirt_domain_save_job (value domv, value strv)
885 CAMLparam2 (domv, strv);
886 #ifndef HAVE_VIRDOMAINSAVEJOB
887 /* Symbol virDomainSaveJob not found at compile time. */
888 not_supported ("virDomainSaveJob");
889 /* Suppresses a compiler warning. */
892 /* Check that the symbol virDomainSaveJob
893 * is in runtime version of libvirt.
895 WEAK_SYMBOL_CHECK (virDomainSaveJob);
897 CAMLlocal2 (rv, connv);
898 virDomainPtr dom = Domain_val (domv);
899 virConnectPtr conn = Connect_domv (domv);
900 char *str = String_val (strv);
903 NONBLOCKING (r = virDomainSaveJob (dom, str));
904 CHECK_ERROR (!r, conn, "virDomainSaveJob");
906 connv = Field (domv, 1);
907 rv = Val_job (r, connv);
913 /* Automatically generated binding for virDomainRestore.
914 * In generator.pl this function has signature "conn, string : unit".
918 ocaml_libvirt_domain_restore (value connv, value strv)
920 CAMLparam2 (connv, strv);
923 virConnectPtr conn = Connect_val (connv);
924 char *str = String_val (strv);
927 NONBLOCKING (r = virDomainRestore (conn, str));
928 CHECK_ERROR (r == -1, conn, "virDomainRestore");
930 CAMLreturn (Val_unit);
933 /* Automatically generated binding for virDomainRestoreJob.
934 * In generator.pl this function has signature "conn, string : job".
937 #ifdef HAVE_WEAK_SYMBOLS
938 #ifdef HAVE_VIRDOMAINRESTOREJOB
939 extern virJobPtr virDomainRestoreJob (virConnectPtr conn, const char *str) __attribute__((weak));
944 ocaml_libvirt_domain_restore_job (value connv, value strv)
946 CAMLparam2 (connv, strv);
947 #ifndef HAVE_VIRDOMAINRESTOREJOB
948 /* Symbol virDomainRestoreJob not found at compile time. */
949 not_supported ("virDomainRestoreJob");
950 /* Suppresses a compiler warning. */
953 /* Check that the symbol virDomainRestoreJob
954 * is in runtime version of libvirt.
956 WEAK_SYMBOL_CHECK (virDomainRestoreJob);
959 virConnectPtr conn = Connect_val (connv);
960 char *str = String_val (strv);
963 NONBLOCKING (r = virDomainRestoreJob (conn, str));
964 CHECK_ERROR (!r, conn, "virDomainRestoreJob");
966 rv = Val_job (r, connv);
972 /* Automatically generated binding for virDomainCoreDump.
973 * In generator.pl this function has signature "dom, string, 0 : unit".
977 ocaml_libvirt_domain_core_dump (value domv, value strv)
979 CAMLparam2 (domv, strv);
982 virDomainPtr dom = Domain_val (domv);
983 virConnectPtr conn = Connect_domv (domv);
984 char *str = String_val (strv);
987 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
988 CHECK_ERROR (!r, conn, "virDomainCoreDump");
990 CAMLreturn (Val_unit);
993 /* Automatically generated binding for virDomainCoreDumpJob.
994 * In generator.pl this function has signature "dom, string, 0 : job from dom".
997 #ifdef HAVE_WEAK_SYMBOLS
998 #ifdef HAVE_VIRDOMAINCOREDUMPJOB
999 extern virJobPtr virDomainCoreDumpJob (virDomainPtr dom, const char *str, int flags) __attribute__((weak));
1004 ocaml_libvirt_domain_core_dump_job (value domv, value strv)
1006 CAMLparam2 (domv, strv);
1007 #ifndef HAVE_VIRDOMAINCOREDUMPJOB
1008 /* Symbol virDomainCoreDumpJob not found at compile time. */
1009 not_supported ("virDomainCoreDumpJob");
1010 /* Suppresses a compiler warning. */
1013 /* Check that the symbol virDomainCoreDumpJob
1014 * is in runtime version of libvirt.
1016 WEAK_SYMBOL_CHECK (virDomainCoreDumpJob);
1018 CAMLlocal2 (rv, connv);
1019 virDomainPtr dom = Domain_val (domv);
1020 virConnectPtr conn = Connect_domv (domv);
1021 char *str = String_val (strv);
1024 NONBLOCKING (r = virDomainCoreDumpJob (dom, str, 0));
1025 CHECK_ERROR (!r, conn, "virDomainCoreDumpJob");
1027 connv = Field (domv, 1);
1028 rv = Val_job (r, connv);
1034 /* Automatically generated binding for virDomainSuspend.
1035 * In generator.pl this function has signature "dom : unit".
1039 ocaml_libvirt_domain_suspend (value domv)
1043 virDomainPtr dom = Domain_val (domv);
1044 virConnectPtr conn = Connect_domv (domv);
1047 NONBLOCKING (r = virDomainSuspend (dom));
1048 CHECK_ERROR (r == -1, conn, "virDomainSuspend");
1050 CAMLreturn (Val_unit);
1053 /* Automatically generated binding for virDomainResume.
1054 * In generator.pl this function has signature "dom : unit".
1058 ocaml_libvirt_domain_resume (value domv)
1062 virDomainPtr dom = Domain_val (domv);
1063 virConnectPtr conn = Connect_domv (domv);
1066 NONBLOCKING (r = virDomainResume (dom));
1067 CHECK_ERROR (r == -1, conn, "virDomainResume");
1069 CAMLreturn (Val_unit);
1072 /* Automatically generated binding for virDomainShutdown.
1073 * In generator.pl this function has signature "dom : unit".
1077 ocaml_libvirt_domain_shutdown (value domv)
1081 virDomainPtr dom = Domain_val (domv);
1082 virConnectPtr conn = Connect_domv (domv);
1085 NONBLOCKING (r = virDomainShutdown (dom));
1086 CHECK_ERROR (r == -1, conn, "virDomainShutdown");
1088 CAMLreturn (Val_unit);
1091 /* Automatically generated binding for virDomainReboot.
1092 * In generator.pl this function has signature "dom, 0 : unit".
1096 ocaml_libvirt_domain_reboot (value domv)
1100 virDomainPtr dom = Domain_val (domv);
1101 virConnectPtr conn = Connect_domv (domv);
1104 NONBLOCKING (r = virDomainReboot (dom, 0));
1105 CHECK_ERROR (r == -1, conn, "virDomainReboot");
1107 CAMLreturn (Val_unit);
1110 /* Automatically generated binding for virDomainDefineXML.
1111 * In generator.pl this function has signature "conn, string : dom".
1115 ocaml_libvirt_domain_define_xml (value connv, value strv)
1117 CAMLparam2 (connv, strv);
1120 virConnectPtr conn = Connect_val (connv);
1121 char *str = String_val (strv);
1124 NONBLOCKING (r = virDomainDefineXML (conn, str));
1125 CHECK_ERROR (!r, conn, "virDomainDefineXML");
1127 rv = Val_domain (r, connv);
1132 /* Automatically generated binding for virDomainUndefine.
1133 * In generator.pl this function has signature "dom : unit".
1137 ocaml_libvirt_domain_undefine (value domv)
1141 virDomainPtr dom = Domain_val (domv);
1142 virConnectPtr conn = Connect_domv (domv);
1145 NONBLOCKING (r = virDomainUndefine (dom));
1146 CHECK_ERROR (r == -1, conn, "virDomainUndefine");
1148 CAMLreturn (Val_unit);
1151 /* Automatically generated binding for virDomainCreate.
1152 * In generator.pl this function has signature "dom : unit".
1156 ocaml_libvirt_domain_create (value domv)
1160 virDomainPtr dom = Domain_val (domv);
1161 virConnectPtr conn = Connect_domv (domv);
1164 NONBLOCKING (r = virDomainCreate (dom));
1165 CHECK_ERROR (r == -1, conn, "virDomainCreate");
1167 CAMLreturn (Val_unit);
1170 /* Automatically generated binding for virDomainCreateJob.
1171 * In generator.pl this function has signature "dom, 0U : job from dom".
1174 #ifdef HAVE_WEAK_SYMBOLS
1175 #ifdef HAVE_VIRDOMAINCREATEJOB
1176 extern virJobPtr virDomainCreateJob (virDomainPtr dom, unsigned int flags) __attribute__((weak));
1181 ocaml_libvirt_domain_create_job (value domv)
1184 #ifndef HAVE_VIRDOMAINCREATEJOB
1185 /* Symbol virDomainCreateJob not found at compile time. */
1186 not_supported ("virDomainCreateJob");
1187 /* Suppresses a compiler warning. */
1190 /* Check that the symbol virDomainCreateJob
1191 * is in runtime version of libvirt.
1193 WEAK_SYMBOL_CHECK (virDomainCreateJob);
1195 CAMLlocal2 (rv, connv);
1196 virDomainPtr dom = Domain_val (domv);
1197 virConnectPtr conn = Connect_domv (domv);
1200 NONBLOCKING (r = virDomainCreateJob (dom, 0));
1201 CHECK_ERROR (!r, conn, "virDomainCreateJob");
1203 connv = Field (domv, 1);
1204 rv = Val_job (r, connv);
1210 /* Automatically generated binding for virDomainAttachDevice.
1211 * In generator.pl this function has signature "dom, string : unit".
1215 ocaml_libvirt_domain_attach_device (value domv, value strv)
1217 CAMLparam2 (domv, strv);
1220 virDomainPtr dom = Domain_val (domv);
1221 virConnectPtr conn = Connect_domv (domv);
1222 char *str = String_val (strv);
1225 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1226 CHECK_ERROR (r == -1, conn, "virDomainAttachDevice");
1228 CAMLreturn (Val_unit);
1231 /* Automatically generated binding for virDomainDetachDevice.
1232 * In generator.pl this function has signature "dom, string : unit".
1236 ocaml_libvirt_domain_detach_device (value domv, value strv)
1238 CAMLparam2 (domv, strv);
1241 virDomainPtr dom = Domain_val (domv);
1242 virConnectPtr conn = Connect_domv (domv);
1243 char *str = String_val (strv);
1246 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1247 CHECK_ERROR (r == -1, conn, "virDomainDetachDevice");
1249 CAMLreturn (Val_unit);
1252 /* Automatically generated binding for virDomainGetAutostart.
1253 * In generator.pl this function has signature "dom : bool".
1257 ocaml_libvirt_domain_get_autostart (value domv)
1261 virDomainPtr dom = Domain_val (domv);
1262 virConnectPtr conn = Connect_domv (domv);
1265 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1266 CHECK_ERROR (r == -1, conn, "virDomainGetAutostart");
1268 CAMLreturn (b ? Val_true : Val_false);
1271 /* Automatically generated binding for virDomainSetAutostart.
1272 * In generator.pl this function has signature "dom, bool : unit".
1276 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1278 CAMLparam2 (domv, bv);
1280 virDomainPtr dom = Domain_val (domv);
1281 virConnectPtr conn = Connect_domv (domv);
1284 b = bv == Val_true ? 1 : 0;
1286 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1287 CHECK_ERROR (r == -1, conn, "virDomainSetAutostart");
1289 CAMLreturn (Val_unit);
1292 /* Automatically generated binding for virNetworkFree.
1293 * In generator.pl this function has signature "net : free".
1297 ocaml_libvirt_network_free (value netv)
1301 virNetworkPtr net = Network_val (netv);
1302 virConnectPtr conn = Connect_netv (netv);
1305 NONBLOCKING (r = virNetworkFree (net));
1306 CHECK_ERROR (r == -1, conn, "virNetworkFree");
1308 /* So that we don't double-free in the finalizer: */
1309 Network_val (netv) = NULL;
1311 CAMLreturn (Val_unit);
1314 /* Automatically generated binding for virNetworkDestroy.
1315 * In generator.pl this function has signature "net : free".
1319 ocaml_libvirt_network_destroy (value netv)
1323 virNetworkPtr net = Network_val (netv);
1324 virConnectPtr conn = Connect_netv (netv);
1327 NONBLOCKING (r = virNetworkDestroy (net));
1328 CHECK_ERROR (r == -1, conn, "virNetworkDestroy");
1330 /* So that we don't double-free in the finalizer: */
1331 Network_val (netv) = NULL;
1333 CAMLreturn (Val_unit);
1336 /* Automatically generated binding for virNetworkLookupByName.
1337 * In generator.pl this function has signature "conn, string : net".
1341 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1343 CAMLparam2 (connv, strv);
1346 virConnectPtr conn = Connect_val (connv);
1347 char *str = String_val (strv);
1350 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1351 CHECK_ERROR (!r, conn, "virNetworkLookupByName");
1353 rv = Val_network (r, connv);
1358 /* Automatically generated binding for virNetworkLookupByUUID.
1359 * In generator.pl this function has signature "conn, uuid : net".
1363 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1365 CAMLparam2 (connv, uuidv);
1368 virConnectPtr conn = Connect_val (connv);
1369 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1372 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1373 CHECK_ERROR (!r, conn, "virNetworkLookupByUUID");
1375 rv = Val_network (r, connv);
1380 /* Automatically generated binding for virNetworkLookupByUUIDString.
1381 * In generator.pl this function has signature "conn, string : net".
1385 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1387 CAMLparam2 (connv, strv);
1390 virConnectPtr conn = Connect_val (connv);
1391 char *str = String_val (strv);
1394 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1395 CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
1397 rv = Val_network (r, connv);
1402 /* Automatically generated binding for virNetworkGetName.
1403 * In generator.pl this function has signature "net : static string".
1407 ocaml_libvirt_network_get_name (value netv)
1412 virNetworkPtr net = Network_val (netv);
1413 virConnectPtr conn = Connect_netv (netv);
1416 NONBLOCKING (r = virNetworkGetName (net));
1417 CHECK_ERROR (!r, conn, "virNetworkGetName");
1419 rv = caml_copy_string (r);
1423 /* Automatically generated binding for virNetworkGetXMLDesc.
1424 * In generator.pl this function has signature "net, 0 : string".
1428 ocaml_libvirt_network_get_xml_desc (value netv)
1433 virNetworkPtr net = Network_val (netv);
1434 virConnectPtr conn = Connect_netv (netv);
1437 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1438 CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
1440 rv = caml_copy_string (r);
1445 /* Automatically generated binding for virNetworkGetBridgeName.
1446 * In generator.pl this function has signature "net : string".
1450 ocaml_libvirt_network_get_bridge_name (value netv)
1455 virNetworkPtr net = Network_val (netv);
1456 virConnectPtr conn = Connect_netv (netv);
1459 NONBLOCKING (r = virNetworkGetBridgeName (net));
1460 CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
1462 rv = caml_copy_string (r);
1467 /* Automatically generated binding for virNetworkGetUUID.
1468 * In generator.pl this function has signature "net : uuid".
1472 ocaml_libvirt_network_get_uuid (value netv)
1477 virNetworkPtr net = Network_val (netv);
1478 virConnectPtr conn = Connect_netv (netv);
1479 unsigned char uuid[VIR_UUID_BUFLEN];
1482 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1483 CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
1485 /* UUIDs are byte arrays with a fixed length. */
1486 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1487 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1491 /* Automatically generated binding for virNetworkGetUUIDString.
1492 * In generator.pl this function has signature "net : uuid string".
1496 ocaml_libvirt_network_get_uuid_string (value netv)
1501 virNetworkPtr net = Network_val (netv);
1502 virConnectPtr conn = Connect_netv (netv);
1503 char uuid[VIR_UUID_STRING_BUFLEN];
1506 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1507 CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
1509 rv = caml_copy_string (uuid);
1513 /* Automatically generated binding for virNetworkUndefine.
1514 * In generator.pl this function has signature "net : unit".
1518 ocaml_libvirt_network_undefine (value netv)
1522 virNetworkPtr net = Network_val (netv);
1523 virConnectPtr conn = Connect_netv (netv);
1526 NONBLOCKING (r = virNetworkUndefine (net));
1527 CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
1529 CAMLreturn (Val_unit);
1532 /* Automatically generated binding for virNetworkCreateXML.
1533 * In generator.pl this function has signature "conn, string : net".
1537 ocaml_libvirt_network_create_xml (value connv, value strv)
1539 CAMLparam2 (connv, strv);
1542 virConnectPtr conn = Connect_val (connv);
1543 char *str = String_val (strv);
1546 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1547 CHECK_ERROR (!r, conn, "virNetworkCreateXML");
1549 rv = Val_network (r, connv);
1554 /* Automatically generated binding for virNetworkCreateXMLJob.
1555 * In generator.pl this function has signature "conn, string : job".
1558 #ifdef HAVE_WEAK_SYMBOLS
1559 #ifdef HAVE_VIRNETWORKCREATEXMLJOB
1560 extern virJobPtr virNetworkCreateXMLJob (virConnectPtr conn, const char *str) __attribute__((weak));
1565 ocaml_libvirt_network_create_xml_job (value connv, value strv)
1567 CAMLparam2 (connv, strv);
1568 #ifndef HAVE_VIRNETWORKCREATEXMLJOB
1569 /* Symbol virNetworkCreateXMLJob not found at compile time. */
1570 not_supported ("virNetworkCreateXMLJob");
1571 /* Suppresses a compiler warning. */
1574 /* Check that the symbol virNetworkCreateXMLJob
1575 * is in runtime version of libvirt.
1577 WEAK_SYMBOL_CHECK (virNetworkCreateXMLJob);
1580 virConnectPtr conn = Connect_val (connv);
1581 char *str = String_val (strv);
1584 NONBLOCKING (r = virNetworkCreateXMLJob (conn, str));
1585 CHECK_ERROR (!r, conn, "virNetworkCreateXMLJob");
1587 rv = Val_job (r, connv);
1593 /* Automatically generated binding for virNetworkDefineXML.
1594 * In generator.pl this function has signature "conn, string : net".
1598 ocaml_libvirt_network_define_xml (value connv, value strv)
1600 CAMLparam2 (connv, strv);
1603 virConnectPtr conn = Connect_val (connv);
1604 char *str = String_val (strv);
1607 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1608 CHECK_ERROR (!r, conn, "virNetworkDefineXML");
1610 rv = Val_network (r, connv);
1615 /* Automatically generated binding for virNetworkCreate.
1616 * In generator.pl this function has signature "net : unit".
1620 ocaml_libvirt_network_create (value netv)
1624 virNetworkPtr net = Network_val (netv);
1625 virConnectPtr conn = Connect_netv (netv);
1628 NONBLOCKING (r = virNetworkCreate (net));
1629 CHECK_ERROR (r == -1, conn, "virNetworkCreate");
1631 CAMLreturn (Val_unit);
1634 /* Automatically generated binding for virNetworkCreateJob.
1635 * In generator.pl this function has signature "net : job from net".
1638 #ifdef HAVE_WEAK_SYMBOLS
1639 #ifdef HAVE_VIRNETWORKCREATEJOB
1640 extern virJobPtr virNetworkCreateJob (virNetworkPtr net) __attribute__((weak));
1645 ocaml_libvirt_network_create_job (value netv)
1648 #ifndef HAVE_VIRNETWORKCREATEJOB
1649 /* Symbol virNetworkCreateJob not found at compile time. */
1650 not_supported ("virNetworkCreateJob");
1651 /* Suppresses a compiler warning. */
1654 /* Check that the symbol virNetworkCreateJob
1655 * is in runtime version of libvirt.
1657 WEAK_SYMBOL_CHECK (virNetworkCreateJob);
1659 CAMLlocal2 (rv, connv);
1660 virNetworkPtr net = Network_val (netv);
1661 virConnectPtr conn = Connect_netv (netv);
1664 NONBLOCKING (r = virNetworkCreateJob (net));
1665 CHECK_ERROR (!r, conn, "virNetworkCreateJob");
1667 connv = Field (netv, 1);
1668 rv = Val_job (r, connv);
1674 /* Automatically generated binding for virNetworkGetAutostart.
1675 * In generator.pl this function has signature "net : bool".
1679 ocaml_libvirt_network_get_autostart (value netv)
1683 virNetworkPtr net = Network_val (netv);
1684 virConnectPtr conn = Connect_netv (netv);
1687 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1688 CHECK_ERROR (r == -1, conn, "virNetworkGetAutostart");
1690 CAMLreturn (b ? Val_true : Val_false);
1693 /* Automatically generated binding for virNetworkSetAutostart.
1694 * In generator.pl this function has signature "net, bool : unit".
1698 ocaml_libvirt_network_set_autostart (value netv, value bv)
1700 CAMLparam2 (netv, bv);
1702 virNetworkPtr net = Network_val (netv);
1703 virConnectPtr conn = Connect_netv (netv);
1706 b = bv == Val_true ? 1 : 0;
1708 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1709 CHECK_ERROR (r == -1, conn, "virNetworkSetAutostart");
1711 CAMLreturn (Val_unit);
1714 /* Automatically generated binding for virStoragePoolFree.
1715 * In generator.pl this function has signature "pool : free".
1718 #ifdef HAVE_WEAK_SYMBOLS
1719 #ifdef HAVE_VIRSTORAGEPOOLFREE
1720 extern int virStoragePoolFree (virStoragePoolPtr pool) __attribute__((weak));
1725 ocaml_libvirt_storage_pool_free (value poolv)
1728 #ifndef HAVE_VIRSTORAGEPOOLFREE
1729 /* Symbol virStoragePoolFree not found at compile time. */
1730 not_supported ("virStoragePoolFree");
1731 /* Suppresses a compiler warning. */
1734 /* Check that the symbol virStoragePoolFree
1735 * is in runtime version of libvirt.
1737 WEAK_SYMBOL_CHECK (virStoragePoolFree);
1739 virStoragePoolPtr pool = Pool_val (poolv);
1740 virConnectPtr conn = Connect_polv (poolv);
1743 NONBLOCKING (r = virStoragePoolFree (pool));
1744 CHECK_ERROR (r == -1, conn, "virStoragePoolFree");
1746 /* So that we don't double-free in the finalizer: */
1747 Pool_val (poolv) = NULL;
1749 CAMLreturn (Val_unit);
1753 /* Automatically generated binding for virStoragePoolDestroy.
1754 * In generator.pl this function has signature "pool : free".
1757 #ifdef HAVE_WEAK_SYMBOLS
1758 #ifdef HAVE_VIRSTORAGEPOOLDESTROY
1759 extern int virStoragePoolDestroy (virStoragePoolPtr pool) __attribute__((weak));
1764 ocaml_libvirt_storage_pool_destroy (value poolv)
1767 #ifndef HAVE_VIRSTORAGEPOOLDESTROY
1768 /* Symbol virStoragePoolDestroy not found at compile time. */
1769 not_supported ("virStoragePoolDestroy");
1770 /* Suppresses a compiler warning. */
1773 /* Check that the symbol virStoragePoolDestroy
1774 * is in runtime version of libvirt.
1776 WEAK_SYMBOL_CHECK (virStoragePoolDestroy);
1778 virStoragePoolPtr pool = Pool_val (poolv);
1779 virConnectPtr conn = Connect_polv (poolv);
1782 NONBLOCKING (r = virStoragePoolDestroy (pool));
1783 CHECK_ERROR (r == -1, conn, "virStoragePoolDestroy");
1785 /* So that we don't double-free in the finalizer: */
1786 Pool_val (poolv) = NULL;
1788 CAMLreturn (Val_unit);
1792 /* Automatically generated binding for virStoragePoolLookupByName.
1793 * In generator.pl this function has signature "conn, string : pool".
1796 #ifdef HAVE_WEAK_SYMBOLS
1797 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1798 extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, const char *str) __attribute__((weak));
1803 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1805 CAMLparam2 (connv, strv);
1806 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1807 /* Symbol virStoragePoolLookupByName not found at compile time. */
1808 not_supported ("virStoragePoolLookupByName");
1809 /* Suppresses a compiler warning. */
1812 /* Check that the symbol virStoragePoolLookupByName
1813 * is in runtime version of libvirt.
1815 WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
1818 virConnectPtr conn = Connect_val (connv);
1819 char *str = String_val (strv);
1820 virStoragePoolPtr r;
1822 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1823 CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
1825 rv = Val_pool (r, connv);
1831 /* Automatically generated binding for virStoragePoolLookupByUUID.
1832 * In generator.pl this function has signature "conn, uuid : pool".
1835 #ifdef HAVE_WEAK_SYMBOLS
1836 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1837 extern virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, const unsigned char *str) __attribute__((weak));
1842 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1844 CAMLparam2 (connv, uuidv);
1845 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1846 /* Symbol virStoragePoolLookupByUUID not found at compile time. */
1847 not_supported ("virStoragePoolLookupByUUID");
1848 /* Suppresses a compiler warning. */
1851 /* Check that the symbol virStoragePoolLookupByUUID
1852 * is in runtime version of libvirt.
1854 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUID);
1857 virConnectPtr conn = Connect_val (connv);
1858 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1859 virStoragePoolPtr r;
1861 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1862 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUID");
1864 rv = Val_pool (r, connv);
1870 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1871 * In generator.pl this function has signature "conn, string : pool".
1874 #ifdef HAVE_WEAK_SYMBOLS
1875 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1876 extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn, const char *str) __attribute__((weak));
1881 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1883 CAMLparam2 (connv, strv);
1884 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1885 /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
1886 not_supported ("virStoragePoolLookupByUUIDString");
1887 /* Suppresses a compiler warning. */
1890 /* Check that the symbol virStoragePoolLookupByUUIDString
1891 * is in runtime version of libvirt.
1893 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
1896 virConnectPtr conn = Connect_val (connv);
1897 char *str = String_val (strv);
1898 virStoragePoolPtr r;
1900 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1901 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
1903 rv = Val_pool (r, connv);
1909 /* Automatically generated binding for virStoragePoolGetName.
1910 * In generator.pl this function has signature "pool : static string".
1913 #ifdef HAVE_WEAK_SYMBOLS
1914 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
1915 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
1920 ocaml_libvirt_storage_pool_get_name (value poolv)
1923 #ifndef HAVE_VIRSTORAGEPOOLGETNAME
1924 /* Symbol virStoragePoolGetName not found at compile time. */
1925 not_supported ("virStoragePoolGetName");
1926 /* Suppresses a compiler warning. */
1929 /* Check that the symbol virStoragePoolGetName
1930 * is in runtime version of libvirt.
1932 WEAK_SYMBOL_CHECK (virStoragePoolGetName);
1935 virStoragePoolPtr pool = Pool_val (poolv);
1936 virConnectPtr conn = Connect_polv (poolv);
1939 NONBLOCKING (r = virStoragePoolGetName (pool));
1940 CHECK_ERROR (!r, conn, "virStoragePoolGetName");
1942 rv = caml_copy_string (r);
1947 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1948 * In generator.pl this function has signature "pool, 0 : string".
1951 #ifdef HAVE_WEAK_SYMBOLS
1952 #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC
1953 extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
1958 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1961 #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC
1962 /* Symbol virStoragePoolGetXMLDesc not found at compile time. */
1963 not_supported ("virStoragePoolGetXMLDesc");
1964 /* Suppresses a compiler warning. */
1967 /* Check that the symbol virStoragePoolGetXMLDesc
1968 * is in runtime version of libvirt.
1970 WEAK_SYMBOL_CHECK (virStoragePoolGetXMLDesc);
1973 virStoragePoolPtr pool = Pool_val (poolv);
1974 virConnectPtr conn = Connect_polv (poolv);
1977 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1978 CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
1980 rv = caml_copy_string (r);
1986 /* Automatically generated binding for virStoragePoolGetUUID.
1987 * In generator.pl this function has signature "pool : uuid".
1990 #ifdef HAVE_WEAK_SYMBOLS
1991 #ifdef HAVE_VIRSTORAGEPOOLGETUUID
1992 extern int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *) __attribute__((weak));
1997 ocaml_libvirt_storage_pool_get_uuid (value poolv)
2000 #ifndef HAVE_VIRSTORAGEPOOLGETUUID
2001 /* Symbol virStoragePoolGetUUID not found at compile time. */
2002 not_supported ("virStoragePoolGetUUID");
2003 /* Suppresses a compiler warning. */
2006 /* Check that the symbol virStoragePoolGetUUID
2007 * is in runtime version of libvirt.
2009 WEAK_SYMBOL_CHECK (virStoragePoolGetUUID);
2012 virStoragePoolPtr pool = Pool_val (poolv);
2013 virConnectPtr conn = Connect_polv (poolv);
2014 unsigned char uuid[VIR_UUID_BUFLEN];
2017 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
2018 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
2020 /* UUIDs are byte arrays with a fixed length. */
2021 rv = caml_alloc_string (VIR_UUID_BUFLEN);
2022 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
2027 /* Automatically generated binding for virStoragePoolGetUUIDString.
2028 * In generator.pl this function has signature "pool : uuid string".
2031 #ifdef HAVE_WEAK_SYMBOLS
2032 #ifdef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2033 extern int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *) __attribute__((weak));
2038 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
2041 #ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2042 /* Symbol virStoragePoolGetUUIDString not found at compile time. */
2043 not_supported ("virStoragePoolGetUUIDString");
2044 /* Suppresses a compiler warning. */
2047 /* Check that the symbol virStoragePoolGetUUIDString
2048 * is in runtime version of libvirt.
2050 WEAK_SYMBOL_CHECK (virStoragePoolGetUUIDString);
2053 virStoragePoolPtr pool = Pool_val (poolv);
2054 virConnectPtr conn = Connect_polv (poolv);
2055 char uuid[VIR_UUID_STRING_BUFLEN];
2058 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
2059 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
2061 rv = caml_copy_string (uuid);
2066 /* Automatically generated binding for virStoragePoolCreateXML.
2067 * In generator.pl this function has signature "conn, string : pool".
2070 #ifdef HAVE_WEAK_SYMBOLS
2071 #ifdef HAVE_VIRSTORAGEPOOLCREATEXML
2072 extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str) __attribute__((weak));
2077 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
2079 CAMLparam2 (connv, strv);
2080 #ifndef HAVE_VIRSTORAGEPOOLCREATEXML
2081 /* Symbol virStoragePoolCreateXML not found at compile time. */
2082 not_supported ("virStoragePoolCreateXML");
2083 /* Suppresses a compiler warning. */
2086 /* Check that the symbol virStoragePoolCreateXML
2087 * is in runtime version of libvirt.
2089 WEAK_SYMBOL_CHECK (virStoragePoolCreateXML);
2092 virConnectPtr conn = Connect_val (connv);
2093 char *str = String_val (strv);
2094 virStoragePoolPtr r;
2096 NONBLOCKING (r = virStoragePoolCreateXML (conn, str));
2097 CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
2099 rv = Val_pool (r, connv);
2105 /* Automatically generated binding for virStoragePoolDefineXML.
2106 * In generator.pl this function has signature "conn, string : pool".
2109 #ifdef HAVE_WEAK_SYMBOLS
2110 #ifdef HAVE_VIRSTORAGEPOOLDEFINEXML
2111 extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str) __attribute__((weak));
2116 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
2118 CAMLparam2 (connv, strv);
2119 #ifndef HAVE_VIRSTORAGEPOOLDEFINEXML
2120 /* Symbol virStoragePoolDefineXML not found at compile time. */
2121 not_supported ("virStoragePoolDefineXML");
2122 /* Suppresses a compiler warning. */
2125 /* Check that the symbol virStoragePoolDefineXML
2126 * is in runtime version of libvirt.
2128 WEAK_SYMBOL_CHECK (virStoragePoolDefineXML);
2131 virConnectPtr conn = Connect_val (connv);
2132 char *str = String_val (strv);
2133 virStoragePoolPtr r;
2135 NONBLOCKING (r = virStoragePoolDefineXML (conn, str));
2136 CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
2138 rv = Val_pool (r, connv);
2144 /* Automatically generated binding for virStoragePoolUndefine.
2145 * In generator.pl this function has signature "pool : unit".
2148 #ifdef HAVE_WEAK_SYMBOLS
2149 #ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
2150 extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
2155 ocaml_libvirt_storage_pool_undefine (value poolv)
2158 #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
2159 /* Symbol virStoragePoolUndefine not found at compile time. */
2160 not_supported ("virStoragePoolUndefine");
2161 /* Suppresses a compiler warning. */
2164 /* Check that the symbol virStoragePoolUndefine
2165 * is in runtime version of libvirt.
2167 WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
2169 virStoragePoolPtr pool = Pool_val (poolv);
2170 virConnectPtr conn = Connect_polv (poolv);
2173 NONBLOCKING (r = virStoragePoolUndefine (pool));
2174 CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
2176 CAMLreturn (Val_unit);
2180 /* Automatically generated binding for virStoragePoolCreate.
2181 * In generator.pl this function has signature "pool : unit".
2184 #ifdef HAVE_WEAK_SYMBOLS
2185 #ifdef HAVE_VIRSTORAGEPOOLCREATE
2186 extern int virStoragePoolCreate (virStoragePoolPtr pool) __attribute__((weak));
2191 ocaml_libvirt_storage_pool_create (value poolv)
2194 #ifndef HAVE_VIRSTORAGEPOOLCREATE
2195 /* Symbol virStoragePoolCreate not found at compile time. */
2196 not_supported ("virStoragePoolCreate");
2197 /* Suppresses a compiler warning. */
2200 /* Check that the symbol virStoragePoolCreate
2201 * is in runtime version of libvirt.
2203 WEAK_SYMBOL_CHECK (virStoragePoolCreate);
2205 virStoragePoolPtr pool = Pool_val (poolv);
2206 virConnectPtr conn = Connect_polv (poolv);
2209 NONBLOCKING (r = virStoragePoolCreate (pool));
2210 CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
2212 CAMLreturn (Val_unit);
2216 /* Automatically generated binding for virStoragePoolShutdown.
2217 * In generator.pl this function has signature "pool : unit".
2220 #ifdef HAVE_WEAK_SYMBOLS
2221 #ifdef HAVE_VIRSTORAGEPOOLSHUTDOWN
2222 extern int virStoragePoolShutdown (virStoragePoolPtr pool) __attribute__((weak));
2227 ocaml_libvirt_storage_pool_shutdown (value poolv)
2230 #ifndef HAVE_VIRSTORAGEPOOLSHUTDOWN
2231 /* Symbol virStoragePoolShutdown not found at compile time. */
2232 not_supported ("virStoragePoolShutdown");
2233 /* Suppresses a compiler warning. */
2236 /* Check that the symbol virStoragePoolShutdown
2237 * is in runtime version of libvirt.
2239 WEAK_SYMBOL_CHECK (virStoragePoolShutdown);
2241 virStoragePoolPtr pool = Pool_val (poolv);
2242 virConnectPtr conn = Connect_polv (poolv);
2245 NONBLOCKING (r = virStoragePoolShutdown (pool));
2246 CHECK_ERROR (r == -1, conn, "virStoragePoolShutdown");
2248 CAMLreturn (Val_unit);
2252 /* Automatically generated binding for virStoragePoolRefresh.
2253 * In generator.pl this function has signature "pool, 0U : unit".
2256 #ifdef HAVE_WEAK_SYMBOLS
2257 #ifdef HAVE_VIRSTORAGEPOOLREFRESH
2258 extern int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
2263 ocaml_libvirt_storage_pool_refresh (value poolv)
2266 #ifndef HAVE_VIRSTORAGEPOOLREFRESH
2267 /* Symbol virStoragePoolRefresh not found at compile time. */
2268 not_supported ("virStoragePoolRefresh");
2269 /* Suppresses a compiler warning. */
2272 /* Check that the symbol virStoragePoolRefresh
2273 * is in runtime version of libvirt.
2275 WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
2277 virStoragePoolPtr pool = Pool_val (poolv);
2278 virConnectPtr conn = Connect_polv (poolv);
2281 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
2282 CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
2284 CAMLreturn (Val_unit);
2288 /* Automatically generated binding for virStoragePoolGetAutostart.
2289 * In generator.pl this function has signature "pool : bool".
2292 #ifdef HAVE_WEAK_SYMBOLS
2293 #ifdef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2294 extern int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *r) __attribute__((weak));
2299 ocaml_libvirt_storage_pool_get_autostart (value poolv)
2302 #ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2303 /* Symbol virStoragePoolGetAutostart not found at compile time. */
2304 not_supported ("virStoragePoolGetAutostart");
2305 /* Suppresses a compiler warning. */
2308 /* Check that the symbol virStoragePoolGetAutostart
2309 * is in runtime version of libvirt.
2311 WEAK_SYMBOL_CHECK (virStoragePoolGetAutostart);
2313 virStoragePoolPtr pool = Pool_val (poolv);
2314 virConnectPtr conn = Connect_polv (poolv);
2317 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
2318 CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
2320 CAMLreturn (b ? Val_true : Val_false);
2324 /* Automatically generated binding for virStoragePoolSetAutostart.
2325 * In generator.pl this function has signature "pool, bool : unit".
2328 #ifdef HAVE_WEAK_SYMBOLS
2329 #ifdef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2330 extern int virStoragePoolSetAutostart (virStoragePoolPtr pool, int b) __attribute__((weak));
2335 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
2337 CAMLparam2 (poolv, bv);
2338 #ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2339 /* Symbol virStoragePoolSetAutostart not found at compile time. */
2340 not_supported ("virStoragePoolSetAutostart");
2341 /* Suppresses a compiler warning. */
2344 /* Check that the symbol virStoragePoolSetAutostart
2345 * is in runtime version of libvirt.
2347 WEAK_SYMBOL_CHECK (virStoragePoolSetAutostart);
2349 virStoragePoolPtr pool = Pool_val (poolv);
2350 virConnectPtr conn = Connect_polv (poolv);
2353 b = bv == Val_true ? 1 : 0;
2355 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
2356 CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
2358 CAMLreturn (Val_unit);
2362 /* Automatically generated binding for virStorageVolFree.
2363 * In generator.pl this function has signature "vol : free".
2366 #ifdef HAVE_WEAK_SYMBOLS
2367 #ifdef HAVE_VIRSTORAGEVOLFREE
2368 extern int virStorageVolFree (virStorageVolPtr vol) __attribute__((weak));
2373 ocaml_libvirt_storage_vol_free (value volv)
2376 #ifndef HAVE_VIRSTORAGEVOLFREE
2377 /* Symbol virStorageVolFree not found at compile time. */
2378 not_supported ("virStorageVolFree");
2379 /* Suppresses a compiler warning. */
2382 /* Check that the symbol virStorageVolFree
2383 * is in runtime version of libvirt.
2385 WEAK_SYMBOL_CHECK (virStorageVolFree);
2387 virStorageVolPtr vol = Volume_val (volv);
2388 virConnectPtr conn = Connect_volv (volv);
2391 NONBLOCKING (r = virStorageVolFree (vol));
2392 CHECK_ERROR (r == -1, conn, "virStorageVolFree");
2394 /* So that we don't double-free in the finalizer: */
2395 Volume_val (volv) = NULL;
2397 CAMLreturn (Val_unit);
2401 /* Automatically generated binding for virStorageVolDestroy.
2402 * In generator.pl this function has signature "vol : free".
2405 #ifdef HAVE_WEAK_SYMBOLS
2406 #ifdef HAVE_VIRSTORAGEVOLDESTROY
2407 extern int virStorageVolDestroy (virStorageVolPtr vol) __attribute__((weak));
2412 ocaml_libvirt_storage_vol_destroy (value volv)
2415 #ifndef HAVE_VIRSTORAGEVOLDESTROY
2416 /* Symbol virStorageVolDestroy not found at compile time. */
2417 not_supported ("virStorageVolDestroy");
2418 /* Suppresses a compiler warning. */
2421 /* Check that the symbol virStorageVolDestroy
2422 * is in runtime version of libvirt.
2424 WEAK_SYMBOL_CHECK (virStorageVolDestroy);
2426 virStorageVolPtr vol = Volume_val (volv);
2427 virConnectPtr conn = Connect_volv (volv);
2430 NONBLOCKING (r = virStorageVolDestroy (vol));
2431 CHECK_ERROR (r == -1, conn, "virStorageVolDestroy");
2433 /* So that we don't double-free in the finalizer: */
2434 Volume_val (volv) = NULL;
2436 CAMLreturn (Val_unit);
2440 /* Automatically generated binding for virStorageVolLookupByName.
2441 * In generator.pl this function has signature "pool, string : vol from pool".
2444 #ifdef HAVE_WEAK_SYMBOLS
2445 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2446 extern virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, const char *str) __attribute__((weak));
2451 ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
2453 CAMLparam2 (poolv, strv);
2454 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2455 /* Symbol virStorageVolLookupByName not found at compile time. */
2456 not_supported ("virStorageVolLookupByName");
2457 /* Suppresses a compiler warning. */
2460 /* Check that the symbol virStorageVolLookupByName
2461 * is in runtime version of libvirt.
2463 WEAK_SYMBOL_CHECK (virStorageVolLookupByName);
2465 CAMLlocal2 (rv, connv);
2466 virStoragePoolPtr pool = Pool_val (poolv);
2467 virConnectPtr conn = Connect_polv (poolv);
2468 char *str = String_val (strv);
2471 NONBLOCKING (r = virStorageVolLookupByName (pool, str));
2472 CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
2474 connv = Field (poolv, 1);
2475 rv = Val_volume (r, connv);
2481 /* Automatically generated binding for virStorageVolLookupByKey.
2482 * In generator.pl this function has signature "conn, string : vol".
2485 #ifdef HAVE_WEAK_SYMBOLS
2486 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2487 extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *str) __attribute__((weak));
2492 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
2494 CAMLparam2 (connv, strv);
2495 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2496 /* Symbol virStorageVolLookupByKey not found at compile time. */
2497 not_supported ("virStorageVolLookupByKey");
2498 /* Suppresses a compiler warning. */
2501 /* Check that the symbol virStorageVolLookupByKey
2502 * is in runtime version of libvirt.
2504 WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
2507 virConnectPtr conn = Connect_val (connv);
2508 char *str = String_val (strv);
2511 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
2512 CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
2514 rv = Val_volume (r, connv);
2520 /* Automatically generated binding for virStorageVolLookupByPath.
2521 * In generator.pl this function has signature "conn, string : vol".
2524 #ifdef HAVE_WEAK_SYMBOLS
2525 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2526 extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *str) __attribute__((weak));
2531 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
2533 CAMLparam2 (connv, strv);
2534 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2535 /* Symbol virStorageVolLookupByPath not found at compile time. */
2536 not_supported ("virStorageVolLookupByPath");
2537 /* Suppresses a compiler warning. */
2540 /* Check that the symbol virStorageVolLookupByPath
2541 * is in runtime version of libvirt.
2543 WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
2546 virConnectPtr conn = Connect_val (connv);
2547 char *str = String_val (strv);
2550 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
2551 CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
2553 rv = Val_volume (r, connv);
2559 /* Automatically generated binding for virStorageVolCreateXML.
2560 * In generator.pl this function has signature "pool, string, 0 : vol from pool".
2563 #ifdef HAVE_WEAK_SYMBOLS
2564 #ifdef HAVE_VIRSTORAGEVOLCREATEXML
2565 extern virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *str, int flags) __attribute__((weak));
2570 ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
2572 CAMLparam2 (poolv, strv);
2573 #ifndef HAVE_VIRSTORAGEVOLCREATEXML
2574 /* Symbol virStorageVolCreateXML not found at compile time. */
2575 not_supported ("virStorageVolCreateXML");
2576 /* Suppresses a compiler warning. */
2579 /* Check that the symbol virStorageVolCreateXML
2580 * is in runtime version of libvirt.
2582 WEAK_SYMBOL_CHECK (virStorageVolCreateXML);
2584 CAMLlocal2 (rv, connv);
2585 virStoragePoolPtr pool = Pool_val (poolv);
2586 virConnectPtr conn = Connect_polv (poolv);
2587 char *str = String_val (strv);
2590 NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
2591 CHECK_ERROR (!r, conn, "virStorageVolCreateXML");
2593 connv = Field (poolv, 1);
2594 rv = Val_volume (r, connv);
2600 /* Automatically generated binding for virStorageVolGetXMLDesc.
2601 * In generator.pl this function has signature "vol, 0 : string".
2604 #ifdef HAVE_WEAK_SYMBOLS
2605 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
2606 extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, int flags) __attribute__((weak));
2611 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
2614 #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
2615 /* Symbol virStorageVolGetXMLDesc not found at compile time. */
2616 not_supported ("virStorageVolGetXMLDesc");
2617 /* Suppresses a compiler warning. */
2620 /* Check that the symbol virStorageVolGetXMLDesc
2621 * is in runtime version of libvirt.
2623 WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
2626 virStorageVolPtr vol = Volume_val (volv);
2627 virConnectPtr conn = Connect_volv (volv);
2630 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
2631 CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
2633 rv = caml_copy_string (r);
2639 /* Automatically generated binding for virStorageVolGetPath.
2640 * In generator.pl this function has signature "vol : string".
2643 #ifdef HAVE_WEAK_SYMBOLS
2644 #ifdef HAVE_VIRSTORAGEVOLGETPATH
2645 extern char *virStorageVolGetPath (virStorageVolPtr vol) __attribute__((weak));
2650 ocaml_libvirt_storage_vol_get_path (value volv)
2653 #ifndef HAVE_VIRSTORAGEVOLGETPATH
2654 /* Symbol virStorageVolGetPath not found at compile time. */
2655 not_supported ("virStorageVolGetPath");
2656 /* Suppresses a compiler warning. */
2659 /* Check that the symbol virStorageVolGetPath
2660 * is in runtime version of libvirt.
2662 WEAK_SYMBOL_CHECK (virStorageVolGetPath);
2665 virStorageVolPtr vol = Volume_val (volv);
2666 virConnectPtr conn = Connect_volv (volv);
2669 NONBLOCKING (r = virStorageVolGetPath (vol));
2670 CHECK_ERROR (!r, conn, "virStorageVolGetPath");
2672 rv = caml_copy_string (r);
2678 /* Automatically generated binding for virStorageVolGetKey.
2679 * In generator.pl this function has signature "vol : static string".
2682 #ifdef HAVE_WEAK_SYMBOLS
2683 #ifdef HAVE_VIRSTORAGEVOLGETKEY
2684 extern const char *virStorageVolGetKey (virStorageVolPtr vol) __attribute__((weak));
2689 ocaml_libvirt_storage_vol_get_key (value volv)
2692 #ifndef HAVE_VIRSTORAGEVOLGETKEY
2693 /* Symbol virStorageVolGetKey not found at compile time. */
2694 not_supported ("virStorageVolGetKey");
2695 /* Suppresses a compiler warning. */
2698 /* Check that the symbol virStorageVolGetKey
2699 * is in runtime version of libvirt.
2701 WEAK_SYMBOL_CHECK (virStorageVolGetKey);
2704 virStorageVolPtr vol = Volume_val (volv);
2705 virConnectPtr conn = Connect_volv (volv);
2708 NONBLOCKING (r = virStorageVolGetKey (vol));
2709 CHECK_ERROR (!r, conn, "virStorageVolGetKey");
2711 rv = caml_copy_string (r);
2716 /* Automatically generated binding for virStorageVolGetName.
2717 * In generator.pl this function has signature "vol : static string".
2720 #ifdef HAVE_WEAK_SYMBOLS
2721 #ifdef HAVE_VIRSTORAGEVOLGETNAME
2722 extern const char *virStorageVolGetName (virStorageVolPtr vol) __attribute__((weak));
2727 ocaml_libvirt_storage_vol_get_name (value volv)
2730 #ifndef HAVE_VIRSTORAGEVOLGETNAME
2731 /* Symbol virStorageVolGetName not found at compile time. */
2732 not_supported ("virStorageVolGetName");
2733 /* Suppresses a compiler warning. */
2736 /* Check that the symbol virStorageVolGetName
2737 * is in runtime version of libvirt.
2739 WEAK_SYMBOL_CHECK (virStorageVolGetName);
2742 virStorageVolPtr vol = Volume_val (volv);
2743 virConnectPtr conn = Connect_volv (volv);
2746 NONBLOCKING (r = virStorageVolGetName (vol));
2747 CHECK_ERROR (!r, conn, "virStorageVolGetName");
2749 rv = caml_copy_string (r);
2754 /* Automatically generated binding for virStoragePoolLookupByVolume.
2755 * In generator.pl this function has signature "vol : pool from vol".
2758 #ifdef HAVE_WEAK_SYMBOLS
2759 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2760 extern virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol) __attribute__((weak));
2765 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2768 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2769 /* Symbol virStoragePoolLookupByVolume not found at compile time. */
2770 not_supported ("virStoragePoolLookupByVolume");
2771 /* Suppresses a compiler warning. */
2774 /* Check that the symbol virStoragePoolLookupByVolume
2775 * is in runtime version of libvirt.
2777 WEAK_SYMBOL_CHECK (virStoragePoolLookupByVolume);
2779 CAMLlocal2 (rv, connv);
2780 virStorageVolPtr vol = Volume_val (volv);
2781 virConnectPtr conn = Connect_volv (volv);
2782 virStoragePoolPtr r;
2784 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2785 CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
2787 connv = Field (volv, 1);
2788 rv = Val_pool (r, connv);
2794 /* Automatically generated binding for virJobFree.
2795 * In generator.pl this function has signature "job : free".
2798 #ifdef HAVE_WEAK_SYMBOLS
2799 #ifdef HAVE_VIRJOBFREE
2800 extern int virJobFree (virJobPtr job) __attribute__((weak));
2805 ocaml_libvirt_job_free (value jobv)
2808 #ifndef HAVE_VIRJOBFREE
2809 /* Symbol virJobFree not found at compile time. */
2810 not_supported ("virJobFree");
2811 /* Suppresses a compiler warning. */
2814 /* Check that the symbol virJobFree
2815 * is in runtime version of libvirt.
2817 WEAK_SYMBOL_CHECK (virJobFree);
2819 virJobPtr job = Job_val (jobv);
2820 virConnectPtr conn = Connect_jobv (jobv);
2823 NONBLOCKING (r = virJobFree (job));
2824 CHECK_ERROR (r == -1, conn, "virJobFree");
2826 /* So that we don't double-free in the finalizer: */
2827 Job_val (jobv) = NULL;
2829 CAMLreturn (Val_unit);
2833 /* Automatically generated binding for virJobCancel.
2834 * In generator.pl this function has signature "job : unit".
2837 #ifdef HAVE_WEAK_SYMBOLS
2838 #ifdef HAVE_VIRJOBCANCEL
2839 extern int virJobCancel (virJobPtr job) __attribute__((weak));
2844 ocaml_libvirt_job_cancel (value jobv)
2847 #ifndef HAVE_VIRJOBCANCEL
2848 /* Symbol virJobCancel not found at compile time. */
2849 not_supported ("virJobCancel");
2850 /* Suppresses a compiler warning. */
2853 /* Check that the symbol virJobCancel
2854 * is in runtime version of libvirt.
2856 WEAK_SYMBOL_CHECK (virJobCancel);
2858 virJobPtr job = Job_val (jobv);
2859 virConnectPtr conn = Connect_jobv (jobv);
2862 NONBLOCKING (r = virJobCancel (job));
2863 CHECK_ERROR (r == -1, conn, "virJobCancel");
2865 CAMLreturn (Val_unit);
2869 /* Automatically generated binding for virJobGetNetwork.
2870 * In generator.pl this function has signature "job : net from job".
2873 #ifdef HAVE_WEAK_SYMBOLS
2874 #ifdef HAVE_VIRJOBGETNETWORK
2875 extern virNetworkPtr virJobGetNetwork (virJobPtr job) __attribute__((weak));
2880 ocaml_libvirt_job_get_network (value jobv)
2883 #ifndef HAVE_VIRJOBGETNETWORK
2884 /* Symbol virJobGetNetwork not found at compile time. */
2885 not_supported ("virJobGetNetwork");
2886 /* Suppresses a compiler warning. */
2889 /* Check that the symbol virJobGetNetwork
2890 * is in runtime version of libvirt.
2892 WEAK_SYMBOL_CHECK (virJobGetNetwork);
2894 CAMLlocal2 (rv, connv);
2895 virJobPtr job = Job_val (jobv);
2896 virConnectPtr conn = Connect_jobv (jobv);
2899 NONBLOCKING (r = virJobGetNetwork (job));
2900 CHECK_ERROR (!r, conn, "virJobGetNetwork");
2902 connv = Field (jobv, 1);
2903 rv = Val_network (r, connv);
2909 /* Automatically generated binding for virJobGetDomain.
2910 * In generator.pl this function has signature "job : dom from job".
2913 #ifdef HAVE_WEAK_SYMBOLS
2914 #ifdef HAVE_VIRJOBGETDOMAIN
2915 extern virDomainPtr virJobGetDomain (virJobPtr job) __attribute__((weak));
2920 ocaml_libvirt_job_get_domain (value jobv)
2923 #ifndef HAVE_VIRJOBGETDOMAIN
2924 /* Symbol virJobGetDomain not found at compile time. */
2925 not_supported ("virJobGetDomain");
2926 /* Suppresses a compiler warning. */
2929 /* Check that the symbol virJobGetDomain
2930 * is in runtime version of libvirt.
2932 WEAK_SYMBOL_CHECK (virJobGetDomain);
2934 CAMLlocal2 (rv, connv);
2935 virJobPtr job = Job_val (jobv);
2936 virConnectPtr conn = Connect_jobv (jobv);
2939 NONBLOCKING (r = virJobGetDomain (job));
2940 CHECK_ERROR (!r, conn, "virJobGetDomain");
2942 connv = Field (jobv, 1);
2943 rv = Val_domain (r, connv);
2949 #include "libvirt_c_epilogue.c"