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");
90 /* Check that the symbol virConnectGetHostname
91 * is in runtime version of libvirt.
93 WEAK_SYMBOL_CHECK (virConnectGetHostname);
96 virConnectPtr conn = Connect_val (connv);
99 NONBLOCKING (r = virConnectGetHostname (conn));
100 CHECK_ERROR (!r, conn, "virConnectGetHostname");
102 rv = caml_copy_string (r);
108 /* Automatically generated binding for virConnectGetURI.
109 * In generator.pl this function has signature "conn : string".
112 #ifdef HAVE_WEAK_SYMBOLS
113 #ifdef HAVE_VIRCONNECTGETURI
114 extern char *virConnectGetURI (virConnectPtr conn) __attribute__((weak));
119 ocaml_libvirt_connect_get_uri (value connv)
122 #ifndef HAVE_VIRCONNECTGETURI
123 /* Symbol virConnectGetURI not found at compile time. */
124 not_supported ("virConnectGetURI");
127 /* Check that the symbol virConnectGetURI
128 * is in runtime version of libvirt.
130 WEAK_SYMBOL_CHECK (virConnectGetURI);
133 virConnectPtr conn = Connect_val (connv);
136 NONBLOCKING (r = virConnectGetURI (conn));
137 CHECK_ERROR (!r, conn, "virConnectGetURI");
139 rv = caml_copy_string (r);
145 /* Automatically generated binding for virConnectGetType.
146 * In generator.pl this function has signature "conn : static string".
150 ocaml_libvirt_connect_get_type (value connv)
155 virConnectPtr conn = Connect_val (connv);
158 NONBLOCKING (r = virConnectGetType (conn));
159 CHECK_ERROR (!r, conn, "virConnectGetType");
161 rv = caml_copy_string (r);
165 /* Automatically generated binding for virConnectNumOfDomains.
166 * In generator.pl this function has signature "conn : int".
170 ocaml_libvirt_connect_num_of_domains (value connv)
174 virConnectPtr conn = Connect_val (connv);
177 NONBLOCKING (r = virConnectNumOfDomains (conn));
178 CHECK_ERROR (r == -1, conn, "virConnectNumOfDomains");
180 CAMLreturn (Val_int (r));
183 /* Automatically generated binding for virConnectListDomains.
184 * In generator.pl this function has signature "conn, int : int array".
188 ocaml_libvirt_connect_list_domains (value connv, value iv)
190 CAMLparam2 (connv, iv);
193 virConnectPtr conn = Connect_val (connv);
194 int i = Int_val (iv);
197 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
198 CHECK_ERROR (r == -1, conn, "virConnectListDomains");
200 rv = caml_alloc (r, 0);
201 for (i = 0; i < r; ++i)
202 Store_field (rv, i, Val_int (ids[i]));
207 /* Automatically generated binding for virConnectNumOfDefinedDomains.
208 * In generator.pl this function has signature "conn : int".
212 ocaml_libvirt_connect_num_of_defined_domains (value connv)
216 virConnectPtr conn = Connect_val (connv);
219 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
220 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedDomains");
222 CAMLreturn (Val_int (r));
225 /* Automatically generated binding for virConnectListDefinedDomains.
226 * In generator.pl this function has signature "conn, int : string array".
230 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
232 CAMLparam2 (connv, iv);
234 CAMLlocal2 (rv, strv);
235 virConnectPtr conn = Connect_val (connv);
236 int i = Int_val (iv);
240 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
241 CHECK_ERROR (r == -1, conn, "virConnectListDefinedDomains");
243 rv = caml_alloc (r, 0);
244 for (i = 0; i < r; ++i) {
245 strv = caml_copy_string (names[i]);
246 Store_field (rv, i, strv);
253 /* Automatically generated binding for virConnectNumOfNetworks.
254 * In generator.pl this function has signature "conn : int".
258 ocaml_libvirt_connect_num_of_networks (value connv)
262 virConnectPtr conn = Connect_val (connv);
265 NONBLOCKING (r = virConnectNumOfNetworks (conn));
266 CHECK_ERROR (r == -1, conn, "virConnectNumOfNetworks");
268 CAMLreturn (Val_int (r));
271 /* Automatically generated binding for virConnectListNetworks.
272 * In generator.pl this function has signature "conn, int : string array".
276 ocaml_libvirt_connect_list_networks (value connv, value iv)
278 CAMLparam2 (connv, iv);
280 CAMLlocal2 (rv, strv);
281 virConnectPtr conn = Connect_val (connv);
282 int i = Int_val (iv);
286 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
287 CHECK_ERROR (r == -1, conn, "virConnectListNetworks");
289 rv = caml_alloc (r, 0);
290 for (i = 0; i < r; ++i) {
291 strv = caml_copy_string (names[i]);
292 Store_field (rv, i, strv);
299 /* Automatically generated binding for virConnectNumOfDefinedNetworks.
300 * In generator.pl this function has signature "conn : int".
304 ocaml_libvirt_connect_num_of_defined_networks (value connv)
308 virConnectPtr conn = Connect_val (connv);
311 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
312 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedNetworks");
314 CAMLreturn (Val_int (r));
317 /* Automatically generated binding for virConnectListDefinedNetworks.
318 * In generator.pl this function has signature "conn, int : string array".
322 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
324 CAMLparam2 (connv, iv);
326 CAMLlocal2 (rv, strv);
327 virConnectPtr conn = Connect_val (connv);
328 int i = Int_val (iv);
332 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
333 CHECK_ERROR (r == -1, conn, "virConnectListDefinedNetworks");
335 rv = caml_alloc (r, 0);
336 for (i = 0; i < r; ++i) {
337 strv = caml_copy_string (names[i]);
338 Store_field (rv, i, strv);
345 /* Automatically generated binding for virConnectNumOfStoragePools.
346 * In generator.pl this function has signature "conn : int".
349 #ifdef HAVE_WEAK_SYMBOLS
350 #ifdef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
351 extern int virConnectNumOfStoragePools (virConnectPtr conn) __attribute__((weak));
356 ocaml_libvirt_connect_num_of_storage_pools (value connv)
359 #ifndef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
360 /* Symbol virConnectNumOfStoragePools not found at compile time. */
361 not_supported ("virConnectNumOfStoragePools");
364 /* Check that the symbol virConnectNumOfStoragePools
365 * is in runtime version of libvirt.
367 WEAK_SYMBOL_CHECK (virConnectNumOfStoragePools);
369 virConnectPtr conn = Connect_val (connv);
372 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
373 CHECK_ERROR (r == -1, conn, "virConnectNumOfStoragePools");
375 CAMLreturn (Val_int (r));
379 /* Automatically generated binding for virConnectListStoragePools.
380 * In generator.pl this function has signature "conn, int : string array".
383 #ifdef HAVE_WEAK_SYMBOLS
384 #ifdef HAVE_VIRCONNECTLISTSTORAGEPOOLS
385 extern int virConnectListStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
390 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
392 CAMLparam2 (connv, iv);
393 #ifndef HAVE_VIRCONNECTLISTSTORAGEPOOLS
394 /* Symbol virConnectListStoragePools not found at compile time. */
395 not_supported ("virConnectListStoragePools");
398 /* Check that the symbol virConnectListStoragePools
399 * is in runtime version of libvirt.
401 WEAK_SYMBOL_CHECK (virConnectListStoragePools);
403 CAMLlocal2 (rv, strv);
404 virConnectPtr conn = Connect_val (connv);
405 int i = Int_val (iv);
409 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
410 CHECK_ERROR (r == -1, conn, "virConnectListStoragePools");
412 rv = caml_alloc (r, 0);
413 for (i = 0; i < r; ++i) {
414 strv = caml_copy_string (names[i]);
415 Store_field (rv, i, strv);
423 /* Automatically generated binding for virConnectNumOfDefinedStoragePools.
424 * In generator.pl this function has signature "conn : int".
427 #ifdef HAVE_WEAK_SYMBOLS
428 #ifdef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
429 extern int virConnectNumOfDefinedStoragePools (virConnectPtr conn) __attribute__((weak));
434 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
437 #ifndef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
438 /* Symbol virConnectNumOfDefinedStoragePools not found at compile time. */
439 not_supported ("virConnectNumOfDefinedStoragePools");
442 /* Check that the symbol virConnectNumOfDefinedStoragePools
443 * is in runtime version of libvirt.
445 WEAK_SYMBOL_CHECK (virConnectNumOfDefinedStoragePools);
447 virConnectPtr conn = Connect_val (connv);
450 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
451 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedStoragePools");
453 CAMLreturn (Val_int (r));
457 /* Automatically generated binding for virConnectListDefinedStoragePools.
458 * In generator.pl this function has signature "conn, int : string array".
461 #ifdef HAVE_WEAK_SYMBOLS
462 #ifdef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
463 extern int virConnectListDefinedStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
468 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
470 CAMLparam2 (connv, iv);
471 #ifndef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
472 /* Symbol virConnectListDefinedStoragePools not found at compile time. */
473 not_supported ("virConnectListDefinedStoragePools");
476 /* Check that the symbol virConnectListDefinedStoragePools
477 * is in runtime version of libvirt.
479 WEAK_SYMBOL_CHECK (virConnectListDefinedStoragePools);
481 CAMLlocal2 (rv, strv);
482 virConnectPtr conn = Connect_val (connv);
483 int i = Int_val (iv);
487 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
488 CHECK_ERROR (r == -1, conn, "virConnectListDefinedStoragePools");
490 rv = caml_alloc (r, 0);
491 for (i = 0; i < r; ++i) {
492 strv = caml_copy_string (names[i]);
493 Store_field (rv, i, strv);
501 /* Automatically generated binding for virConnectGetCapabilities.
502 * In generator.pl this function has signature "conn : string".
506 ocaml_libvirt_connect_get_capabilities (value connv)
511 virConnectPtr conn = Connect_val (connv);
514 NONBLOCKING (r = virConnectGetCapabilities (conn));
515 CHECK_ERROR (!r, conn, "virConnectGetCapabilities");
517 rv = caml_copy_string (r);
522 /* Automatically generated binding for virDomainCreateLinux.
523 * In generator.pl this function has signature "conn, string, 0U : dom".
527 ocaml_libvirt_domain_create_linux (value connv, value strv)
529 CAMLparam2 (connv, strv);
532 virConnectPtr conn = Connect_val (connv);
533 char *str = String_val (strv);
536 NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
537 CHECK_ERROR (!r, conn, "virDomainCreateLinux");
539 rv = Val_domain (r, connv);
544 /* Automatically generated binding for virDomainCreateLinuxJob.
545 * In generator.pl this function has signature "conn, string, 0U : job".
548 #ifdef HAVE_WEAK_SYMBOLS
549 #ifdef HAVE_VIRDOMAINCREATELINUXJOB
550 extern virJobPtr virDomainCreateLinuxJob (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
555 ocaml_libvirt_domain_create_linux_job (value connv, value strv)
557 CAMLparam2 (connv, strv);
558 #ifndef HAVE_VIRDOMAINCREATELINUXJOB
559 /* Symbol virDomainCreateLinuxJob not found at compile time. */
560 not_supported ("virDomainCreateLinuxJob");
563 /* Check that the symbol virDomainCreateLinuxJob
564 * is in runtime version of libvirt.
566 WEAK_SYMBOL_CHECK (virDomainCreateLinuxJob);
569 virConnectPtr conn = Connect_val (connv);
570 char *str = String_val (strv);
573 NONBLOCKING (r = virDomainCreateLinuxJob (conn, str, 0));
574 CHECK_ERROR (!r, conn, "virDomainCreateLinuxJob");
576 rv = Val_job (r, connv);
582 /* Automatically generated binding for virDomainFree.
583 * In generator.pl this function has signature "dom : free".
587 ocaml_libvirt_domain_free (value domv)
591 virDomainPtr dom = Domain_val (domv);
592 virConnectPtr conn = Connect_domv (domv);
595 NONBLOCKING (r = virDomainFree (dom));
596 CHECK_ERROR (r == -1, conn, "virDomainFree");
598 /* So that we don't double-free in the finalizer: */
599 Domain_val (domv) = NULL;
601 CAMLreturn (Val_unit);
604 /* Automatically generated binding for virDomainDestroy.
605 * In generator.pl this function has signature "dom : free".
609 ocaml_libvirt_domain_destroy (value domv)
613 virDomainPtr dom = Domain_val (domv);
614 virConnectPtr conn = Connect_domv (domv);
617 NONBLOCKING (r = virDomainDestroy (dom));
618 CHECK_ERROR (r == -1, conn, "virDomainDestroy");
620 /* So that we don't double-free in the finalizer: */
621 Domain_val (domv) = NULL;
623 CAMLreturn (Val_unit);
626 /* Automatically generated binding for virDomainLookupByName.
627 * In generator.pl this function has signature "conn, string : dom".
631 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
633 CAMLparam2 (connv, strv);
636 virConnectPtr conn = Connect_val (connv);
637 char *str = String_val (strv);
640 NONBLOCKING (r = virDomainLookupByName (conn, str));
641 CHECK_ERROR (!r, conn, "virDomainLookupByName");
643 rv = Val_domain (r, connv);
648 /* Automatically generated binding for virDomainLookupByID.
649 * In generator.pl this function has signature "conn, int : dom".
653 ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
655 CAMLparam2 (connv, iv);
658 virConnectPtr conn = Connect_val (connv);
659 int i = Int_val (iv);
662 NONBLOCKING (r = virDomainLookupByID (conn, i));
663 CHECK_ERROR (!r, conn, "virDomainLookupByID");
665 rv = Val_domain (r, connv);
670 /* Automatically generated binding for virDomainLookupByUUID.
671 * In generator.pl this function has signature "conn, uuid : dom".
675 ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
677 CAMLparam2 (connv, uuidv);
680 virConnectPtr conn = Connect_val (connv);
681 unsigned char *uuid = (unsigned char *) String_val (uuidv);
684 NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
685 CHECK_ERROR (!r, conn, "virDomainLookupByUUID");
687 rv = Val_domain (r, connv);
692 /* Automatically generated binding for virDomainLookupByUUIDString.
693 * In generator.pl this function has signature "conn, string : dom".
697 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
699 CAMLparam2 (connv, strv);
702 virConnectPtr conn = Connect_val (connv);
703 char *str = String_val (strv);
706 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
707 CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
709 rv = Val_domain (r, connv);
714 /* Automatically generated binding for virDomainGetName.
715 * In generator.pl this function has signature "dom : static string".
719 ocaml_libvirt_domain_get_name (value domv)
724 virDomainPtr dom = Domain_val (domv);
725 virConnectPtr conn = Connect_domv (domv);
728 NONBLOCKING (r = virDomainGetName (dom));
729 CHECK_ERROR (!r, conn, "virDomainGetName");
731 rv = caml_copy_string (r);
735 /* Automatically generated binding for virDomainGetOSType.
736 * In generator.pl this function has signature "dom : string".
740 ocaml_libvirt_domain_get_os_type (value domv)
745 virDomainPtr dom = Domain_val (domv);
746 virConnectPtr conn = Connect_domv (domv);
749 NONBLOCKING (r = virDomainGetOSType (dom));
750 CHECK_ERROR (!r, conn, "virDomainGetOSType");
752 rv = caml_copy_string (r);
757 /* Automatically generated binding for virDomainGetXMLDesc.
758 * In generator.pl this function has signature "dom, 0 : string".
762 ocaml_libvirt_domain_get_xml_desc (value domv)
767 virDomainPtr dom = Domain_val (domv);
768 virConnectPtr conn = Connect_domv (domv);
771 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
772 CHECK_ERROR (!r, conn, "virDomainGetXMLDesc");
774 rv = caml_copy_string (r);
779 /* Automatically generated binding for virDomainGetUUID.
780 * In generator.pl this function has signature "dom : uuid".
784 ocaml_libvirt_domain_get_uuid (value domv)
789 virDomainPtr dom = Domain_val (domv);
790 virConnectPtr conn = Connect_domv (domv);
791 unsigned char uuid[VIR_UUID_BUFLEN];
794 NONBLOCKING (r = virDomainGetUUID (dom, uuid));
795 CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
797 /* UUIDs are byte arrays with a fixed length. */
798 rv = caml_alloc_string (VIR_UUID_BUFLEN);
799 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
803 /* Automatically generated binding for virDomainGetUUIDString.
804 * In generator.pl this function has signature "dom : uuid string".
808 ocaml_libvirt_domain_get_uuid_string (value domv)
813 virDomainPtr dom = Domain_val (domv);
814 virConnectPtr conn = Connect_domv (domv);
815 char uuid[VIR_UUID_STRING_BUFLEN];
818 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
819 CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
821 rv = caml_copy_string (uuid);
825 /* Automatically generated binding for virDomainGetMaxVcpus.
826 * In generator.pl this function has signature "dom : int".
830 ocaml_libvirt_domain_get_max_vcpus (value domv)
834 virDomainPtr dom = Domain_val (domv);
835 virConnectPtr conn = Connect_domv (domv);
838 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
839 CHECK_ERROR (r == -1, conn, "virDomainGetMaxVcpus");
841 CAMLreturn (Val_int (r));
844 /* Automatically generated binding for virDomainSave.
845 * In generator.pl this function has signature "dom, string : unit".
849 ocaml_libvirt_domain_save (value domv, value strv)
851 CAMLparam2 (domv, strv);
853 virDomainPtr dom = Domain_val (domv);
854 virConnectPtr conn = Connect_domv (domv);
855 char *str = String_val (strv);
858 NONBLOCKING (r = virDomainSave (dom, str));
859 CHECK_ERROR (r == -1, conn, "virDomainSave");
861 CAMLreturn (Val_unit);
864 /* Automatically generated binding for virDomainSaveJob.
865 * In generator.pl this function has signature "dom, string : job from dom".
868 #ifdef HAVE_WEAK_SYMBOLS
869 #ifdef HAVE_VIRDOMAINSAVEJOB
870 extern virJobPtr virDomainSaveJob (virDomainPtr dom, const char *str) __attribute__((weak));
875 ocaml_libvirt_domain_save_job (value domv, value strv)
877 CAMLparam2 (domv, strv);
878 #ifndef HAVE_VIRDOMAINSAVEJOB
879 /* Symbol virDomainSaveJob not found at compile time. */
880 not_supported ("virDomainSaveJob");
883 /* Check that the symbol virDomainSaveJob
884 * is in runtime version of libvirt.
886 WEAK_SYMBOL_CHECK (virDomainSaveJob);
888 CAMLlocal2 (rv, connv);
889 virDomainPtr dom = Domain_val (domv);
890 virConnectPtr conn = Connect_domv (domv);
891 char *str = String_val (strv);
894 NONBLOCKING (r = virDomainSaveJob (dom, str));
895 CHECK_ERROR (!r, conn, "virDomainSaveJob");
897 connv = Field (domv, 1);
898 rv = Val_job (r, connv);
904 /* Automatically generated binding for virDomainRestore.
905 * In generator.pl this function has signature "conn, string : unit".
909 ocaml_libvirt_domain_restore (value connv, value strv)
911 CAMLparam2 (connv, strv);
913 virConnectPtr conn = Connect_val (connv);
914 char *str = String_val (strv);
917 NONBLOCKING (r = virDomainRestore (conn, str));
918 CHECK_ERROR (r == -1, conn, "virDomainRestore");
920 CAMLreturn (Val_unit);
923 /* Automatically generated binding for virDomainRestoreJob.
924 * In generator.pl this function has signature "conn, string : job".
927 #ifdef HAVE_WEAK_SYMBOLS
928 #ifdef HAVE_VIRDOMAINRESTOREJOB
929 extern virJobPtr virDomainRestoreJob (virConnectPtr conn, const char *str) __attribute__((weak));
934 ocaml_libvirt_domain_restore_job (value connv, value strv)
936 CAMLparam2 (connv, strv);
937 #ifndef HAVE_VIRDOMAINRESTOREJOB
938 /* Symbol virDomainRestoreJob not found at compile time. */
939 not_supported ("virDomainRestoreJob");
942 /* Check that the symbol virDomainRestoreJob
943 * is in runtime version of libvirt.
945 WEAK_SYMBOL_CHECK (virDomainRestoreJob);
948 virConnectPtr conn = Connect_val (connv);
949 char *str = String_val (strv);
952 NONBLOCKING (r = virDomainRestoreJob (conn, str));
953 CHECK_ERROR (!r, conn, "virDomainRestoreJob");
955 rv = Val_job (r, connv);
961 /* Automatically generated binding for virDomainCoreDump.
962 * In generator.pl this function has signature "dom, string, 0 : unit".
966 ocaml_libvirt_domain_core_dump (value domv, value strv)
968 CAMLparam2 (domv, strv);
971 virDomainPtr dom = Domain_val (domv);
972 virConnectPtr conn = Connect_domv (domv);
973 char *str = String_val (strv);
976 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
977 CHECK_ERROR (!r, conn, "virDomainCoreDump");
979 CAMLreturn (Val_unit);
982 /* Automatically generated binding for virDomainCoreDumpJob.
983 * In generator.pl this function has signature "dom, string, 0 : job from dom".
986 #ifdef HAVE_WEAK_SYMBOLS
987 #ifdef HAVE_VIRDOMAINCOREDUMPJOB
988 extern virJobPtr virDomainCoreDumpJob (virDomainPtr dom, const char *str, int flags) __attribute__((weak));
993 ocaml_libvirt_domain_core_dump_job (value domv, value strv)
995 CAMLparam2 (domv, strv);
996 #ifndef HAVE_VIRDOMAINCOREDUMPJOB
997 /* Symbol virDomainCoreDumpJob not found at compile time. */
998 not_supported ("virDomainCoreDumpJob");
1001 /* Check that the symbol virDomainCoreDumpJob
1002 * is in runtime version of libvirt.
1004 WEAK_SYMBOL_CHECK (virDomainCoreDumpJob);
1006 CAMLlocal2 (rv, connv);
1007 virDomainPtr dom = Domain_val (domv);
1008 virConnectPtr conn = Connect_domv (domv);
1009 char *str = String_val (strv);
1012 NONBLOCKING (r = virDomainCoreDumpJob (dom, str, 0));
1013 CHECK_ERROR (!r, conn, "virDomainCoreDumpJob");
1015 connv = Field (domv, 1);
1016 rv = Val_job (r, connv);
1022 /* Automatically generated binding for virDomainSuspend.
1023 * In generator.pl this function has signature "dom : unit".
1027 ocaml_libvirt_domain_suspend (value domv)
1031 virDomainPtr dom = Domain_val (domv);
1032 virConnectPtr conn = Connect_domv (domv);
1035 NONBLOCKING (r = virDomainSuspend (dom));
1036 CHECK_ERROR (r == -1, conn, "virDomainSuspend");
1038 CAMLreturn (Val_unit);
1041 /* Automatically generated binding for virDomainResume.
1042 * In generator.pl this function has signature "dom : unit".
1046 ocaml_libvirt_domain_resume (value domv)
1050 virDomainPtr dom = Domain_val (domv);
1051 virConnectPtr conn = Connect_domv (domv);
1054 NONBLOCKING (r = virDomainResume (dom));
1055 CHECK_ERROR (r == -1, conn, "virDomainResume");
1057 CAMLreturn (Val_unit);
1060 /* Automatically generated binding for virDomainShutdown.
1061 * In generator.pl this function has signature "dom : unit".
1065 ocaml_libvirt_domain_shutdown (value domv)
1069 virDomainPtr dom = Domain_val (domv);
1070 virConnectPtr conn = Connect_domv (domv);
1073 NONBLOCKING (r = virDomainShutdown (dom));
1074 CHECK_ERROR (r == -1, conn, "virDomainShutdown");
1076 CAMLreturn (Val_unit);
1079 /* Automatically generated binding for virDomainReboot.
1080 * In generator.pl this function has signature "dom, 0 : unit".
1084 ocaml_libvirt_domain_reboot (value domv)
1088 virDomainPtr dom = Domain_val (domv);
1089 virConnectPtr conn = Connect_domv (domv);
1092 NONBLOCKING (r = virDomainReboot (dom, 0));
1093 CHECK_ERROR (r == -1, conn, "virDomainReboot");
1095 CAMLreturn (Val_unit);
1098 /* Automatically generated binding for virDomainDefineXML.
1099 * In generator.pl this function has signature "conn, string : dom".
1103 ocaml_libvirt_domain_define_xml (value connv, value strv)
1105 CAMLparam2 (connv, strv);
1108 virConnectPtr conn = Connect_val (connv);
1109 char *str = String_val (strv);
1112 NONBLOCKING (r = virDomainDefineXML (conn, str));
1113 CHECK_ERROR (!r, conn, "virDomainDefineXML");
1115 rv = Val_domain (r, connv);
1120 /* Automatically generated binding for virDomainUndefine.
1121 * In generator.pl this function has signature "dom : unit".
1125 ocaml_libvirt_domain_undefine (value domv)
1129 virDomainPtr dom = Domain_val (domv);
1130 virConnectPtr conn = Connect_domv (domv);
1133 NONBLOCKING (r = virDomainUndefine (dom));
1134 CHECK_ERROR (r == -1, conn, "virDomainUndefine");
1136 CAMLreturn (Val_unit);
1139 /* Automatically generated binding for virDomainCreate.
1140 * In generator.pl this function has signature "dom : unit".
1144 ocaml_libvirt_domain_create (value domv)
1148 virDomainPtr dom = Domain_val (domv);
1149 virConnectPtr conn = Connect_domv (domv);
1152 NONBLOCKING (r = virDomainCreate (dom));
1153 CHECK_ERROR (r == -1, conn, "virDomainCreate");
1155 CAMLreturn (Val_unit);
1158 /* Automatically generated binding for virDomainCreateJob.
1159 * In generator.pl this function has signature "dom, 0U : job from dom".
1162 #ifdef HAVE_WEAK_SYMBOLS
1163 #ifdef HAVE_VIRDOMAINCREATEJOB
1164 extern virJobPtr virDomainCreateJob (virDomainPtr dom, unsigned int flags) __attribute__((weak));
1169 ocaml_libvirt_domain_create_job (value domv)
1172 #ifndef HAVE_VIRDOMAINCREATEJOB
1173 /* Symbol virDomainCreateJob not found at compile time. */
1174 not_supported ("virDomainCreateJob");
1177 /* Check that the symbol virDomainCreateJob
1178 * is in runtime version of libvirt.
1180 WEAK_SYMBOL_CHECK (virDomainCreateJob);
1182 CAMLlocal2 (rv, connv);
1183 virDomainPtr dom = Domain_val (domv);
1184 virConnectPtr conn = Connect_domv (domv);
1187 NONBLOCKING (r = virDomainCreateJob (dom, 0));
1188 CHECK_ERROR (!r, conn, "virDomainCreateJob");
1190 connv = Field (domv, 1);
1191 rv = Val_job (r, connv);
1197 /* Automatically generated binding for virDomainAttachDevice.
1198 * In generator.pl this function has signature "dom, string : unit".
1202 ocaml_libvirt_domain_attach_device (value domv, value strv)
1204 CAMLparam2 (domv, strv);
1206 virDomainPtr dom = Domain_val (domv);
1207 virConnectPtr conn = Connect_domv (domv);
1208 char *str = String_val (strv);
1211 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1212 CHECK_ERROR (r == -1, conn, "virDomainAttachDevice");
1214 CAMLreturn (Val_unit);
1217 /* Automatically generated binding for virDomainDetachDevice.
1218 * In generator.pl this function has signature "dom, string : unit".
1222 ocaml_libvirt_domain_detach_device (value domv, value strv)
1224 CAMLparam2 (domv, strv);
1226 virDomainPtr dom = Domain_val (domv);
1227 virConnectPtr conn = Connect_domv (domv);
1228 char *str = String_val (strv);
1231 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1232 CHECK_ERROR (r == -1, conn, "virDomainDetachDevice");
1234 CAMLreturn (Val_unit);
1237 /* Automatically generated binding for virDomainGetAutostart.
1238 * In generator.pl this function has signature "dom : bool".
1242 ocaml_libvirt_domain_get_autostart (value domv)
1246 virDomainPtr dom = Domain_val (domv);
1247 virConnectPtr conn = Connect_domv (domv);
1250 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1251 CHECK_ERROR (r == -1, conn, "virDomainGetAutostart");
1253 CAMLreturn (b ? Val_true : Val_false);
1256 /* Automatically generated binding for virDomainSetAutostart.
1257 * In generator.pl this function has signature "dom, bool : unit".
1261 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1263 CAMLparam2 (domv, bv);
1265 virDomainPtr dom = Domain_val (domv);
1266 virConnectPtr conn = Connect_domv (domv);
1269 b = bv == Val_true ? 1 : 0;
1271 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1272 CHECK_ERROR (r == -1, conn, "virDomainSetAutostart");
1274 CAMLreturn (Val_unit);
1277 /* Automatically generated binding for virNetworkFree.
1278 * In generator.pl this function has signature "net : free".
1282 ocaml_libvirt_network_free (value netv)
1286 virNetworkPtr net = Network_val (netv);
1287 virConnectPtr conn = Connect_netv (netv);
1290 NONBLOCKING (r = virNetworkFree (net));
1291 CHECK_ERROR (r == -1, conn, "virNetworkFree");
1293 /* So that we don't double-free in the finalizer: */
1294 Network_val (netv) = NULL;
1296 CAMLreturn (Val_unit);
1299 /* Automatically generated binding for virNetworkDestroy.
1300 * In generator.pl this function has signature "net : free".
1304 ocaml_libvirt_network_destroy (value netv)
1308 virNetworkPtr net = Network_val (netv);
1309 virConnectPtr conn = Connect_netv (netv);
1312 NONBLOCKING (r = virNetworkDestroy (net));
1313 CHECK_ERROR (r == -1, conn, "virNetworkDestroy");
1315 /* So that we don't double-free in the finalizer: */
1316 Network_val (netv) = NULL;
1318 CAMLreturn (Val_unit);
1321 /* Automatically generated binding for virNetworkLookupByName.
1322 * In generator.pl this function has signature "conn, string : net".
1326 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1328 CAMLparam2 (connv, strv);
1331 virConnectPtr conn = Connect_val (connv);
1332 char *str = String_val (strv);
1335 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1336 CHECK_ERROR (!r, conn, "virNetworkLookupByName");
1338 rv = Val_network (r, connv);
1343 /* Automatically generated binding for virNetworkLookupByUUID.
1344 * In generator.pl this function has signature "conn, uuid : net".
1348 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1350 CAMLparam2 (connv, uuidv);
1353 virConnectPtr conn = Connect_val (connv);
1354 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1357 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1358 CHECK_ERROR (!r, conn, "virNetworkLookupByUUID");
1360 rv = Val_network (r, connv);
1365 /* Automatically generated binding for virNetworkLookupByUUIDString.
1366 * In generator.pl this function has signature "conn, string : net".
1370 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1372 CAMLparam2 (connv, strv);
1375 virConnectPtr conn = Connect_val (connv);
1376 char *str = String_val (strv);
1379 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1380 CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
1382 rv = Val_network (r, connv);
1387 /* Automatically generated binding for virNetworkGetName.
1388 * In generator.pl this function has signature "net : static string".
1392 ocaml_libvirt_network_get_name (value netv)
1397 virNetworkPtr net = Network_val (netv);
1398 virConnectPtr conn = Connect_netv (netv);
1401 NONBLOCKING (r = virNetworkGetName (net));
1402 CHECK_ERROR (!r, conn, "virNetworkGetName");
1404 rv = caml_copy_string (r);
1408 /* Automatically generated binding for virNetworkGetXMLDesc.
1409 * In generator.pl this function has signature "net, 0 : string".
1413 ocaml_libvirt_network_get_xml_desc (value netv)
1418 virNetworkPtr net = Network_val (netv);
1419 virConnectPtr conn = Connect_netv (netv);
1422 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1423 CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
1425 rv = caml_copy_string (r);
1430 /* Automatically generated binding for virNetworkGetBridgeName.
1431 * In generator.pl this function has signature "net : string".
1435 ocaml_libvirt_network_get_bridge_name (value netv)
1440 virNetworkPtr net = Network_val (netv);
1441 virConnectPtr conn = Connect_netv (netv);
1444 NONBLOCKING (r = virNetworkGetBridgeName (net));
1445 CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
1447 rv = caml_copy_string (r);
1452 /* Automatically generated binding for virNetworkGetUUID.
1453 * In generator.pl this function has signature "net : uuid".
1457 ocaml_libvirt_network_get_uuid (value netv)
1462 virNetworkPtr net = Network_val (netv);
1463 virConnectPtr conn = Connect_netv (netv);
1464 unsigned char uuid[VIR_UUID_BUFLEN];
1467 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1468 CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
1470 /* UUIDs are byte arrays with a fixed length. */
1471 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1472 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1476 /* Automatically generated binding for virNetworkGetUUIDString.
1477 * In generator.pl this function has signature "net : uuid string".
1481 ocaml_libvirt_network_get_uuid_string (value netv)
1486 virNetworkPtr net = Network_val (netv);
1487 virConnectPtr conn = Connect_netv (netv);
1488 char uuid[VIR_UUID_STRING_BUFLEN];
1491 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1492 CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
1494 rv = caml_copy_string (uuid);
1498 /* Automatically generated binding for virNetworkUndefine.
1499 * In generator.pl this function has signature "net : unit".
1503 ocaml_libvirt_network_undefine (value netv)
1507 virNetworkPtr net = Network_val (netv);
1508 virConnectPtr conn = Connect_netv (netv);
1511 NONBLOCKING (r = virNetworkUndefine (net));
1512 CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
1514 CAMLreturn (Val_unit);
1517 /* Automatically generated binding for virNetworkCreateXML.
1518 * In generator.pl this function has signature "conn, string : net".
1522 ocaml_libvirt_network_create_xml (value connv, value strv)
1524 CAMLparam2 (connv, strv);
1527 virConnectPtr conn = Connect_val (connv);
1528 char *str = String_val (strv);
1531 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1532 CHECK_ERROR (!r, conn, "virNetworkCreateXML");
1534 rv = Val_network (r, connv);
1539 /* Automatically generated binding for virNetworkCreateXMLJob.
1540 * In generator.pl this function has signature "conn, string : job".
1543 #ifdef HAVE_WEAK_SYMBOLS
1544 #ifdef HAVE_VIRNETWORKCREATEXMLJOB
1545 extern virJobPtr virNetworkCreateXMLJob (virConnectPtr conn, const char *str) __attribute__((weak));
1550 ocaml_libvirt_network_create_xml_job (value connv, value strv)
1552 CAMLparam2 (connv, strv);
1553 #ifndef HAVE_VIRNETWORKCREATEXMLJOB
1554 /* Symbol virNetworkCreateXMLJob not found at compile time. */
1555 not_supported ("virNetworkCreateXMLJob");
1558 /* Check that the symbol virNetworkCreateXMLJob
1559 * is in runtime version of libvirt.
1561 WEAK_SYMBOL_CHECK (virNetworkCreateXMLJob);
1564 virConnectPtr conn = Connect_val (connv);
1565 char *str = String_val (strv);
1568 NONBLOCKING (r = virNetworkCreateXMLJob (conn, str));
1569 CHECK_ERROR (!r, conn, "virNetworkCreateXMLJob");
1571 rv = Val_job (r, connv);
1577 /* Automatically generated binding for virNetworkDefineXML.
1578 * In generator.pl this function has signature "conn, string : net".
1582 ocaml_libvirt_network_define_xml (value connv, value strv)
1584 CAMLparam2 (connv, strv);
1587 virConnectPtr conn = Connect_val (connv);
1588 char *str = String_val (strv);
1591 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1592 CHECK_ERROR (!r, conn, "virNetworkDefineXML");
1594 rv = Val_network (r, connv);
1599 /* Automatically generated binding for virNetworkCreate.
1600 * In generator.pl this function has signature "net : unit".
1604 ocaml_libvirt_network_create (value netv)
1608 virNetworkPtr net = Network_val (netv);
1609 virConnectPtr conn = Connect_netv (netv);
1612 NONBLOCKING (r = virNetworkCreate (net));
1613 CHECK_ERROR (r == -1, conn, "virNetworkCreate");
1615 CAMLreturn (Val_unit);
1618 /* Automatically generated binding for virNetworkCreateJob.
1619 * In generator.pl this function has signature "net : job from net".
1622 #ifdef HAVE_WEAK_SYMBOLS
1623 #ifdef HAVE_VIRNETWORKCREATEJOB
1624 extern virJobPtr virNetworkCreateJob (virNetworkPtr net) __attribute__((weak));
1629 ocaml_libvirt_network_create_job (value netv)
1632 #ifndef HAVE_VIRNETWORKCREATEJOB
1633 /* Symbol virNetworkCreateJob not found at compile time. */
1634 not_supported ("virNetworkCreateJob");
1637 /* Check that the symbol virNetworkCreateJob
1638 * is in runtime version of libvirt.
1640 WEAK_SYMBOL_CHECK (virNetworkCreateJob);
1642 CAMLlocal2 (rv, connv);
1643 virNetworkPtr net = Network_val (netv);
1644 virConnectPtr conn = Connect_netv (netv);
1647 NONBLOCKING (r = virNetworkCreateJob (net));
1648 CHECK_ERROR (!r, conn, "virNetworkCreateJob");
1650 connv = Field (netv, 1);
1651 rv = Val_job (r, connv);
1657 /* Automatically generated binding for virNetworkGetAutostart.
1658 * In generator.pl this function has signature "net : bool".
1662 ocaml_libvirt_network_get_autostart (value netv)
1666 virNetworkPtr net = Network_val (netv);
1667 virConnectPtr conn = Connect_netv (netv);
1670 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1671 CHECK_ERROR (r == -1, conn, "virNetworkGetAutostart");
1673 CAMLreturn (b ? Val_true : Val_false);
1676 /* Automatically generated binding for virNetworkSetAutostart.
1677 * In generator.pl this function has signature "net, bool : unit".
1681 ocaml_libvirt_network_set_autostart (value netv, value bv)
1683 CAMLparam2 (netv, bv);
1685 virNetworkPtr net = Network_val (netv);
1686 virConnectPtr conn = Connect_netv (netv);
1689 b = bv == Val_true ? 1 : 0;
1691 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1692 CHECK_ERROR (r == -1, conn, "virNetworkSetAutostart");
1694 CAMLreturn (Val_unit);
1697 /* Automatically generated binding for virStoragePoolFree.
1698 * In generator.pl this function has signature "pool : free".
1701 #ifdef HAVE_WEAK_SYMBOLS
1702 #ifdef HAVE_VIRSTORAGEPOOLFREE
1703 extern int virStoragePoolFree (virStoragePoolPtr pool) __attribute__((weak));
1708 ocaml_libvirt_storage_pool_free (value poolv)
1711 #ifndef HAVE_VIRSTORAGEPOOLFREE
1712 /* Symbol virStoragePoolFree not found at compile time. */
1713 not_supported ("virStoragePoolFree");
1716 /* Check that the symbol virStoragePoolFree
1717 * is in runtime version of libvirt.
1719 WEAK_SYMBOL_CHECK (virStoragePoolFree);
1721 virStoragePoolPtr pool = Pool_val (poolv);
1722 virConnectPtr conn = Connect_polv (poolv);
1725 NONBLOCKING (r = virStoragePoolFree (pool));
1726 CHECK_ERROR (r == -1, conn, "virStoragePoolFree");
1728 /* So that we don't double-free in the finalizer: */
1729 Pool_val (poolv) = NULL;
1731 CAMLreturn (Val_unit);
1735 /* Automatically generated binding for virStoragePoolDestroy.
1736 * In generator.pl this function has signature "pool : free".
1739 #ifdef HAVE_WEAK_SYMBOLS
1740 #ifdef HAVE_VIRSTORAGEPOOLDESTROY
1741 extern int virStoragePoolDestroy (virStoragePoolPtr pool) __attribute__((weak));
1746 ocaml_libvirt_storage_pool_destroy (value poolv)
1749 #ifndef HAVE_VIRSTORAGEPOOLDESTROY
1750 /* Symbol virStoragePoolDestroy not found at compile time. */
1751 not_supported ("virStoragePoolDestroy");
1754 /* Check that the symbol virStoragePoolDestroy
1755 * is in runtime version of libvirt.
1757 WEAK_SYMBOL_CHECK (virStoragePoolDestroy);
1759 virStoragePoolPtr pool = Pool_val (poolv);
1760 virConnectPtr conn = Connect_polv (poolv);
1763 NONBLOCKING (r = virStoragePoolDestroy (pool));
1764 CHECK_ERROR (r == -1, conn, "virStoragePoolDestroy");
1766 /* So that we don't double-free in the finalizer: */
1767 Pool_val (poolv) = NULL;
1769 CAMLreturn (Val_unit);
1773 /* Automatically generated binding for virStoragePoolLookupByName.
1774 * In generator.pl this function has signature "conn, string : pool".
1777 #ifdef HAVE_WEAK_SYMBOLS
1778 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1779 extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, const char *str) __attribute__((weak));
1784 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1786 CAMLparam2 (connv, strv);
1787 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
1788 /* Symbol virStoragePoolLookupByName not found at compile time. */
1789 not_supported ("virStoragePoolLookupByName");
1792 /* Check that the symbol virStoragePoolLookupByName
1793 * is in runtime version of libvirt.
1795 WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
1798 virConnectPtr conn = Connect_val (connv);
1799 char *str = String_val (strv);
1800 virStoragePoolPtr r;
1802 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1803 CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
1805 rv = Val_pool (r, connv);
1811 /* Automatically generated binding for virStoragePoolLookupByUUID.
1812 * In generator.pl this function has signature "conn, uuid : pool".
1815 #ifdef HAVE_WEAK_SYMBOLS
1816 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1817 extern virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, const unsigned char *str) __attribute__((weak));
1822 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1824 CAMLparam2 (connv, uuidv);
1825 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID
1826 /* Symbol virStoragePoolLookupByUUID not found at compile time. */
1827 not_supported ("virStoragePoolLookupByUUID");
1830 /* Check that the symbol virStoragePoolLookupByUUID
1831 * is in runtime version of libvirt.
1833 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUID);
1836 virConnectPtr conn = Connect_val (connv);
1837 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1838 virStoragePoolPtr r;
1840 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1841 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUID");
1843 rv = Val_pool (r, connv);
1849 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1850 * In generator.pl this function has signature "conn, string : pool".
1853 #ifdef HAVE_WEAK_SYMBOLS
1854 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1855 extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn, const char *str) __attribute__((weak));
1860 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1862 CAMLparam2 (connv, strv);
1863 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
1864 /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
1865 not_supported ("virStoragePoolLookupByUUIDString");
1868 /* Check that the symbol virStoragePoolLookupByUUIDString
1869 * is in runtime version of libvirt.
1871 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
1874 virConnectPtr conn = Connect_val (connv);
1875 char *str = String_val (strv);
1876 virStoragePoolPtr r;
1878 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1879 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
1881 rv = Val_pool (r, connv);
1887 /* Automatically generated binding for virStoragePoolGetName.
1888 * In generator.pl this function has signature "pool : static string".
1891 #ifdef HAVE_WEAK_SYMBOLS
1892 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
1893 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
1898 ocaml_libvirt_storage_pool_get_name (value poolv)
1901 #ifndef HAVE_VIRSTORAGEPOOLGETNAME
1902 /* Symbol virStoragePoolGetName not found at compile time. */
1903 not_supported ("virStoragePoolGetName");
1906 /* Check that the symbol virStoragePoolGetName
1907 * is in runtime version of libvirt.
1909 WEAK_SYMBOL_CHECK (virStoragePoolGetName);
1912 virStoragePoolPtr pool = Pool_val (poolv);
1913 virConnectPtr conn = Connect_polv (poolv);
1916 NONBLOCKING (r = virStoragePoolGetName (pool));
1917 CHECK_ERROR (!r, conn, "virStoragePoolGetName");
1919 rv = caml_copy_string (r);
1924 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1925 * In generator.pl this function has signature "pool, 0U : string".
1928 #ifdef HAVE_WEAK_SYMBOLS
1929 #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC
1930 extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
1935 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1938 #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC
1939 /* Symbol virStoragePoolGetXMLDesc not found at compile time. */
1940 not_supported ("virStoragePoolGetXMLDesc");
1943 /* Check that the symbol virStoragePoolGetXMLDesc
1944 * is in runtime version of libvirt.
1946 WEAK_SYMBOL_CHECK (virStoragePoolGetXMLDesc);
1949 virStoragePoolPtr pool = Pool_val (poolv);
1950 virConnectPtr conn = Connect_polv (poolv);
1953 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1954 CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
1956 rv = caml_copy_string (r);
1962 /* Automatically generated binding for virStoragePoolGetUUID.
1963 * In generator.pl this function has signature "pool : uuid".
1966 #ifdef HAVE_WEAK_SYMBOLS
1967 #ifdef HAVE_VIRSTORAGEPOOLGETUUID
1968 extern int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *) __attribute__((weak));
1973 ocaml_libvirt_storage_pool_get_uuid (value poolv)
1976 #ifndef HAVE_VIRSTORAGEPOOLGETUUID
1977 /* Symbol virStoragePoolGetUUID not found at compile time. */
1978 not_supported ("virStoragePoolGetUUID");
1981 /* Check that the symbol virStoragePoolGetUUID
1982 * is in runtime version of libvirt.
1984 WEAK_SYMBOL_CHECK (virStoragePoolGetUUID);
1987 virStoragePoolPtr pool = Pool_val (poolv);
1988 virConnectPtr conn = Connect_polv (poolv);
1989 unsigned char uuid[VIR_UUID_BUFLEN];
1992 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
1993 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
1995 /* UUIDs are byte arrays with a fixed length. */
1996 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1997 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
2002 /* Automatically generated binding for virStoragePoolGetUUIDString.
2003 * In generator.pl this function has signature "pool : uuid string".
2006 #ifdef HAVE_WEAK_SYMBOLS
2007 #ifdef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2008 extern int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *) __attribute__((weak));
2013 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
2016 #ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
2017 /* Symbol virStoragePoolGetUUIDString not found at compile time. */
2018 not_supported ("virStoragePoolGetUUIDString");
2021 /* Check that the symbol virStoragePoolGetUUIDString
2022 * is in runtime version of libvirt.
2024 WEAK_SYMBOL_CHECK (virStoragePoolGetUUIDString);
2027 virStoragePoolPtr pool = Pool_val (poolv);
2028 virConnectPtr conn = Connect_polv (poolv);
2029 char uuid[VIR_UUID_STRING_BUFLEN];
2032 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
2033 CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
2035 rv = caml_copy_string (uuid);
2040 /* Automatically generated binding for virStoragePoolCreateXML.
2041 * In generator.pl this function has signature "conn, string, 0U : pool".
2044 #ifdef HAVE_WEAK_SYMBOLS
2045 #ifdef HAVE_VIRSTORAGEPOOLCREATEXML
2046 extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
2051 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
2053 CAMLparam2 (connv, strv);
2054 #ifndef HAVE_VIRSTORAGEPOOLCREATEXML
2055 /* Symbol virStoragePoolCreateXML not found at compile time. */
2056 not_supported ("virStoragePoolCreateXML");
2059 /* Check that the symbol virStoragePoolCreateXML
2060 * is in runtime version of libvirt.
2062 WEAK_SYMBOL_CHECK (virStoragePoolCreateXML);
2065 virConnectPtr conn = Connect_val (connv);
2066 char *str = String_val (strv);
2067 virStoragePoolPtr r;
2069 NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0));
2070 CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
2072 rv = Val_pool (r, connv);
2078 /* Automatically generated binding for virStoragePoolDefineXML.
2079 * In generator.pl this function has signature "conn, string, 0U : pool".
2082 #ifdef HAVE_WEAK_SYMBOLS
2083 #ifdef HAVE_VIRSTORAGEPOOLDEFINEXML
2084 extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
2089 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
2091 CAMLparam2 (connv, strv);
2092 #ifndef HAVE_VIRSTORAGEPOOLDEFINEXML
2093 /* Symbol virStoragePoolDefineXML not found at compile time. */
2094 not_supported ("virStoragePoolDefineXML");
2097 /* Check that the symbol virStoragePoolDefineXML
2098 * is in runtime version of libvirt.
2100 WEAK_SYMBOL_CHECK (virStoragePoolDefineXML);
2103 virConnectPtr conn = Connect_val (connv);
2104 char *str = String_val (strv);
2105 virStoragePoolPtr r;
2107 NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0));
2108 CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
2110 rv = Val_pool (r, connv);
2116 /* Automatically generated binding for virStoragePoolBuild.
2117 * In generator.pl this function has signature "pool, uint : unit".
2120 #ifdef HAVE_WEAK_SYMBOLS
2121 #ifdef HAVE_VIRSTORAGEPOOLBUILD
2122 extern int virStoragePoolBuild (virStoragePoolPtr pool, unsigned int i) __attribute__((weak));
2127 ocaml_libvirt_storage_pool_build (value poolv, value iv)
2129 CAMLparam2 (poolv, iv);
2130 #ifndef HAVE_VIRSTORAGEPOOLBUILD
2131 /* Symbol virStoragePoolBuild not found at compile time. */
2132 not_supported ("virStoragePoolBuild");
2135 /* Check that the symbol virStoragePoolBuild
2136 * is in runtime version of libvirt.
2138 WEAK_SYMBOL_CHECK (virStoragePoolBuild);
2140 virStoragePoolPtr pool = Pool_val (poolv);
2141 virConnectPtr conn = Connect_polv (poolv);
2142 unsigned int i = Int_val (iv);
2145 NONBLOCKING (r = virStoragePoolBuild (pool, i));
2146 CHECK_ERROR (!r, conn, "virStoragePoolBuild");
2148 CAMLreturn (Val_unit);
2152 /* Automatically generated binding for virStoragePoolUndefine.
2153 * In generator.pl this function has signature "pool : unit".
2156 #ifdef HAVE_WEAK_SYMBOLS
2157 #ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
2158 extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
2163 ocaml_libvirt_storage_pool_undefine (value poolv)
2166 #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
2167 /* Symbol virStoragePoolUndefine not found at compile time. */
2168 not_supported ("virStoragePoolUndefine");
2171 /* Check that the symbol virStoragePoolUndefine
2172 * is in runtime version of libvirt.
2174 WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
2176 virStoragePoolPtr pool = Pool_val (poolv);
2177 virConnectPtr conn = Connect_polv (poolv);
2180 NONBLOCKING (r = virStoragePoolUndefine (pool));
2181 CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
2183 CAMLreturn (Val_unit);
2187 /* Automatically generated binding for virStoragePoolCreate.
2188 * In generator.pl this function has signature "pool, 0U : unit".
2191 #ifdef HAVE_WEAK_SYMBOLS
2192 #ifdef HAVE_VIRSTORAGEPOOLCREATE
2193 extern int virStoragePoolCreate (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
2198 ocaml_libvirt_storage_pool_create (value poolv)
2201 #ifndef HAVE_VIRSTORAGEPOOLCREATE
2202 /* Symbol virStoragePoolCreate not found at compile time. */
2203 not_supported ("virStoragePoolCreate");
2206 /* Check that the symbol virStoragePoolCreate
2207 * is in runtime version of libvirt.
2209 WEAK_SYMBOL_CHECK (virStoragePoolCreate);
2211 virStoragePoolPtr pool = Pool_val (poolv);
2212 virConnectPtr conn = Connect_polv (poolv);
2215 NONBLOCKING (r = virStoragePoolCreate (pool, 0));
2216 CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
2218 CAMLreturn (Val_unit);
2222 /* Automatically generated binding for virStoragePoolDelete.
2223 * In generator.pl this function has signature "pool, uint : unit".
2226 #ifdef HAVE_WEAK_SYMBOLS
2227 #ifdef HAVE_VIRSTORAGEPOOLDELETE
2228 extern int virStoragePoolDelete (virStoragePoolPtr pool, unsigned int i) __attribute__((weak));
2233 ocaml_libvirt_storage_pool_delete (value poolv, value iv)
2235 CAMLparam2 (poolv, iv);
2236 #ifndef HAVE_VIRSTORAGEPOOLDELETE
2237 /* Symbol virStoragePoolDelete not found at compile time. */
2238 not_supported ("virStoragePoolDelete");
2241 /* Check that the symbol virStoragePoolDelete
2242 * is in runtime version of libvirt.
2244 WEAK_SYMBOL_CHECK (virStoragePoolDelete);
2246 virStoragePoolPtr pool = Pool_val (poolv);
2247 virConnectPtr conn = Connect_polv (poolv);
2248 unsigned int i = Int_val (iv);
2251 NONBLOCKING (r = virStoragePoolDelete (pool, i));
2252 CHECK_ERROR (!r, conn, "virStoragePoolDelete");
2254 CAMLreturn (Val_unit);
2258 /* Automatically generated binding for virStoragePoolRefresh.
2259 * In generator.pl this function has signature "pool, 0U : unit".
2262 #ifdef HAVE_WEAK_SYMBOLS
2263 #ifdef HAVE_VIRSTORAGEPOOLREFRESH
2264 extern int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
2269 ocaml_libvirt_storage_pool_refresh (value poolv)
2272 #ifndef HAVE_VIRSTORAGEPOOLREFRESH
2273 /* Symbol virStoragePoolRefresh not found at compile time. */
2274 not_supported ("virStoragePoolRefresh");
2277 /* Check that the symbol virStoragePoolRefresh
2278 * is in runtime version of libvirt.
2280 WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
2282 virStoragePoolPtr pool = Pool_val (poolv);
2283 virConnectPtr conn = Connect_polv (poolv);
2286 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
2287 CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
2289 CAMLreturn (Val_unit);
2293 /* Automatically generated binding for virStoragePoolGetAutostart.
2294 * In generator.pl this function has signature "pool : bool".
2297 #ifdef HAVE_WEAK_SYMBOLS
2298 #ifdef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2299 extern int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *r) __attribute__((weak));
2304 ocaml_libvirt_storage_pool_get_autostart (value poolv)
2307 #ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART
2308 /* Symbol virStoragePoolGetAutostart not found at compile time. */
2309 not_supported ("virStoragePoolGetAutostart");
2312 /* Check that the symbol virStoragePoolGetAutostart
2313 * is in runtime version of libvirt.
2315 WEAK_SYMBOL_CHECK (virStoragePoolGetAutostart);
2317 virStoragePoolPtr pool = Pool_val (poolv);
2318 virConnectPtr conn = Connect_polv (poolv);
2321 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
2322 CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
2324 CAMLreturn (b ? Val_true : Val_false);
2328 /* Automatically generated binding for virStoragePoolSetAutostart.
2329 * In generator.pl this function has signature "pool, bool : unit".
2332 #ifdef HAVE_WEAK_SYMBOLS
2333 #ifdef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2334 extern int virStoragePoolSetAutostart (virStoragePoolPtr pool, int b) __attribute__((weak));
2339 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
2341 CAMLparam2 (poolv, bv);
2342 #ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART
2343 /* Symbol virStoragePoolSetAutostart not found at compile time. */
2344 not_supported ("virStoragePoolSetAutostart");
2347 /* Check that the symbol virStoragePoolSetAutostart
2348 * is in runtime version of libvirt.
2350 WEAK_SYMBOL_CHECK (virStoragePoolSetAutostart);
2352 virStoragePoolPtr pool = Pool_val (poolv);
2353 virConnectPtr conn = Connect_polv (poolv);
2356 b = bv == Val_true ? 1 : 0;
2358 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
2359 CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
2361 CAMLreturn (Val_unit);
2365 /* Automatically generated binding for virStoragePoolNumOfVolumes.
2366 * In generator.pl this function has signature "pool : int".
2369 #ifdef HAVE_WEAK_SYMBOLS
2370 #ifdef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
2371 extern int virStoragePoolNumOfVolumes (virStoragePoolPtr pool) __attribute__((weak));
2376 ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
2379 #ifndef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
2380 /* Symbol virStoragePoolNumOfVolumes not found at compile time. */
2381 not_supported ("virStoragePoolNumOfVolumes");
2384 /* Check that the symbol virStoragePoolNumOfVolumes
2385 * is in runtime version of libvirt.
2387 WEAK_SYMBOL_CHECK (virStoragePoolNumOfVolumes);
2389 virStoragePoolPtr pool = Pool_val (poolv);
2390 virConnectPtr conn = Connect_polv (poolv);
2393 NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
2394 CHECK_ERROR (r == -1, conn, "virStoragePoolNumOfVolumes");
2396 CAMLreturn (Val_int (r));
2400 /* Automatically generated binding for virStoragePoolListVolumes.
2401 * In generator.pl this function has signature "pool, int : string array".
2404 #ifdef HAVE_WEAK_SYMBOLS
2405 #ifdef HAVE_VIRSTORAGEPOOLLISTVOLUMES
2406 extern int virStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames) __attribute__((weak));
2411 ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
2413 CAMLparam2 (poolv, iv);
2414 #ifndef HAVE_VIRSTORAGEPOOLLISTVOLUMES
2415 /* Symbol virStoragePoolListVolumes not found at compile time. */
2416 not_supported ("virStoragePoolListVolumes");
2419 /* Check that the symbol virStoragePoolListVolumes
2420 * is in runtime version of libvirt.
2422 WEAK_SYMBOL_CHECK (virStoragePoolListVolumes);
2424 CAMLlocal2 (rv, strv);
2425 virStoragePoolPtr pool = Pool_val (poolv);
2426 virConnectPtr conn = Connect_polv (poolv);
2427 int i = Int_val (iv);
2431 NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
2432 CHECK_ERROR (r == -1, conn, "virStoragePoolListVolumes");
2434 rv = caml_alloc (r, 0);
2435 for (i = 0; i < r; ++i) {
2436 strv = caml_copy_string (names[i]);
2437 Store_field (rv, i, strv);
2445 /* Automatically generated binding for virStorageVolFree.
2446 * In generator.pl this function has signature "vol : free".
2449 #ifdef HAVE_WEAK_SYMBOLS
2450 #ifdef HAVE_VIRSTORAGEVOLFREE
2451 extern int virStorageVolFree (virStorageVolPtr vol) __attribute__((weak));
2456 ocaml_libvirt_storage_vol_free (value volv)
2459 #ifndef HAVE_VIRSTORAGEVOLFREE
2460 /* Symbol virStorageVolFree not found at compile time. */
2461 not_supported ("virStorageVolFree");
2464 /* Check that the symbol virStorageVolFree
2465 * is in runtime version of libvirt.
2467 WEAK_SYMBOL_CHECK (virStorageVolFree);
2469 virStorageVolPtr vol = Volume_val (volv);
2470 virConnectPtr conn = Connect_volv (volv);
2473 NONBLOCKING (r = virStorageVolFree (vol));
2474 CHECK_ERROR (r == -1, conn, "virStorageVolFree");
2476 /* So that we don't double-free in the finalizer: */
2477 Volume_val (volv) = NULL;
2479 CAMLreturn (Val_unit);
2483 /* Automatically generated binding for virStorageVolDelete.
2484 * In generator.pl this function has signature "vol, uint : unit".
2487 #ifdef HAVE_WEAK_SYMBOLS
2488 #ifdef HAVE_VIRSTORAGEVOLDELETE
2489 extern int virStorageVolDelete (virStorageVolPtr vol, unsigned int i) __attribute__((weak));
2494 ocaml_libvirt_storage_vol_delete (value volv, value iv)
2496 CAMLparam2 (volv, iv);
2497 #ifndef HAVE_VIRSTORAGEVOLDELETE
2498 /* Symbol virStorageVolDelete not found at compile time. */
2499 not_supported ("virStorageVolDelete");
2502 /* Check that the symbol virStorageVolDelete
2503 * is in runtime version of libvirt.
2505 WEAK_SYMBOL_CHECK (virStorageVolDelete);
2507 virStorageVolPtr vol = Volume_val (volv);
2508 virConnectPtr conn = Connect_volv (volv);
2509 unsigned int i = Int_val (iv);
2512 NONBLOCKING (r = virStorageVolDelete (vol, i));
2513 CHECK_ERROR (!r, conn, "virStorageVolDelete");
2515 CAMLreturn (Val_unit);
2519 /* Automatically generated binding for virStorageVolLookupByName.
2520 * In generator.pl this function has signature "pool, string : vol from pool".
2523 #ifdef HAVE_WEAK_SYMBOLS
2524 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2525 extern virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, const char *str) __attribute__((weak));
2530 ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
2532 CAMLparam2 (poolv, strv);
2533 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
2534 /* Symbol virStorageVolLookupByName not found at compile time. */
2535 not_supported ("virStorageVolLookupByName");
2538 /* Check that the symbol virStorageVolLookupByName
2539 * is in runtime version of libvirt.
2541 WEAK_SYMBOL_CHECK (virStorageVolLookupByName);
2543 CAMLlocal2 (rv, connv);
2544 virStoragePoolPtr pool = Pool_val (poolv);
2545 virConnectPtr conn = Connect_polv (poolv);
2546 char *str = String_val (strv);
2549 NONBLOCKING (r = virStorageVolLookupByName (pool, str));
2550 CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
2552 connv = Field (poolv, 1);
2553 rv = Val_volume (r, connv);
2559 /* Automatically generated binding for virStorageVolLookupByKey.
2560 * In generator.pl this function has signature "conn, string : vol".
2563 #ifdef HAVE_WEAK_SYMBOLS
2564 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2565 extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *str) __attribute__((weak));
2570 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
2572 CAMLparam2 (connv, strv);
2573 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
2574 /* Symbol virStorageVolLookupByKey not found at compile time. */
2575 not_supported ("virStorageVolLookupByKey");
2578 /* Check that the symbol virStorageVolLookupByKey
2579 * is in runtime version of libvirt.
2581 WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
2584 virConnectPtr conn = Connect_val (connv);
2585 char *str = String_val (strv);
2588 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
2589 CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
2591 rv = Val_volume (r, connv);
2597 /* Automatically generated binding for virStorageVolLookupByPath.
2598 * In generator.pl this function has signature "conn, string : vol".
2601 #ifdef HAVE_WEAK_SYMBOLS
2602 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2603 extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *str) __attribute__((weak));
2608 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
2610 CAMLparam2 (connv, strv);
2611 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
2612 /* Symbol virStorageVolLookupByPath not found at compile time. */
2613 not_supported ("virStorageVolLookupByPath");
2616 /* Check that the symbol virStorageVolLookupByPath
2617 * is in runtime version of libvirt.
2619 WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
2622 virConnectPtr conn = Connect_val (connv);
2623 char *str = String_val (strv);
2626 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
2627 CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
2629 rv = Val_volume (r, connv);
2635 /* Automatically generated binding for virStorageVolCreateXML.
2636 * In generator.pl this function has signature "pool, string, 0U : vol from pool".
2639 #ifdef HAVE_WEAK_SYMBOLS
2640 #ifdef HAVE_VIRSTORAGEVOLCREATEXML
2641 extern virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *str, unsigned int flags) __attribute__((weak));
2646 ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
2648 CAMLparam2 (poolv, strv);
2649 #ifndef HAVE_VIRSTORAGEVOLCREATEXML
2650 /* Symbol virStorageVolCreateXML not found at compile time. */
2651 not_supported ("virStorageVolCreateXML");
2654 /* Check that the symbol virStorageVolCreateXML
2655 * is in runtime version of libvirt.
2657 WEAK_SYMBOL_CHECK (virStorageVolCreateXML);
2659 CAMLlocal2 (rv, connv);
2660 virStoragePoolPtr pool = Pool_val (poolv);
2661 virConnectPtr conn = Connect_polv (poolv);
2662 char *str = String_val (strv);
2665 NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
2666 CHECK_ERROR (!r, conn, "virStorageVolCreateXML");
2668 connv = Field (poolv, 1);
2669 rv = Val_volume (r, connv);
2675 /* Automatically generated binding for virStorageVolGetXMLDesc.
2676 * In generator.pl this function has signature "vol, 0U : string".
2679 #ifdef HAVE_WEAK_SYMBOLS
2680 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
2681 extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, unsigned int flags) __attribute__((weak));
2686 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
2689 #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
2690 /* Symbol virStorageVolGetXMLDesc not found at compile time. */
2691 not_supported ("virStorageVolGetXMLDesc");
2694 /* Check that the symbol virStorageVolGetXMLDesc
2695 * is in runtime version of libvirt.
2697 WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
2700 virStorageVolPtr vol = Volume_val (volv);
2701 virConnectPtr conn = Connect_volv (volv);
2704 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
2705 CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
2707 rv = caml_copy_string (r);
2713 /* Automatically generated binding for virStorageVolGetPath.
2714 * In generator.pl this function has signature "vol : string".
2717 #ifdef HAVE_WEAK_SYMBOLS
2718 #ifdef HAVE_VIRSTORAGEVOLGETPATH
2719 extern char *virStorageVolGetPath (virStorageVolPtr vol) __attribute__((weak));
2724 ocaml_libvirt_storage_vol_get_path (value volv)
2727 #ifndef HAVE_VIRSTORAGEVOLGETPATH
2728 /* Symbol virStorageVolGetPath not found at compile time. */
2729 not_supported ("virStorageVolGetPath");
2732 /* Check that the symbol virStorageVolGetPath
2733 * is in runtime version of libvirt.
2735 WEAK_SYMBOL_CHECK (virStorageVolGetPath);
2738 virStorageVolPtr vol = Volume_val (volv);
2739 virConnectPtr conn = Connect_volv (volv);
2742 NONBLOCKING (r = virStorageVolGetPath (vol));
2743 CHECK_ERROR (!r, conn, "virStorageVolGetPath");
2745 rv = caml_copy_string (r);
2751 /* Automatically generated binding for virStorageVolGetKey.
2752 * In generator.pl this function has signature "vol : static string".
2755 #ifdef HAVE_WEAK_SYMBOLS
2756 #ifdef HAVE_VIRSTORAGEVOLGETKEY
2757 extern const char *virStorageVolGetKey (virStorageVolPtr vol) __attribute__((weak));
2762 ocaml_libvirt_storage_vol_get_key (value volv)
2765 #ifndef HAVE_VIRSTORAGEVOLGETKEY
2766 /* Symbol virStorageVolGetKey not found at compile time. */
2767 not_supported ("virStorageVolGetKey");
2770 /* Check that the symbol virStorageVolGetKey
2771 * is in runtime version of libvirt.
2773 WEAK_SYMBOL_CHECK (virStorageVolGetKey);
2776 virStorageVolPtr vol = Volume_val (volv);
2777 virConnectPtr conn = Connect_volv (volv);
2780 NONBLOCKING (r = virStorageVolGetKey (vol));
2781 CHECK_ERROR (!r, conn, "virStorageVolGetKey");
2783 rv = caml_copy_string (r);
2788 /* Automatically generated binding for virStorageVolGetName.
2789 * In generator.pl this function has signature "vol : static string".
2792 #ifdef HAVE_WEAK_SYMBOLS
2793 #ifdef HAVE_VIRSTORAGEVOLGETNAME
2794 extern const char *virStorageVolGetName (virStorageVolPtr vol) __attribute__((weak));
2799 ocaml_libvirt_storage_vol_get_name (value volv)
2802 #ifndef HAVE_VIRSTORAGEVOLGETNAME
2803 /* Symbol virStorageVolGetName not found at compile time. */
2804 not_supported ("virStorageVolGetName");
2807 /* Check that the symbol virStorageVolGetName
2808 * is in runtime version of libvirt.
2810 WEAK_SYMBOL_CHECK (virStorageVolGetName);
2813 virStorageVolPtr vol = Volume_val (volv);
2814 virConnectPtr conn = Connect_volv (volv);
2817 NONBLOCKING (r = virStorageVolGetName (vol));
2818 CHECK_ERROR (!r, conn, "virStorageVolGetName");
2820 rv = caml_copy_string (r);
2825 /* Automatically generated binding for virStoragePoolLookupByVolume.
2826 * In generator.pl this function has signature "vol : pool from vol".
2829 #ifdef HAVE_WEAK_SYMBOLS
2830 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2831 extern virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol) __attribute__((weak));
2836 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2839 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
2840 /* Symbol virStoragePoolLookupByVolume not found at compile time. */
2841 not_supported ("virStoragePoolLookupByVolume");
2844 /* Check that the symbol virStoragePoolLookupByVolume
2845 * is in runtime version of libvirt.
2847 WEAK_SYMBOL_CHECK (virStoragePoolLookupByVolume);
2849 CAMLlocal2 (rv, connv);
2850 virStorageVolPtr vol = Volume_val (volv);
2851 virConnectPtr conn = Connect_volv (volv);
2852 virStoragePoolPtr r;
2854 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2855 CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
2857 connv = Field (volv, 1);
2858 rv = Val_pool (r, connv);
2864 /* Automatically generated binding for virJobFree.
2865 * In generator.pl this function has signature "job : free".
2868 #ifdef HAVE_WEAK_SYMBOLS
2869 #ifdef HAVE_VIRJOBFREE
2870 extern int virJobFree (virJobPtr job) __attribute__((weak));
2875 ocaml_libvirt_job_free (value jobv)
2878 #ifndef HAVE_VIRJOBFREE
2879 /* Symbol virJobFree not found at compile time. */
2880 not_supported ("virJobFree");
2883 /* Check that the symbol virJobFree
2884 * is in runtime version of libvirt.
2886 WEAK_SYMBOL_CHECK (virJobFree);
2888 virJobPtr job = Job_val (jobv);
2889 virConnectPtr conn = Connect_jobv (jobv);
2892 NONBLOCKING (r = virJobFree (job));
2893 CHECK_ERROR (r == -1, conn, "virJobFree");
2895 /* So that we don't double-free in the finalizer: */
2896 Job_val (jobv) = NULL;
2898 CAMLreturn (Val_unit);
2902 /* Automatically generated binding for virJobCancel.
2903 * In generator.pl this function has signature "job : unit".
2906 #ifdef HAVE_WEAK_SYMBOLS
2907 #ifdef HAVE_VIRJOBCANCEL
2908 extern int virJobCancel (virJobPtr job) __attribute__((weak));
2913 ocaml_libvirt_job_cancel (value jobv)
2916 #ifndef HAVE_VIRJOBCANCEL
2917 /* Symbol virJobCancel not found at compile time. */
2918 not_supported ("virJobCancel");
2921 /* Check that the symbol virJobCancel
2922 * is in runtime version of libvirt.
2924 WEAK_SYMBOL_CHECK (virJobCancel);
2926 virJobPtr job = Job_val (jobv);
2927 virConnectPtr conn = Connect_jobv (jobv);
2930 NONBLOCKING (r = virJobCancel (job));
2931 CHECK_ERROR (r == -1, conn, "virJobCancel");
2933 CAMLreturn (Val_unit);
2937 /* Automatically generated binding for virJobGetNetwork.
2938 * In generator.pl this function has signature "job : net from job".
2941 #ifdef HAVE_WEAK_SYMBOLS
2942 #ifdef HAVE_VIRJOBGETNETWORK
2943 extern virNetworkPtr virJobGetNetwork (virJobPtr job) __attribute__((weak));
2948 ocaml_libvirt_job_get_network (value jobv)
2951 #ifndef HAVE_VIRJOBGETNETWORK
2952 /* Symbol virJobGetNetwork not found at compile time. */
2953 not_supported ("virJobGetNetwork");
2956 /* Check that the symbol virJobGetNetwork
2957 * is in runtime version of libvirt.
2959 WEAK_SYMBOL_CHECK (virJobGetNetwork);
2961 CAMLlocal2 (rv, connv);
2962 virJobPtr job = Job_val (jobv);
2963 virConnectPtr conn = Connect_jobv (jobv);
2966 NONBLOCKING (r = virJobGetNetwork (job));
2967 CHECK_ERROR (!r, conn, "virJobGetNetwork");
2969 connv = Field (jobv, 1);
2970 rv = Val_network (r, connv);
2976 /* Automatically generated binding for virJobGetDomain.
2977 * In generator.pl this function has signature "job : dom from job".
2980 #ifdef HAVE_WEAK_SYMBOLS
2981 #ifdef HAVE_VIRJOBGETDOMAIN
2982 extern virDomainPtr virJobGetDomain (virJobPtr job) __attribute__((weak));
2987 ocaml_libvirt_job_get_domain (value jobv)
2990 #ifndef HAVE_VIRJOBGETDOMAIN
2991 /* Symbol virJobGetDomain not found at compile time. */
2992 not_supported ("virJobGetDomain");
2995 /* Check that the symbol virJobGetDomain
2996 * is in runtime version of libvirt.
2998 WEAK_SYMBOL_CHECK (virJobGetDomain);
3000 CAMLlocal2 (rv, connv);
3001 virJobPtr job = Job_val (jobv);
3002 virConnectPtr conn = Connect_jobv (jobv);
3005 NONBLOCKING (r = virJobGetDomain (job));
3006 CHECK_ERROR (!r, conn, "virJobGetDomain");
3008 connv = Field (jobv, 1);
3009 rv = Val_domain (r, connv);
3015 #include "libvirt_c_epilogue.c"