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,
16 * with the OCaml linking exception described in ../COPYING.LIB.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34 #include <libvirt/libvirt.h>
35 #include <libvirt/virterror.h>
37 #include <caml/config.h>
38 #include <caml/alloc.h>
39 #include <caml/callback.h>
40 #include <caml/custom.h>
41 #include <caml/fail.h>
42 #include <caml/memory.h>
43 #include <caml/misc.h>
44 #include <caml/mlvalues.h>
45 #include <caml/signals.h>
47 #include "libvirt_c_prologue.c"
49 #include "libvirt_c_oneoffs.c"
51 /* Automatically generated binding for virConnectClose.
52 * In generator.pl this function has signature "conn : free".
56 ocaml_libvirt_connect_close (value connv)
60 virConnectPtr conn = Connect_val (connv);
63 NONBLOCKING (r = virConnectClose (conn));
64 CHECK_ERROR (r == -1, conn, "virConnectClose");
66 /* So that we don't double-free in the finalizer: */
67 Connect_val (connv) = NULL;
69 CAMLreturn (Val_unit);
72 /* Automatically generated binding for virConnectGetHostname.
73 * In generator.pl this function has signature "conn : string".
76 #ifdef HAVE_WEAK_SYMBOLS
77 #ifdef HAVE_VIRCONNECTGETHOSTNAME
78 extern char *virConnectGetHostname (virConnectPtr conn) __attribute__((weak));
83 ocaml_libvirt_connect_get_hostname (value connv)
86 #ifndef HAVE_VIRCONNECTGETHOSTNAME
87 /* Symbol virConnectGetHostname not found at compile time. */
88 not_supported ("virConnectGetHostname");
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");
128 /* Check that the symbol virConnectGetURI
129 * is in runtime version of libvirt.
131 WEAK_SYMBOL_CHECK (virConnectGetURI);
134 virConnectPtr conn = Connect_val (connv);
137 NONBLOCKING (r = virConnectGetURI (conn));
138 CHECK_ERROR (!r, conn, "virConnectGetURI");
140 rv = caml_copy_string (r);
146 /* Automatically generated binding for virConnectGetType.
147 * In generator.pl this function has signature "conn : static string".
151 ocaml_libvirt_connect_get_type (value connv)
156 virConnectPtr conn = Connect_val (connv);
159 NONBLOCKING (r = virConnectGetType (conn));
160 CHECK_ERROR (!r, conn, "virConnectGetType");
162 rv = caml_copy_string (r);
166 /* Automatically generated binding for virConnectNumOfDomains.
167 * In generator.pl this function has signature "conn : int".
171 ocaml_libvirt_connect_num_of_domains (value connv)
175 virConnectPtr conn = Connect_val (connv);
178 NONBLOCKING (r = virConnectNumOfDomains (conn));
179 CHECK_ERROR (r == -1, conn, "virConnectNumOfDomains");
181 CAMLreturn (Val_int (r));
184 /* Automatically generated binding for virConnectListDomains.
185 * In generator.pl this function has signature "conn, int : int array".
189 ocaml_libvirt_connect_list_domains (value connv, value iv)
191 CAMLparam2 (connv, iv);
194 virConnectPtr conn = Connect_val (connv);
195 int i = Int_val (iv);
198 /* Some libvirt List* functions still throw exceptions if i == 0,
199 * so catch that and return an empty array directly. This changes
200 * the semantics slightly (masking other failures) but it's
201 * unlikely anyone will care. RWMJ 2008/06/10
204 rv = caml_alloc (0, 0);
208 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
209 CHECK_ERROR (r == -1, conn, "virConnectListDomains");
211 rv = caml_alloc (r, 0);
212 for (i = 0; i < r; ++i)
213 Store_field (rv, i, Val_int (ids[i]));
218 /* Automatically generated binding for virConnectNumOfDefinedDomains.
219 * In generator.pl this function has signature "conn : int".
223 ocaml_libvirt_connect_num_of_defined_domains (value connv)
227 virConnectPtr conn = Connect_val (connv);
230 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
231 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedDomains");
233 CAMLreturn (Val_int (r));
236 /* Automatically generated binding for virConnectListDefinedDomains.
237 * In generator.pl this function has signature "conn, int : string array".
241 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
243 CAMLparam2 (connv, iv);
245 CAMLlocal2 (rv, strv);
246 virConnectPtr conn = Connect_val (connv);
247 int i = Int_val (iv);
251 /* Some libvirt List* functions still throw exceptions if i == 0,
252 * so catch that and return an empty array directly. This changes
253 * the semantics slightly (masking other failures) but it's
254 * unlikely anyone will care. RWMJ 2008/06/10
257 rv = caml_alloc (0, 0);
261 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
262 CHECK_ERROR (r == -1, conn, "virConnectListDefinedDomains");
264 rv = caml_alloc (r, 0);
265 for (i = 0; i < r; ++i) {
266 strv = caml_copy_string (names[i]);
267 Store_field (rv, i, strv);
274 /* Automatically generated binding for virConnectNumOfNetworks.
275 * In generator.pl this function has signature "conn : int".
279 ocaml_libvirt_connect_num_of_networks (value connv)
283 virConnectPtr conn = Connect_val (connv);
286 NONBLOCKING (r = virConnectNumOfNetworks (conn));
287 CHECK_ERROR (r == -1, conn, "virConnectNumOfNetworks");
289 CAMLreturn (Val_int (r));
292 /* Automatically generated binding for virConnectListNetworks.
293 * In generator.pl this function has signature "conn, int : string array".
297 ocaml_libvirt_connect_list_networks (value connv, value iv)
299 CAMLparam2 (connv, iv);
301 CAMLlocal2 (rv, strv);
302 virConnectPtr conn = Connect_val (connv);
303 int i = Int_val (iv);
307 /* Some libvirt List* functions still throw exceptions if i == 0,
308 * so catch that and return an empty array directly. This changes
309 * the semantics slightly (masking other failures) but it's
310 * unlikely anyone will care. RWMJ 2008/06/10
313 rv = caml_alloc (0, 0);
317 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
318 CHECK_ERROR (r == -1, conn, "virConnectListNetworks");
320 rv = caml_alloc (r, 0);
321 for (i = 0; i < r; ++i) {
322 strv = caml_copy_string (names[i]);
323 Store_field (rv, i, strv);
330 /* Automatically generated binding for virConnectNumOfDefinedNetworks.
331 * In generator.pl this function has signature "conn : int".
335 ocaml_libvirt_connect_num_of_defined_networks (value connv)
339 virConnectPtr conn = Connect_val (connv);
342 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
343 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedNetworks");
345 CAMLreturn (Val_int (r));
348 /* Automatically generated binding for virConnectListDefinedNetworks.
349 * In generator.pl this function has signature "conn, int : string array".
353 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
355 CAMLparam2 (connv, iv);
357 CAMLlocal2 (rv, strv);
358 virConnectPtr conn = Connect_val (connv);
359 int i = Int_val (iv);
363 /* Some libvirt List* functions still throw exceptions if i == 0,
364 * so catch that and return an empty array directly. This changes
365 * the semantics slightly (masking other failures) but it's
366 * unlikely anyone will care. RWMJ 2008/06/10
369 rv = caml_alloc (0, 0);
373 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
374 CHECK_ERROR (r == -1, conn, "virConnectListDefinedNetworks");
376 rv = caml_alloc (r, 0);
377 for (i = 0; i < r; ++i) {
378 strv = caml_copy_string (names[i]);
379 Store_field (rv, i, strv);
386 /* Automatically generated binding for virConnectNumOfStoragePools.
387 * In generator.pl this function has signature "conn : int".
390 #ifdef HAVE_WEAK_SYMBOLS
391 #ifdef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
392 extern int virConnectNumOfStoragePools (virConnectPtr conn) __attribute__((weak));
397 ocaml_libvirt_connect_num_of_storage_pools (value connv)
400 #ifndef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
401 /* Symbol virConnectNumOfStoragePools not found at compile time. */
402 not_supported ("virConnectNumOfStoragePools");
405 /* Check that the symbol virConnectNumOfStoragePools
406 * is in runtime version of libvirt.
408 WEAK_SYMBOL_CHECK (virConnectNumOfStoragePools);
410 virConnectPtr conn = Connect_val (connv);
413 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
414 CHECK_ERROR (r == -1, conn, "virConnectNumOfStoragePools");
416 CAMLreturn (Val_int (r));
420 /* Automatically generated binding for virConnectListStoragePools.
421 * In generator.pl this function has signature "conn, int : string array".
424 #ifdef HAVE_WEAK_SYMBOLS
425 #ifdef HAVE_VIRCONNECTLISTSTORAGEPOOLS
426 extern int virConnectListStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
431 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
433 CAMLparam2 (connv, iv);
434 #ifndef HAVE_VIRCONNECTLISTSTORAGEPOOLS
435 /* Symbol virConnectListStoragePools not found at compile time. */
436 not_supported ("virConnectListStoragePools");
439 /* Check that the symbol virConnectListStoragePools
440 * is in runtime version of libvirt.
442 WEAK_SYMBOL_CHECK (virConnectListStoragePools);
444 CAMLlocal2 (rv, strv);
445 virConnectPtr conn = Connect_val (connv);
446 int i = Int_val (iv);
450 /* Some libvirt List* functions still throw exceptions if i == 0,
451 * so catch that and return an empty array directly. This changes
452 * the semantics slightly (masking other failures) but it's
453 * unlikely anyone will care. RWMJ 2008/06/10
456 rv = caml_alloc (0, 0);
460 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
461 CHECK_ERROR (r == -1, conn, "virConnectListStoragePools");
463 rv = caml_alloc (r, 0);
464 for (i = 0; i < r; ++i) {
465 strv = caml_copy_string (names[i]);
466 Store_field (rv, i, strv);
474 /* Automatically generated binding for virConnectNumOfDefinedStoragePools.
475 * In generator.pl this function has signature "conn : int".
478 #ifdef HAVE_WEAK_SYMBOLS
479 #ifdef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
480 extern int virConnectNumOfDefinedStoragePools (virConnectPtr conn) __attribute__((weak));
485 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
488 #ifndef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
489 /* Symbol virConnectNumOfDefinedStoragePools not found at compile time. */
490 not_supported ("virConnectNumOfDefinedStoragePools");
493 /* Check that the symbol virConnectNumOfDefinedStoragePools
494 * is in runtime version of libvirt.
496 WEAK_SYMBOL_CHECK (virConnectNumOfDefinedStoragePools);
498 virConnectPtr conn = Connect_val (connv);
501 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
502 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedStoragePools");
504 CAMLreturn (Val_int (r));
508 /* Automatically generated binding for virConnectListDefinedStoragePools.
509 * In generator.pl this function has signature "conn, int : string array".
512 #ifdef HAVE_WEAK_SYMBOLS
513 #ifdef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
514 extern int virConnectListDefinedStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
519 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
521 CAMLparam2 (connv, iv);
522 #ifndef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
523 /* Symbol virConnectListDefinedStoragePools not found at compile time. */
524 not_supported ("virConnectListDefinedStoragePools");
527 /* Check that the symbol virConnectListDefinedStoragePools
528 * is in runtime version of libvirt.
530 WEAK_SYMBOL_CHECK (virConnectListDefinedStoragePools);
532 CAMLlocal2 (rv, strv);
533 virConnectPtr conn = Connect_val (connv);
534 int i = Int_val (iv);
538 /* Some libvirt List* functions still throw exceptions if i == 0,
539 * so catch that and return an empty array directly. This changes
540 * the semantics slightly (masking other failures) but it's
541 * unlikely anyone will care. RWMJ 2008/06/10
544 rv = caml_alloc (0, 0);
548 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
549 CHECK_ERROR (r == -1, conn, "virConnectListDefinedStoragePools");
551 rv = caml_alloc (r, 0);
552 for (i = 0; i < r; ++i) {
553 strv = caml_copy_string (names[i]);
554 Store_field (rv, i, strv);
562 /* Automatically generated binding for virConnectGetCapabilities.
563 * In generator.pl this function has signature "conn : string".
567 ocaml_libvirt_connect_get_capabilities (value connv)
572 virConnectPtr conn = Connect_val (connv);
575 NONBLOCKING (r = virConnectGetCapabilities (conn));
576 CHECK_ERROR (!r, conn, "virConnectGetCapabilities");
578 rv = caml_copy_string (r);
583 /* Automatically generated binding for virDomainCreateLinux.
584 * In generator.pl this function has signature "conn, string, 0U : dom".
588 ocaml_libvirt_domain_create_linux (value connv, value strv)
590 CAMLparam2 (connv, strv);
593 virConnectPtr conn = Connect_val (connv);
594 char *str = String_val (strv);
597 NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
598 CHECK_ERROR (!r, conn, "virDomainCreateLinux");
600 rv = Val_domain (r, connv);
605 /* Automatically generated binding for virDomainFree.
606 * In generator.pl this function has signature "dom : free".
610 ocaml_libvirt_domain_free (value domv)
614 virDomainPtr dom = Domain_val (domv);
615 virConnectPtr conn = Connect_domv (domv);
618 NONBLOCKING (r = virDomainFree (dom));
619 CHECK_ERROR (r == -1, conn, "virDomainFree");
621 /* So that we don't double-free in the finalizer: */
622 Domain_val (domv) = NULL;
624 CAMLreturn (Val_unit);
627 /* Automatically generated binding for virDomainDestroy.
628 * In generator.pl this function has signature "dom : free".
632 ocaml_libvirt_domain_destroy (value domv)
636 virDomainPtr dom = Domain_val (domv);
637 virConnectPtr conn = Connect_domv (domv);
640 NONBLOCKING (r = virDomainDestroy (dom));
641 CHECK_ERROR (r == -1, conn, "virDomainDestroy");
643 /* So that we don't double-free in the finalizer: */
644 Domain_val (domv) = NULL;
646 CAMLreturn (Val_unit);
649 /* Automatically generated binding for virDomainLookupByName.
650 * In generator.pl this function has signature "conn, string : dom".
654 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
656 CAMLparam2 (connv, strv);
659 virConnectPtr conn = Connect_val (connv);
660 char *str = String_val (strv);
663 NONBLOCKING (r = virDomainLookupByName (conn, str));
664 CHECK_ERROR (!r, conn, "virDomainLookupByName");
666 rv = Val_domain (r, connv);
671 /* Automatically generated binding for virDomainLookupByID.
672 * In generator.pl this function has signature "conn, int : dom".
676 ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
678 CAMLparam2 (connv, iv);
681 virConnectPtr conn = Connect_val (connv);
682 int i = Int_val (iv);
685 NONBLOCKING (r = virDomainLookupByID (conn, i));
686 CHECK_ERROR (!r, conn, "virDomainLookupByID");
688 rv = Val_domain (r, connv);
693 /* Automatically generated binding for virDomainLookupByUUID.
694 * In generator.pl this function has signature "conn, uuid : dom".
698 ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
700 CAMLparam2 (connv, uuidv);
703 virConnectPtr conn = Connect_val (connv);
704 unsigned char *uuid = (unsigned char *) String_val (uuidv);
707 NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
708 CHECK_ERROR (!r, conn, "virDomainLookupByUUID");
710 rv = Val_domain (r, connv);
715 /* Automatically generated binding for virDomainLookupByUUIDString.
716 * In generator.pl this function has signature "conn, string : dom".
720 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
722 CAMLparam2 (connv, strv);
725 virConnectPtr conn = Connect_val (connv);
726 char *str = String_val (strv);
729 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
730 CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
732 rv = Val_domain (r, connv);
737 /* Automatically generated binding for virDomainGetName.
738 * In generator.pl this function has signature "dom : static string".
742 ocaml_libvirt_domain_get_name (value domv)
747 virDomainPtr dom = Domain_val (domv);
748 virConnectPtr conn = Connect_domv (domv);
751 NONBLOCKING (r = virDomainGetName (dom));
752 CHECK_ERROR (!r, conn, "virDomainGetName");
754 rv = caml_copy_string (r);
758 /* Automatically generated binding for virDomainGetOSType.
759 * In generator.pl this function has signature "dom : string".
763 ocaml_libvirt_domain_get_os_type (value domv)
768 virDomainPtr dom = Domain_val (domv);
769 virConnectPtr conn = Connect_domv (domv);
772 NONBLOCKING (r = virDomainGetOSType (dom));
773 CHECK_ERROR (!r, conn, "virDomainGetOSType");
775 rv = caml_copy_string (r);
780 /* Automatically generated binding for virDomainGetXMLDesc.
781 * In generator.pl this function has signature "dom, 0 : string".
785 ocaml_libvirt_domain_get_xml_desc (value domv)
790 virDomainPtr dom = Domain_val (domv);
791 virConnectPtr conn = Connect_domv (domv);
794 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
795 CHECK_ERROR (!r, conn, "virDomainGetXMLDesc");
797 rv = caml_copy_string (r);
802 /* Automatically generated binding for virDomainGetUUID.
803 * In generator.pl this function has signature "dom : uuid".
807 ocaml_libvirt_domain_get_uuid (value domv)
812 virDomainPtr dom = Domain_val (domv);
813 virConnectPtr conn = Connect_domv (domv);
814 unsigned char uuid[VIR_UUID_BUFLEN];
817 NONBLOCKING (r = virDomainGetUUID (dom, uuid));
818 CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
820 /* UUIDs are byte arrays with a fixed length. */
821 rv = caml_alloc_string (VIR_UUID_BUFLEN);
822 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
826 /* Automatically generated binding for virDomainGetUUIDString.
827 * In generator.pl this function has signature "dom : uuid string".
831 ocaml_libvirt_domain_get_uuid_string (value domv)
836 virDomainPtr dom = Domain_val (domv);
837 virConnectPtr conn = Connect_domv (domv);
838 char uuid[VIR_UUID_STRING_BUFLEN];
841 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
842 CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
844 rv = caml_copy_string (uuid);
848 /* Automatically generated binding for virDomainGetMaxVcpus.
849 * In generator.pl this function has signature "dom : int".
853 ocaml_libvirt_domain_get_max_vcpus (value domv)
857 virDomainPtr dom = Domain_val (domv);
858 virConnectPtr conn = Connect_domv (domv);
861 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
862 CHECK_ERROR (r == -1, conn, "virDomainGetMaxVcpus");
864 CAMLreturn (Val_int (r));
867 /* Automatically generated binding for virDomainSave.
868 * In generator.pl this function has signature "dom, string : unit".
872 ocaml_libvirt_domain_save (value domv, value strv)
874 CAMLparam2 (domv, strv);
876 virDomainPtr dom = Domain_val (domv);
877 virConnectPtr conn = Connect_domv (domv);
878 char *str = String_val (strv);
881 NONBLOCKING (r = virDomainSave (dom, str));
882 CHECK_ERROR (r == -1, conn, "virDomainSave");
884 CAMLreturn (Val_unit);
887 /* Automatically generated binding for virDomainRestore.
888 * In generator.pl this function has signature "conn, string : unit".
892 ocaml_libvirt_domain_restore (value connv, value strv)
894 CAMLparam2 (connv, strv);
896 virConnectPtr conn = Connect_val (connv);
897 char *str = String_val (strv);
900 NONBLOCKING (r = virDomainRestore (conn, str));
901 CHECK_ERROR (r == -1, conn, "virDomainRestore");
903 CAMLreturn (Val_unit);
906 /* Automatically generated binding for virDomainCoreDump.
907 * In generator.pl this function has signature "dom, string, 0 : unit".
911 ocaml_libvirt_domain_core_dump (value domv, value strv)
913 CAMLparam2 (domv, strv);
916 virDomainPtr dom = Domain_val (domv);
917 virConnectPtr conn = Connect_domv (domv);
918 char *str = String_val (strv);
921 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
922 CHECK_ERROR (!r, conn, "virDomainCoreDump");
924 CAMLreturn (Val_unit);
927 /* Automatically generated binding for virDomainSuspend.
928 * In generator.pl this function has signature "dom : unit".
932 ocaml_libvirt_domain_suspend (value domv)
936 virDomainPtr dom = Domain_val (domv);
937 virConnectPtr conn = Connect_domv (domv);
940 NONBLOCKING (r = virDomainSuspend (dom));
941 CHECK_ERROR (r == -1, conn, "virDomainSuspend");
943 CAMLreturn (Val_unit);
946 /* Automatically generated binding for virDomainResume.
947 * In generator.pl this function has signature "dom : unit".
951 ocaml_libvirt_domain_resume (value domv)
955 virDomainPtr dom = Domain_val (domv);
956 virConnectPtr conn = Connect_domv (domv);
959 NONBLOCKING (r = virDomainResume (dom));
960 CHECK_ERROR (r == -1, conn, "virDomainResume");
962 CAMLreturn (Val_unit);
965 /* Automatically generated binding for virDomainShutdown.
966 * In generator.pl this function has signature "dom : unit".
970 ocaml_libvirt_domain_shutdown (value domv)
974 virDomainPtr dom = Domain_val (domv);
975 virConnectPtr conn = Connect_domv (domv);
978 NONBLOCKING (r = virDomainShutdown (dom));
979 CHECK_ERROR (r == -1, conn, "virDomainShutdown");
981 CAMLreturn (Val_unit);
984 /* Automatically generated binding for virDomainReboot.
985 * In generator.pl this function has signature "dom, 0 : unit".
989 ocaml_libvirt_domain_reboot (value domv)
993 virDomainPtr dom = Domain_val (domv);
994 virConnectPtr conn = Connect_domv (domv);
997 NONBLOCKING (r = virDomainReboot (dom, 0));
998 CHECK_ERROR (r == -1, conn, "virDomainReboot");
1000 CAMLreturn (Val_unit);
1003 /* Automatically generated binding for virDomainDefineXML.
1004 * In generator.pl this function has signature "conn, string : dom".
1008 ocaml_libvirt_domain_define_xml (value connv, value strv)
1010 CAMLparam2 (connv, strv);
1013 virConnectPtr conn = Connect_val (connv);
1014 char *str = String_val (strv);
1017 NONBLOCKING (r = virDomainDefineXML (conn, str));
1018 CHECK_ERROR (!r, conn, "virDomainDefineXML");
1020 rv = Val_domain (r, connv);
1025 /* Automatically generated binding for virDomainUndefine.
1026 * In generator.pl this function has signature "dom : unit".
1030 ocaml_libvirt_domain_undefine (value domv)
1034 virDomainPtr dom = Domain_val (domv);
1035 virConnectPtr conn = Connect_domv (domv);
1038 NONBLOCKING (r = virDomainUndefine (dom));
1039 CHECK_ERROR (r == -1, conn, "virDomainUndefine");
1041 CAMLreturn (Val_unit);
1044 /* Automatically generated binding for virDomainCreate.
1045 * In generator.pl this function has signature "dom : unit".
1049 ocaml_libvirt_domain_create (value domv)
1053 virDomainPtr dom = Domain_val (domv);
1054 virConnectPtr conn = Connect_domv (domv);
1057 NONBLOCKING (r = virDomainCreate (dom));
1058 CHECK_ERROR (r == -1, conn, "virDomainCreate");
1060 CAMLreturn (Val_unit);
1063 /* Automatically generated binding for virDomainAttachDevice.
1064 * In generator.pl this function has signature "dom, string : unit".
1068 ocaml_libvirt_domain_attach_device (value domv, value strv)
1070 CAMLparam2 (domv, strv);
1072 virDomainPtr dom = Domain_val (domv);
1073 virConnectPtr conn = Connect_domv (domv);
1074 char *str = String_val (strv);
1077 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1078 CHECK_ERROR (r == -1, conn, "virDomainAttachDevice");
1080 CAMLreturn (Val_unit);
1083 /* Automatically generated binding for virDomainDetachDevice.
1084 * In generator.pl this function has signature "dom, string : unit".
1088 ocaml_libvirt_domain_detach_device (value domv, value strv)
1090 CAMLparam2 (domv, strv);
1092 virDomainPtr dom = Domain_val (domv);
1093 virConnectPtr conn = Connect_domv (domv);
1094 char *str = String_val (strv);
1097 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1098 CHECK_ERROR (r == -1, conn, "virDomainDetachDevice");
1100 CAMLreturn (Val_unit);
1103 /* Automatically generated binding for virDomainGetAutostart.
1104 * In generator.pl this function has signature "dom : bool".
1108 ocaml_libvirt_domain_get_autostart (value domv)
1112 virDomainPtr dom = Domain_val (domv);
1113 virConnectPtr conn = Connect_domv (domv);
1116 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1117 CHECK_ERROR (r == -1, conn, "virDomainGetAutostart");
1119 CAMLreturn (b ? Val_true : Val_false);
1122 /* Automatically generated binding for virDomainSetAutostart.
1123 * In generator.pl this function has signature "dom, bool : unit".
1127 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1129 CAMLparam2 (domv, bv);
1131 virDomainPtr dom = Domain_val (domv);
1132 virConnectPtr conn = Connect_domv (domv);
1135 b = bv == Val_true ? 1 : 0;
1137 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1138 CHECK_ERROR (r == -1, conn, "virDomainSetAutostart");
1140 CAMLreturn (Val_unit);
1143 /* Automatically generated binding for virNetworkFree.
1144 * In generator.pl this function has signature "net : free".
1148 ocaml_libvirt_network_free (value netv)
1152 virNetworkPtr net = Network_val (netv);
1153 virConnectPtr conn = Connect_netv (netv);
1156 NONBLOCKING (r = virNetworkFree (net));
1157 CHECK_ERROR (r == -1, conn, "virNetworkFree");
1159 /* So that we don't double-free in the finalizer: */
1160 Network_val (netv) = NULL;
1162 CAMLreturn (Val_unit);
1165 /* Automatically generated binding for virNetworkDestroy.
1166 * In generator.pl this function has signature "net : free".
1170 ocaml_libvirt_network_destroy (value netv)
1174 virNetworkPtr net = Network_val (netv);
1175 virConnectPtr conn = Connect_netv (netv);
1178 NONBLOCKING (r = virNetworkDestroy (net));
1179 CHECK_ERROR (r == -1, conn, "virNetworkDestroy");
1181 /* So that we don't double-free in the finalizer: */
1182 Network_val (netv) = NULL;
1184 CAMLreturn (Val_unit);
1187 /* Automatically generated binding for virNetworkLookupByName.
1188 * In generator.pl this function has signature "conn, string : net".
1192 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1194 CAMLparam2 (connv, strv);
1197 virConnectPtr conn = Connect_val (connv);
1198 char *str = String_val (strv);
1201 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1202 CHECK_ERROR (!r, conn, "virNetworkLookupByName");
1204 rv = Val_network (r, connv);
1209 /* Automatically generated binding for virNetworkLookupByUUID.
1210 * In generator.pl this function has signature "conn, uuid : net".
1214 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1216 CAMLparam2 (connv, uuidv);
1219 virConnectPtr conn = Connect_val (connv);
1220 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1223 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1224 CHECK_ERROR (!r, conn, "virNetworkLookupByUUID");
1226 rv = Val_network (r, connv);
1231 /* Automatically generated binding for virNetworkLookupByUUIDString.
1232 * In generator.pl this function has signature "conn, string : net".
1236 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1238 CAMLparam2 (connv, strv);
1241 virConnectPtr conn = Connect_val (connv);
1242 char *str = String_val (strv);
1245 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1246 CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
1248 rv = Val_network (r, connv);
1253 /* Automatically generated binding for virNetworkGetName.
1254 * In generator.pl this function has signature "net : static string".
1258 ocaml_libvirt_network_get_name (value netv)
1263 virNetworkPtr net = Network_val (netv);
1264 virConnectPtr conn = Connect_netv (netv);
1267 NONBLOCKING (r = virNetworkGetName (net));
1268 CHECK_ERROR (!r, conn, "virNetworkGetName");
1270 rv = caml_copy_string (r);
1274 /* Automatically generated binding for virNetworkGetXMLDesc.
1275 * In generator.pl this function has signature "net, 0 : string".
1279 ocaml_libvirt_network_get_xml_desc (value netv)
1284 virNetworkPtr net = Network_val (netv);
1285 virConnectPtr conn = Connect_netv (netv);
1288 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1289 CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
1291 rv = caml_copy_string (r);
1296 /* Automatically generated binding for virNetworkGetBridgeName.
1297 * In generator.pl this function has signature "net : string".
1301 ocaml_libvirt_network_get_bridge_name (value netv)
1306 virNetworkPtr net = Network_val (netv);
1307 virConnectPtr conn = Connect_netv (netv);
1310 NONBLOCKING (r = virNetworkGetBridgeName (net));
1311 CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
1313 rv = caml_copy_string (r);
1318 /* Automatically generated binding for virNetworkGetUUID.
1319 * In generator.pl this function has signature "net : uuid".
1323 ocaml_libvirt_network_get_uuid (value netv)
1328 virNetworkPtr net = Network_val (netv);
1329 virConnectPtr conn = Connect_netv (netv);
1330 unsigned char uuid[VIR_UUID_BUFLEN];
1333 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1334 CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
1336 /* UUIDs are byte arrays with a fixed length. */
1337 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1338 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1342 /* Automatically generated binding for virNetworkGetUUIDString.
1343 * In generator.pl this function has signature "net : uuid string".
1347 ocaml_libvirt_network_get_uuid_string (value netv)
1352 virNetworkPtr net = Network_val (netv);
1353 virConnectPtr conn = Connect_netv (netv);
1354 char uuid[VIR_UUID_STRING_BUFLEN];
1357 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1358 CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
1360 rv = caml_copy_string (uuid);
1364 /* Automatically generated binding for virNetworkUndefine.
1365 * In generator.pl this function has signature "net : unit".
1369 ocaml_libvirt_network_undefine (value netv)
1373 virNetworkPtr net = Network_val (netv);
1374 virConnectPtr conn = Connect_netv (netv);
1377 NONBLOCKING (r = virNetworkUndefine (net));
1378 CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
1380 CAMLreturn (Val_unit);
1383 /* Automatically generated binding for virNetworkCreateXML.
1384 * In generator.pl this function has signature "conn, string : net".
1388 ocaml_libvirt_network_create_xml (value connv, value strv)
1390 CAMLparam2 (connv, strv);
1393 virConnectPtr conn = Connect_val (connv);
1394 char *str = String_val (strv);
1397 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1398 CHECK_ERROR (!r, conn, "virNetworkCreateXML");
1400 rv = Val_network (r, connv);
1405 /* Automatically generated binding for virNetworkDefineXML.
1406 * In generator.pl this function has signature "conn, string : net".
1410 ocaml_libvirt_network_define_xml (value connv, value strv)
1412 CAMLparam2 (connv, strv);
1415 virConnectPtr conn = Connect_val (connv);
1416 char *str = String_val (strv);
1419 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1420 CHECK_ERROR (!r, conn, "virNetworkDefineXML");
1422 rv = Val_network (r, connv);
1427 /* Automatically generated binding for virNetworkCreate.
1428 * In generator.pl this function has signature "net : unit".
1432 ocaml_libvirt_network_create (value netv)
1436 virNetworkPtr net = Network_val (netv);
1437 virConnectPtr conn = Connect_netv (netv);
1440 NONBLOCKING (r = virNetworkCreate (net));
1441 CHECK_ERROR (r == -1, conn, "virNetworkCreate");
1443 CAMLreturn (Val_unit);
1446 /* Automatically generated binding for virNetworkGetAutostart.
1447 * In generator.pl this function has signature "net : bool".
1451 ocaml_libvirt_network_get_autostart (value netv)
1455 virNetworkPtr net = Network_val (netv);
1456 virConnectPtr conn = Connect_netv (netv);
1459 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1460 CHECK_ERROR (r == -1, conn, "virNetworkGetAutostart");
1462 CAMLreturn (b ? Val_true : Val_false);
1465 /* Automatically generated binding for virNetworkSetAutostart.
1466 * In generator.pl this function has signature "net, bool : unit".
1470 ocaml_libvirt_network_set_autostart (value netv, value bv)
1472 CAMLparam2 (netv, bv);
1474 virNetworkPtr net = Network_val (netv);
1475 virConnectPtr conn = Connect_netv (netv);
1478 b = bv == Val_true ? 1 : 0;
1480 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1481 CHECK_ERROR (r == -1, conn, "virNetworkSetAutostart");
1483 CAMLreturn (Val_unit);
1486 /* Automatically generated binding for virStoragePoolFree.
1487 * In generator.pl this function has signature "pool : free".
1490 #ifdef HAVE_WEAK_SYMBOLS
1491 #ifdef HAVE_VIRSTORAGEPOOLFREE
1492 extern int virStoragePoolFree (virStoragePoolPtr pool) __attribute__((weak));
1497 ocaml_libvirt_storage_pool_free (value poolv)
1500 #ifndef HAVE_VIRSTORAGEPOOLFREE
1501 /* Symbol virStoragePoolFree not found at compile time. */
1502 not_supported ("virStoragePoolFree");
1505 /* Check that the symbol virStoragePoolFree
1506 * is in runtime version of libvirt.
1508 WEAK_SYMBOL_CHECK (virStoragePoolFree);
1510 virStoragePoolPtr pool = Pool_val (poolv);
1511 virConnectPtr conn = Connect_polv (poolv);
1514 NONBLOCKING (r = virStoragePoolFree (pool));
1515 CHECK_ERROR (r == -1, conn, "virStoragePoolFree");
1517 /* So that we don't double-free in the finalizer: */
1518 Pool_val (poolv) = NULL;
1520 CAMLreturn (Val_unit);
1524 /* Automatically generated binding for virStoragePoolDestroy.
1525 * In generator.pl this function has signature "pool : free".
1528 #ifdef HAVE_WEAK_SYMBOLS
1529 #ifdef HAVE_VIRSTORAGEPOOLDESTROY
1530 extern int virStoragePoolDestroy (virStoragePoolPtr pool) __attribute__((weak));
1535 ocaml_libvirt_storage_pool_destroy (value poolv)
1538 #ifndef HAVE_VIRSTORAGEPOOLDESTROY
1539 /* Symbol virStoragePoolDestroy not found at compile time. */
1540 not_supported ("virStoragePoolDestroy");
1543 /* Check that the symbol virStoragePoolDestroy
1544 * is in runtime version of libvirt.
1546 WEAK_SYMBOL_CHECK (virStoragePoolDestroy);
1548 virStoragePoolPtr pool = Pool_val (poolv);
1549 virConnectPtr conn = Connect_polv (poolv);
1552 NONBLOCKING (r = virStoragePoolDestroy (pool));
1553 CHECK_ERROR (r == -1, conn, "virStoragePoolDestroy");
1555 /* So that we don't double-free in the finalizer: */
1556 Pool_val (poolv) = NULL;
1558 CAMLreturn (Val_unit);
1562 /* Automatically generated binding for virStoragePoolLookupByName.
1563 * In generator.pl this function has signature "conn, string : pool".
1566 #ifdef HAVE_WEAK_SYMBOLS
1567 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1568 extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, const char *str) __attribute__((weak));
1573 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1575 CAMLparam2 (connv, strv);
1576 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1577 /* Symbol virStoragePoolLookupByName not found at compile time. */
1578 not_supported ("virStoragePoolLookupByName");
1581 /* Check that the symbol virStoragePoolLookupByName
1582 * is in runtime version of libvirt.
1584 WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
1587 virConnectPtr conn = Connect_val (connv);
1588 char *str = String_val (strv);
1589 virStoragePoolPtr r;
1591 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1592 CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
1594 rv = Val_pool (r, connv);
1600 /* Automatically generated binding for virStoragePoolLookupByUUID.
1601 * In generator.pl this function has signature "conn, uuid : pool".
1604 #ifdef HAVE_WEAK_SYMBOLS
1605 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1606 extern virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, const unsigned char *str) __attribute__((weak));
1611 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1613 CAMLparam2 (connv, uuidv);
1614 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1615 /* Symbol virStoragePoolLookupByUUID not found at compile time. */
1616 not_supported ("virStoragePoolLookupByUUID");
1619 /* Check that the symbol virStoragePoolLookupByUUID
1620 * is in runtime version of libvirt.
1622 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUID);
1625 virConnectPtr conn = Connect_val (connv);
1626 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1627 virStoragePoolPtr r;
1629 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1630 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUID");
1632 rv = Val_pool (r, connv);
1638 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1639 * In generator.pl this function has signature "conn, string : pool".
1642 #ifdef HAVE_WEAK_SYMBOLS
1643 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1644 extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn, const char *str) __attribute__((weak));
1649 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1651 CAMLparam2 (connv, strv);
1652 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1653 /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
1654 not_supported ("virStoragePoolLookupByUUIDString");
1657 /* Check that the symbol virStoragePoolLookupByUUIDString
1658 * is in runtime version of libvirt.
1660 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
1663 virConnectPtr conn = Connect_val (connv);
1664 char *str = String_val (strv);
1665 virStoragePoolPtr r;
1667 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1668 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
1670 rv = Val_pool (r, connv);
1676 /* Automatically generated binding for virStoragePoolGetName.
1677 * In generator.pl this function has signature "pool : static string".
1680 #ifdef HAVE_WEAK_SYMBOLS
1681 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
1682 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
1687 ocaml_libvirt_storage_pool_get_name (value poolv)
1690 #ifndef HAVE_VIRSTORAGEPOOLGETNAME
1691 /* Symbol virStoragePoolGetName not found at compile time. */
1692 not_supported ("virStoragePoolGetName");
1695 /* Check that the symbol virStoragePoolGetName
1696 * is in runtime version of libvirt.
1698 WEAK_SYMBOL_CHECK (virStoragePoolGetName);
1701 virStoragePoolPtr pool = Pool_val (poolv);
1702 virConnectPtr conn = Connect_polv (poolv);
1705 NONBLOCKING (r = virStoragePoolGetName (pool));
1706 CHECK_ERROR (!r, conn, "virStoragePoolGetName");
1708 rv = caml_copy_string (r);
1713 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1714 * In generator.pl this function has signature "pool, 0U : string".
1717 #ifdef HAVE_WEAK_SYMBOLS
1718 #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC
1719 extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
1724 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1727 #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC
1728 /* Symbol virStoragePoolGetXMLDesc not found at compile time. */
1729 not_supported ("virStoragePoolGetXMLDesc");
1732 /* Check that the symbol virStoragePoolGetXMLDesc
1733 * is in runtime version of libvirt.
1735 WEAK_SYMBOL_CHECK (virStoragePoolGetXMLDesc);
1738 virStoragePoolPtr pool = Pool_val (poolv);
1739 virConnectPtr conn = Connect_polv (poolv);
1742 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1743 CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
1745 rv = caml_copy_string (r);
1751 /* Automatically generated binding for virStoragePoolGetUUID.
1752 * In generator.pl this function has signature "pool : uuid".
1755 #ifdef HAVE_WEAK_SYMBOLS
1756 #ifdef HAVE_VIRSTORAGEPOOLGETUUID
1757 extern int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *) __attribute__((weak));
1762 ocaml_libvirt_storage_pool_get_uuid (value poolv)
1765 #ifndef HAVE_VIRSTORAGEPOOLGETUUID
1766 /* Symbol virStoragePoolGetUUID not found at compile time. */
1767 not_supported ("virStoragePoolGetUUID");
1770 /* Check that the symbol virStoragePoolGetUUID
1771 * is in runtime version of libvirt.
1773 WEAK_SYMBOL_CHECK (virStoragePoolGetUUID);
1776 virStoragePoolPtr pool = Pool_val (poolv);
1777 virConnectPtr conn = Connect_polv (poolv);
1778 unsigned char uuid[VIR_UUID_BUFLEN];
1781 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
1782 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
1784 /* UUIDs are byte arrays with a fixed length. */
1785 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1786 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1791 /* Automatically generated binding for virStoragePoolGetUUIDString.
1792 * In generator.pl this function has signature "pool : uuid string".
1795 #ifdef HAVE_WEAK_SYMBOLS
1796 #ifdef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
1797 extern int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *) __attribute__((weak));
1802 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
1805 #ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
1806 /* Symbol virStoragePoolGetUUIDString not found at compile time. */
1807 not_supported ("virStoragePoolGetUUIDString");
1810 /* Check that the symbol virStoragePoolGetUUIDString
1811 * is in runtime version of libvirt.
1813 WEAK_SYMBOL_CHECK (virStoragePoolGetUUIDString);
1816 virStoragePoolPtr pool = Pool_val (poolv);
1817 virConnectPtr conn = Connect_polv (poolv);
1818 char uuid[VIR_UUID_STRING_BUFLEN];
1821 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
1822 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
1824 rv = caml_copy_string (uuid);
1829 /* Automatically generated binding for virStoragePoolCreateXML.
1830 * In generator.pl this function has signature "conn, string, 0U : pool".
1833 #ifdef HAVE_WEAK_SYMBOLS
1834 #ifdef HAVE_VIRSTORAGEPOOLCREATEXML
1835 extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
1840 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
1842 CAMLparam2 (connv, strv);
1843 #ifndef HAVE_VIRSTORAGEPOOLCREATEXML
1844 /* Symbol virStoragePoolCreateXML not found at compile time. */
1845 not_supported ("virStoragePoolCreateXML");
1848 /* Check that the symbol virStoragePoolCreateXML
1849 * is in runtime version of libvirt.
1851 WEAK_SYMBOL_CHECK (virStoragePoolCreateXML);
1854 virConnectPtr conn = Connect_val (connv);
1855 char *str = String_val (strv);
1856 virStoragePoolPtr r;
1858 NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0));
1859 CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
1861 rv = Val_pool (r, connv);
1867 /* Automatically generated binding for virStoragePoolDefineXML.
1868 * In generator.pl this function has signature "conn, string, 0U : pool".
1871 #ifdef HAVE_WEAK_SYMBOLS
1872 #ifdef HAVE_VIRSTORAGEPOOLDEFINEXML
1873 extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
1878 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
1880 CAMLparam2 (connv, strv);
1881 #ifndef HAVE_VIRSTORAGEPOOLDEFINEXML
1882 /* Symbol virStoragePoolDefineXML not found at compile time. */
1883 not_supported ("virStoragePoolDefineXML");
1886 /* Check that the symbol virStoragePoolDefineXML
1887 * is in runtime version of libvirt.
1889 WEAK_SYMBOL_CHECK (virStoragePoolDefineXML);
1892 virConnectPtr conn = Connect_val (connv);
1893 char *str = String_val (strv);
1894 virStoragePoolPtr r;
1896 NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0));
1897 CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
1899 rv = Val_pool (r, connv);
1905 /* Automatically generated binding for virStoragePoolBuild.
1906 * In generator.pl this function has signature "pool, uint : unit".
1909 #ifdef HAVE_WEAK_SYMBOLS
1910 #ifdef HAVE_VIRSTORAGEPOOLBUILD
1911 extern int virStoragePoolBuild (virStoragePoolPtr pool, unsigned int i) __attribute__((weak));
1916 ocaml_libvirt_storage_pool_build (value poolv, value iv)
1918 CAMLparam2 (poolv, iv);
1919 #ifndef HAVE_VIRSTORAGEPOOLBUILD
1920 /* Symbol virStoragePoolBuild not found at compile time. */
1921 not_supported ("virStoragePoolBuild");
1924 /* Check that the symbol virStoragePoolBuild
1925 * is in runtime version of libvirt.
1927 WEAK_SYMBOL_CHECK (virStoragePoolBuild);
1929 virStoragePoolPtr pool = Pool_val (poolv);
1930 virConnectPtr conn = Connect_polv (poolv);
1931 unsigned int i = Int_val (iv);
1934 NONBLOCKING (r = virStoragePoolBuild (pool, i));
1935 CHECK_ERROR (r == -1, conn, "virStoragePoolBuild");
1937 CAMLreturn (Val_unit);
1941 /* Automatically generated binding for virStoragePoolUndefine.
1942 * In generator.pl this function has signature "pool : unit".
1945 #ifdef HAVE_WEAK_SYMBOLS
1946 #ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
1947 extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
1952 ocaml_libvirt_storage_pool_undefine (value poolv)
1955 #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
1956 /* Symbol virStoragePoolUndefine not found at compile time. */
1957 not_supported ("virStoragePoolUndefine");
1960 /* Check that the symbol virStoragePoolUndefine
1961 * is in runtime version of libvirt.
1963 WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
1965 virStoragePoolPtr pool = Pool_val (poolv);
1966 virConnectPtr conn = Connect_polv (poolv);
1969 NONBLOCKING (r = virStoragePoolUndefine (pool));
1970 CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
1972 CAMLreturn (Val_unit);
1976 /* Automatically generated binding for virStoragePoolCreate.
1977 * In generator.pl this function has signature "pool, 0U : unit".
1980 #ifdef HAVE_WEAK_SYMBOLS
1981 #ifdef HAVE_VIRSTORAGEPOOLCREATE
1982 extern int virStoragePoolCreate (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
1987 ocaml_libvirt_storage_pool_create (value poolv)
1990 #ifndef HAVE_VIRSTORAGEPOOLCREATE
1991 /* Symbol virStoragePoolCreate not found at compile time. */
1992 not_supported ("virStoragePoolCreate");
1995 /* Check that the symbol virStoragePoolCreate
1996 * is in runtime version of libvirt.
1998 WEAK_SYMBOL_CHECK (virStoragePoolCreate);
2000 virStoragePoolPtr pool = Pool_val (poolv);
2001 virConnectPtr conn = Connect_polv (poolv);
2004 NONBLOCKING (r = virStoragePoolCreate (pool, 0));
2005 CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
2007 CAMLreturn (Val_unit);
2011 /* Automatically generated binding for virStoragePoolDelete.
2012 * In generator.pl this function has signature "pool, uint : unit".
2015 #ifdef HAVE_WEAK_SYMBOLS
2016 #ifdef HAVE_VIRSTORAGEPOOLDELETE
2017 extern int virStoragePoolDelete (virStoragePoolPtr pool, unsigned int i) __attribute__((weak));
2022 ocaml_libvirt_storage_pool_delete (value poolv, value iv)
2024 CAMLparam2 (poolv, iv);
2025 #ifndef HAVE_VIRSTORAGEPOOLDELETE
2026 /* Symbol virStoragePoolDelete not found at compile time. */
2027 not_supported ("virStoragePoolDelete");
2030 /* Check that the symbol virStoragePoolDelete
2031 * is in runtime version of libvirt.
2033 WEAK_SYMBOL_CHECK (virStoragePoolDelete);
2035 virStoragePoolPtr pool = Pool_val (poolv);
2036 virConnectPtr conn = Connect_polv (poolv);
2037 unsigned int i = Int_val (iv);
2040 NONBLOCKING (r = virStoragePoolDelete (pool, i));
2041 CHECK_ERROR (r == -1, conn, "virStoragePoolDelete");
2043 CAMLreturn (Val_unit);
2047 /* Automatically generated binding for virStoragePoolRefresh.
2048 * In generator.pl this function has signature "pool, 0U : unit".
2051 #ifdef HAVE_WEAK_SYMBOLS
2052 #ifdef HAVE_VIRSTORAGEPOOLREFRESH
2053 extern int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
2058 ocaml_libvirt_storage_pool_refresh (value poolv)
2061 #ifndef HAVE_VIRSTORAGEPOOLREFRESH
2062 /* Symbol virStoragePoolRefresh not found at compile time. */
2063 not_supported ("virStoragePoolRefresh");
2066 /* Check that the symbol virStoragePoolRefresh
2067 * is in runtime version of libvirt.
2069 WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
2071 virStoragePoolPtr pool = Pool_val (poolv);
2072 virConnectPtr conn = Connect_polv (poolv);
2075 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
2076 CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
2078 CAMLreturn (Val_unit);
2082 /* Automatically generated binding for virStoragePoolGetAutostart.
2083 * In generator.pl this function has signature "pool : bool".
2086 #ifdef HAVE_WEAK_SYMBOLS
2087 #ifdef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2088 extern int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *r) __attribute__((weak));
2093 ocaml_libvirt_storage_pool_get_autostart (value poolv)
2096 #ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2097 /* Symbol virStoragePoolGetAutostart not found at compile time. */
2098 not_supported ("virStoragePoolGetAutostart");
2101 /* Check that the symbol virStoragePoolGetAutostart
2102 * is in runtime version of libvirt.
2104 WEAK_SYMBOL_CHECK (virStoragePoolGetAutostart);
2106 virStoragePoolPtr pool = Pool_val (poolv);
2107 virConnectPtr conn = Connect_polv (poolv);
2110 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
2111 CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
2113 CAMLreturn (b ? Val_true : Val_false);
2117 /* Automatically generated binding for virStoragePoolSetAutostart.
2118 * In generator.pl this function has signature "pool, bool : unit".
2121 #ifdef HAVE_WEAK_SYMBOLS
2122 #ifdef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2123 extern int virStoragePoolSetAutostart (virStoragePoolPtr pool, int b) __attribute__((weak));
2128 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
2130 CAMLparam2 (poolv, bv);
2131 #ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2132 /* Symbol virStoragePoolSetAutostart not found at compile time. */
2133 not_supported ("virStoragePoolSetAutostart");
2136 /* Check that the symbol virStoragePoolSetAutostart
2137 * is in runtime version of libvirt.
2139 WEAK_SYMBOL_CHECK (virStoragePoolSetAutostart);
2141 virStoragePoolPtr pool = Pool_val (poolv);
2142 virConnectPtr conn = Connect_polv (poolv);
2145 b = bv == Val_true ? 1 : 0;
2147 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
2148 CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
2150 CAMLreturn (Val_unit);
2154 /* Automatically generated binding for virStoragePoolNumOfVolumes.
2155 * In generator.pl this function has signature "pool : int".
2158 #ifdef HAVE_WEAK_SYMBOLS
2159 #ifdef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
2160 extern int virStoragePoolNumOfVolumes (virStoragePoolPtr pool) __attribute__((weak));
2165 ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
2168 #ifndef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
2169 /* Symbol virStoragePoolNumOfVolumes not found at compile time. */
2170 not_supported ("virStoragePoolNumOfVolumes");
2173 /* Check that the symbol virStoragePoolNumOfVolumes
2174 * is in runtime version of libvirt.
2176 WEAK_SYMBOL_CHECK (virStoragePoolNumOfVolumes);
2178 virStoragePoolPtr pool = Pool_val (poolv);
2179 virConnectPtr conn = Connect_polv (poolv);
2182 NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
2183 CHECK_ERROR (r == -1, conn, "virStoragePoolNumOfVolumes");
2185 CAMLreturn (Val_int (r));
2189 /* Automatically generated binding for virStoragePoolListVolumes.
2190 * In generator.pl this function has signature "pool, int : string array".
2193 #ifdef HAVE_WEAK_SYMBOLS
2194 #ifdef HAVE_VIRSTORAGEPOOLLISTVOLUMES
2195 extern int virStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames) __attribute__((weak));
2200 ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
2202 CAMLparam2 (poolv, iv);
2203 #ifndef HAVE_VIRSTORAGEPOOLLISTVOLUMES
2204 /* Symbol virStoragePoolListVolumes not found at compile time. */
2205 not_supported ("virStoragePoolListVolumes");
2208 /* Check that the symbol virStoragePoolListVolumes
2209 * is in runtime version of libvirt.
2211 WEAK_SYMBOL_CHECK (virStoragePoolListVolumes);
2213 CAMLlocal2 (rv, strv);
2214 virStoragePoolPtr pool = Pool_val (poolv);
2215 virConnectPtr conn = Connect_polv (poolv);
2216 int i = Int_val (iv);
2220 /* Some libvirt List* functions still throw exceptions if i == 0,
2221 * so catch that and return an empty array directly. This changes
2222 * the semantics slightly (masking other failures) but it's
2223 * unlikely anyone will care. RWMJ 2008/06/10
2226 rv = caml_alloc (0, 0);
2230 NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
2231 CHECK_ERROR (r == -1, conn, "virStoragePoolListVolumes");
2233 rv = caml_alloc (r, 0);
2234 for (i = 0; i < r; ++i) {
2235 strv = caml_copy_string (names[i]);
2236 Store_field (rv, i, strv);
2244 /* Automatically generated binding for virStorageVolFree.
2245 * In generator.pl this function has signature "vol : free".
2248 #ifdef HAVE_WEAK_SYMBOLS
2249 #ifdef HAVE_VIRSTORAGEVOLFREE
2250 extern int virStorageVolFree (virStorageVolPtr vol) __attribute__((weak));
2255 ocaml_libvirt_storage_vol_free (value volv)
2258 #ifndef HAVE_VIRSTORAGEVOLFREE
2259 /* Symbol virStorageVolFree not found at compile time. */
2260 not_supported ("virStorageVolFree");
2263 /* Check that the symbol virStorageVolFree
2264 * is in runtime version of libvirt.
2266 WEAK_SYMBOL_CHECK (virStorageVolFree);
2268 virStorageVolPtr vol = Volume_val (volv);
2269 virConnectPtr conn = Connect_volv (volv);
2272 NONBLOCKING (r = virStorageVolFree (vol));
2273 CHECK_ERROR (r == -1, conn, "virStorageVolFree");
2275 /* So that we don't double-free in the finalizer: */
2276 Volume_val (volv) = NULL;
2278 CAMLreturn (Val_unit);
2282 /* Automatically generated binding for virStorageVolDelete.
2283 * In generator.pl this function has signature "vol, uint : unit".
2286 #ifdef HAVE_WEAK_SYMBOLS
2287 #ifdef HAVE_VIRSTORAGEVOLDELETE
2288 extern int virStorageVolDelete (virStorageVolPtr vol, unsigned int i) __attribute__((weak));
2293 ocaml_libvirt_storage_vol_delete (value volv, value iv)
2295 CAMLparam2 (volv, iv);
2296 #ifndef HAVE_VIRSTORAGEVOLDELETE
2297 /* Symbol virStorageVolDelete not found at compile time. */
2298 not_supported ("virStorageVolDelete");
2301 /* Check that the symbol virStorageVolDelete
2302 * is in runtime version of libvirt.
2304 WEAK_SYMBOL_CHECK (virStorageVolDelete);
2306 virStorageVolPtr vol = Volume_val (volv);
2307 virConnectPtr conn = Connect_volv (volv);
2308 unsigned int i = Int_val (iv);
2311 NONBLOCKING (r = virStorageVolDelete (vol, i));
2312 CHECK_ERROR (r == -1, conn, "virStorageVolDelete");
2314 CAMLreturn (Val_unit);
2318 /* Automatically generated binding for virStorageVolLookupByName.
2319 * In generator.pl this function has signature "pool, string : vol from pool".
2322 #ifdef HAVE_WEAK_SYMBOLS
2323 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2324 extern virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, const char *str) __attribute__((weak));
2329 ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
2331 CAMLparam2 (poolv, strv);
2332 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2333 /* Symbol virStorageVolLookupByName not found at compile time. */
2334 not_supported ("virStorageVolLookupByName");
2337 /* Check that the symbol virStorageVolLookupByName
2338 * is in runtime version of libvirt.
2340 WEAK_SYMBOL_CHECK (virStorageVolLookupByName);
2342 CAMLlocal2 (rv, connv);
2343 virStoragePoolPtr pool = Pool_val (poolv);
2344 virConnectPtr conn = Connect_polv (poolv);
2345 char *str = String_val (strv);
2348 NONBLOCKING (r = virStorageVolLookupByName (pool, str));
2349 CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
2351 connv = Field (poolv, 1);
2352 rv = Val_volume (r, connv);
2358 /* Automatically generated binding for virStorageVolLookupByKey.
2359 * In generator.pl this function has signature "conn, string : vol".
2362 #ifdef HAVE_WEAK_SYMBOLS
2363 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2364 extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *str) __attribute__((weak));
2369 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
2371 CAMLparam2 (connv, strv);
2372 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2373 /* Symbol virStorageVolLookupByKey not found at compile time. */
2374 not_supported ("virStorageVolLookupByKey");
2377 /* Check that the symbol virStorageVolLookupByKey
2378 * is in runtime version of libvirt.
2380 WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
2383 virConnectPtr conn = Connect_val (connv);
2384 char *str = String_val (strv);
2387 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
2388 CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
2390 rv = Val_volume (r, connv);
2396 /* Automatically generated binding for virStorageVolLookupByPath.
2397 * In generator.pl this function has signature "conn, string : vol".
2400 #ifdef HAVE_WEAK_SYMBOLS
2401 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2402 extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *str) __attribute__((weak));
2407 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
2409 CAMLparam2 (connv, strv);
2410 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2411 /* Symbol virStorageVolLookupByPath not found at compile time. */
2412 not_supported ("virStorageVolLookupByPath");
2415 /* Check that the symbol virStorageVolLookupByPath
2416 * is in runtime version of libvirt.
2418 WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
2421 virConnectPtr conn = Connect_val (connv);
2422 char *str = String_val (strv);
2425 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
2426 CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
2428 rv = Val_volume (r, connv);
2434 /* Automatically generated binding for virStorageVolCreateXML.
2435 * In generator.pl this function has signature "pool, string, 0U : vol from pool".
2438 #ifdef HAVE_WEAK_SYMBOLS
2439 #ifdef HAVE_VIRSTORAGEVOLCREATEXML
2440 extern virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *str, unsigned int flags) __attribute__((weak));
2445 ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
2447 CAMLparam2 (poolv, strv);
2448 #ifndef HAVE_VIRSTORAGEVOLCREATEXML
2449 /* Symbol virStorageVolCreateXML not found at compile time. */
2450 not_supported ("virStorageVolCreateXML");
2453 /* Check that the symbol virStorageVolCreateXML
2454 * is in runtime version of libvirt.
2456 WEAK_SYMBOL_CHECK (virStorageVolCreateXML);
2458 CAMLlocal2 (rv, connv);
2459 virStoragePoolPtr pool = Pool_val (poolv);
2460 virConnectPtr conn = Connect_polv (poolv);
2461 char *str = String_val (strv);
2464 NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
2465 CHECK_ERROR (!r, conn, "virStorageVolCreateXML");
2467 connv = Field (poolv, 1);
2468 rv = Val_volume (r, connv);
2474 /* Automatically generated binding for virStorageVolGetXMLDesc.
2475 * In generator.pl this function has signature "vol, 0U : string".
2478 #ifdef HAVE_WEAK_SYMBOLS
2479 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
2480 extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, unsigned int flags) __attribute__((weak));
2485 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
2488 #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
2489 /* Symbol virStorageVolGetXMLDesc not found at compile time. */
2490 not_supported ("virStorageVolGetXMLDesc");
2493 /* Check that the symbol virStorageVolGetXMLDesc
2494 * is in runtime version of libvirt.
2496 WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
2499 virStorageVolPtr vol = Volume_val (volv);
2500 virConnectPtr conn = Connect_volv (volv);
2503 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
2504 CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
2506 rv = caml_copy_string (r);
2512 /* Automatically generated binding for virStorageVolGetPath.
2513 * In generator.pl this function has signature "vol : string".
2516 #ifdef HAVE_WEAK_SYMBOLS
2517 #ifdef HAVE_VIRSTORAGEVOLGETPATH
2518 extern char *virStorageVolGetPath (virStorageVolPtr vol) __attribute__((weak));
2523 ocaml_libvirt_storage_vol_get_path (value volv)
2526 #ifndef HAVE_VIRSTORAGEVOLGETPATH
2527 /* Symbol virStorageVolGetPath not found at compile time. */
2528 not_supported ("virStorageVolGetPath");
2531 /* Check that the symbol virStorageVolGetPath
2532 * is in runtime version of libvirt.
2534 WEAK_SYMBOL_CHECK (virStorageVolGetPath);
2537 virStorageVolPtr vol = Volume_val (volv);
2538 virConnectPtr conn = Connect_volv (volv);
2541 NONBLOCKING (r = virStorageVolGetPath (vol));
2542 CHECK_ERROR (!r, conn, "virStorageVolGetPath");
2544 rv = caml_copy_string (r);
2550 /* Automatically generated binding for virStorageVolGetKey.
2551 * In generator.pl this function has signature "vol : static string".
2554 #ifdef HAVE_WEAK_SYMBOLS
2555 #ifdef HAVE_VIRSTORAGEVOLGETKEY
2556 extern const char *virStorageVolGetKey (virStorageVolPtr vol) __attribute__((weak));
2561 ocaml_libvirt_storage_vol_get_key (value volv)
2564 #ifndef HAVE_VIRSTORAGEVOLGETKEY
2565 /* Symbol virStorageVolGetKey not found at compile time. */
2566 not_supported ("virStorageVolGetKey");
2569 /* Check that the symbol virStorageVolGetKey
2570 * is in runtime version of libvirt.
2572 WEAK_SYMBOL_CHECK (virStorageVolGetKey);
2575 virStorageVolPtr vol = Volume_val (volv);
2576 virConnectPtr conn = Connect_volv (volv);
2579 NONBLOCKING (r = virStorageVolGetKey (vol));
2580 CHECK_ERROR (!r, conn, "virStorageVolGetKey");
2582 rv = caml_copy_string (r);
2587 /* Automatically generated binding for virStorageVolGetName.
2588 * In generator.pl this function has signature "vol : static string".
2591 #ifdef HAVE_WEAK_SYMBOLS
2592 #ifdef HAVE_VIRSTORAGEVOLGETNAME
2593 extern const char *virStorageVolGetName (virStorageVolPtr vol) __attribute__((weak));
2598 ocaml_libvirt_storage_vol_get_name (value volv)
2601 #ifndef HAVE_VIRSTORAGEVOLGETNAME
2602 /* Symbol virStorageVolGetName not found at compile time. */
2603 not_supported ("virStorageVolGetName");
2606 /* Check that the symbol virStorageVolGetName
2607 * is in runtime version of libvirt.
2609 WEAK_SYMBOL_CHECK (virStorageVolGetName);
2612 virStorageVolPtr vol = Volume_val (volv);
2613 virConnectPtr conn = Connect_volv (volv);
2616 NONBLOCKING (r = virStorageVolGetName (vol));
2617 CHECK_ERROR (!r, conn, "virStorageVolGetName");
2619 rv = caml_copy_string (r);
2624 /* Automatically generated binding for virStoragePoolLookupByVolume.
2625 * In generator.pl this function has signature "vol : pool from vol".
2628 #ifdef HAVE_WEAK_SYMBOLS
2629 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2630 extern virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol) __attribute__((weak));
2635 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2638 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2639 /* Symbol virStoragePoolLookupByVolume not found at compile time. */
2640 not_supported ("virStoragePoolLookupByVolume");
2643 /* Check that the symbol virStoragePoolLookupByVolume
2644 * is in runtime version of libvirt.
2646 WEAK_SYMBOL_CHECK (virStoragePoolLookupByVolume);
2648 CAMLlocal2 (rv, connv);
2649 virStorageVolPtr vol = Volume_val (volv);
2650 virConnectPtr conn = Connect_volv (volv);
2651 virStoragePoolPtr r;
2653 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2654 CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
2656 connv = Field (volv, 1);
2657 rv = Val_pool (r, connv);
2663 #include "libvirt_c_epilogue.c"