1 /* WARNING: THIS FILE IS AUTOMATICALLY GENERATED BY 'generator.pl'.
2 * Any changes you make to this file may be overwritten.
5 /* OCaml bindings for libvirt.
6 * (C) Copyright 2007-2008 Richard W.M. Jones, Red Hat Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 #include <libvirt/libvirt.h>
31 #include <libvirt/virterror.h>
33 #include <caml/config.h>
34 #include <caml/alloc.h>
35 #include <caml/callback.h>
36 #include <caml/custom.h>
37 #include <caml/fail.h>
38 #include <caml/memory.h>
39 #include <caml/misc.h>
40 #include <caml/mlvalues.h>
41 #include <caml/signals.h>
43 #include "libvirt_c_prologue.c"
45 #include "libvirt_c_oneoffs.c"
47 #ifdef HAVE_WEAK_SYMBOLS
48 #ifdef HAVE_VIRCONNECTGETHOSTNAME
49 extern char *virConnectGetHostname (virConnectPtr conn) __attribute__((weak));
54 ocaml_libvirt_connect_get_hostname (value connv)
57 #ifndef HAVE_VIRCONNECTGETHOSTNAME
58 /* Symbol virConnectGetHostname not found at compile time. */
59 not_supported ("virConnectGetHostname");
60 /* Suppresses a compiler warning. */
63 /* Check that the symbol virConnectGetHostname
64 * is in runtime version of libvirt.
66 WEAK_SYMBOL_CHECK (virConnectGetHostname);
69 virConnectPtr conn = Connect_val (connv);
72 NONBLOCKING (r = virConnectGetHostname (conn));
73 CHECK_ERROR (!r, conn, "virConnectGetHostname");
75 rv = caml_copy_string (r);
81 #ifdef HAVE_WEAK_SYMBOLS
82 #ifdef HAVE_VIRCONNECTGETURI
83 extern char *virConnectGetURI (virConnectPtr conn) __attribute__((weak));
88 ocaml_libvirt_connect_get_uri (value connv)
91 #ifndef HAVE_VIRCONNECTGETURI
92 /* Symbol virConnectGetURI not found at compile time. */
93 not_supported ("virConnectGetURI");
94 /* Suppresses a compiler warning. */
97 /* Check that the symbol virConnectGetURI
98 * is in runtime version of libvirt.
100 WEAK_SYMBOL_CHECK (virConnectGetURI);
103 virConnectPtr conn = Connect_val (connv);
106 NONBLOCKING (r = virConnectGetURI (conn));
107 CHECK_ERROR (!r, conn, "virConnectGetURI");
109 rv = caml_copy_string (r);
116 ocaml_libvirt_connect_get_type (value connv)
121 virConnectPtr conn = Connect_val (connv);
124 NONBLOCKING (r = virConnectGetType (conn));
125 CHECK_ERROR (!r, conn, "virConnectGetType");
127 rv = caml_copy_string (r);
132 ocaml_libvirt_connect_num_of_domains (value connv)
136 virConnectPtr conn = Connect_val (connv);
139 NONBLOCKING (r = virConnectNumOfDomains (conn));
140 CHECK_ERROR (r == -1, conn, "virConnectNumOfDomains");
142 CAMLreturn (Val_int (r));
146 ocaml_libvirt_connect_list_domains (value connv, value iv)
148 CAMLparam2 (connv, iv);
151 virConnectPtr conn = Connect_val (connv);
152 int i = Int_val (iv);
155 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
156 CHECK_ERROR (r == -1, conn, "virConnectListDomains");
158 rv = caml_alloc (r, 0);
159 for (i = 0; i < r; ++i)
160 Store_field (rv, i, Val_int (ids[i]));
166 ocaml_libvirt_connect_num_of_defined_domains (value connv)
170 virConnectPtr conn = Connect_val (connv);
173 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
174 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedDomains");
176 CAMLreturn (Val_int (r));
180 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
182 CAMLparam2 (connv, iv);
184 CAMLlocal2 (rv, strv);
185 virConnectPtr conn = Connect_val (connv);
186 int i = Int_val (iv);
190 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
191 CHECK_ERROR (r == -1, conn, "virConnectListDefinedDomains");
193 rv = caml_alloc (r, 0);
194 for (i = 0; i < r; ++i) {
195 strv = caml_copy_string (names[i]);
196 Store_field (rv, i, strv);
204 ocaml_libvirt_connect_num_of_networks (value connv)
208 virConnectPtr conn = Connect_val (connv);
211 NONBLOCKING (r = virConnectNumOfNetworks (conn));
212 CHECK_ERROR (r == -1, conn, "virConnectNumOfNetworks");
214 CAMLreturn (Val_int (r));
218 ocaml_libvirt_connect_list_networks (value connv, value iv)
220 CAMLparam2 (connv, iv);
222 CAMLlocal2 (rv, strv);
223 virConnectPtr conn = Connect_val (connv);
224 int i = Int_val (iv);
228 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
229 CHECK_ERROR (r == -1, conn, "virConnectListNetworks");
231 rv = caml_alloc (r, 0);
232 for (i = 0; i < r; ++i) {
233 strv = caml_copy_string (names[i]);
234 Store_field (rv, i, strv);
242 ocaml_libvirt_connect_num_of_defined_networks (value connv)
246 virConnectPtr conn = Connect_val (connv);
249 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
250 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedNetworks");
252 CAMLreturn (Val_int (r));
256 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
258 CAMLparam2 (connv, iv);
260 CAMLlocal2 (rv, strv);
261 virConnectPtr conn = Connect_val (connv);
262 int i = Int_val (iv);
266 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
267 CHECK_ERROR (r == -1, conn, "virConnectListDefinedNetworks");
269 rv = caml_alloc (r, 0);
270 for (i = 0; i < r; ++i) {
271 strv = caml_copy_string (names[i]);
272 Store_field (rv, i, strv);
279 #ifdef HAVE_WEAK_SYMBOLS
280 #ifdef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
281 extern int virConnectNumOfStoragePools (virConnectPtr conn) __attribute__((weak));
286 ocaml_libvirt_connect_num_of_storage_pools (value connv)
289 #ifndef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS
290 /* Symbol virConnectNumOfStoragePools not found at compile time. */
291 not_supported ("virConnectNumOfStoragePools");
292 /* Suppresses a compiler warning. */
295 /* Check that the symbol virConnectNumOfStoragePools
296 * is in runtime version of libvirt.
298 WEAK_SYMBOL_CHECK (virConnectNumOfStoragePools);
300 virConnectPtr conn = Connect_val (connv);
303 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
304 CHECK_ERROR (r == -1, conn, "virConnectNumOfStoragePools");
306 CAMLreturn (Val_int (r));
310 #ifdef HAVE_WEAK_SYMBOLS
311 #ifdef HAVE_VIRCONNECTLISTSTORAGEPOOLS
312 extern int virConnectListStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
317 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
319 CAMLparam2 (connv, iv);
320 #ifndef HAVE_VIRCONNECTLISTSTORAGEPOOLS
321 /* Symbol virConnectListStoragePools not found at compile time. */
322 not_supported ("virConnectListStoragePools");
323 /* Suppresses a compiler warning. */
326 /* Check that the symbol virConnectListStoragePools
327 * is in runtime version of libvirt.
329 WEAK_SYMBOL_CHECK (virConnectListStoragePools);
331 CAMLlocal2 (rv, strv);
332 virConnectPtr conn = Connect_val (connv);
333 int i = Int_val (iv);
337 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
338 CHECK_ERROR (r == -1, conn, "virConnectListStoragePools");
340 rv = caml_alloc (r, 0);
341 for (i = 0; i < r; ++i) {
342 strv = caml_copy_string (names[i]);
343 Store_field (rv, i, strv);
351 #ifdef HAVE_WEAK_SYMBOLS
352 #ifdef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
353 extern int virConnectNumOfDefinedStoragePools (virConnectPtr conn) __attribute__((weak));
358 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
361 #ifndef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS
362 /* Symbol virConnectNumOfDefinedStoragePools not found at compile time. */
363 not_supported ("virConnectNumOfDefinedStoragePools");
364 /* Suppresses a compiler warning. */
367 /* Check that the symbol virConnectNumOfDefinedStoragePools
368 * is in runtime version of libvirt.
370 WEAK_SYMBOL_CHECK (virConnectNumOfDefinedStoragePools);
372 virConnectPtr conn = Connect_val (connv);
375 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
376 CHECK_ERROR (r == -1, conn, "virConnectNumOfDefinedStoragePools");
378 CAMLreturn (Val_int (r));
382 #ifdef HAVE_WEAK_SYMBOLS
383 #ifdef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
384 extern int virConnectListDefinedStoragePools (virConnectPtr conn, char **const names, int maxnames) __attribute__((weak));
389 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
391 CAMLparam2 (connv, iv);
392 #ifndef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS
393 /* Symbol virConnectListDefinedStoragePools not found at compile time. */
394 not_supported ("virConnectListDefinedStoragePools");
395 /* Suppresses a compiler warning. */
398 /* Check that the symbol virConnectListDefinedStoragePools
399 * is in runtime version of libvirt.
401 WEAK_SYMBOL_CHECK (virConnectListDefinedStoragePools);
403 CAMLlocal2 (rv, strv);
404 virConnectPtr conn = Connect_val (connv);
405 int i = Int_val (iv);
409 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
410 CHECK_ERROR (r == -1, conn, "virConnectListDefinedStoragePools");
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);
424 ocaml_libvirt_connect_get_capabilities (value connv)
429 virConnectPtr conn = Connect_val (connv);
432 NONBLOCKING (r = virConnectGetCapabilities (conn));
433 CHECK_ERROR (!r, conn, "virConnectGetCapabilities");
435 rv = caml_copy_string (r);
441 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
443 CAMLparam2 (connv, strv);
446 virConnectPtr conn = Connect_val (connv);
447 char *str = String_val (strv);
450 NONBLOCKING (r = virDomainLookupByName (conn, str));
451 CHECK_ERROR (!r, conn, "virDomainLookupByName");
453 rv = Val_domain (r, connv);
459 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
461 CAMLparam2 (connv, strv);
464 virConnectPtr conn = Connect_val (connv);
465 char *str = String_val (strv);
468 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
469 CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
471 rv = Val_domain (r, connv);
477 ocaml_libvirt_domain_get_name (value domv)
482 virDomainPtr dom = Domain_val (domv);
483 virConnectPtr conn = Connect_domv (domv);
486 NONBLOCKING (r = virDomainGetName (dom));
487 CHECK_ERROR (!r, conn, "virDomainGetName");
489 rv = caml_copy_string (r);
494 ocaml_libvirt_domain_get_os_type (value domv)
499 virDomainPtr dom = Domain_val (domv);
500 virConnectPtr conn = Connect_domv (domv);
503 NONBLOCKING (r = virDomainGetOSType (dom));
504 CHECK_ERROR (!r, conn, "virDomainGetOSType");
506 rv = caml_copy_string (r);
512 ocaml_libvirt_domain_get_xml_desc (value domv)
517 virDomainPtr dom = Domain_val (domv);
518 virConnectPtr conn = Connect_domv (domv);
521 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
522 CHECK_ERROR (!r, conn, "virDomainGetXMLDesc");
524 rv = caml_copy_string (r);
530 ocaml_libvirt_domain_suspend (value domv)
534 virDomainPtr dom = Domain_val (domv);
535 virConnectPtr conn = Connect_domv (domv);
538 NONBLOCKING (r = virDomainSuspend (dom));
539 CHECK_ERROR (r == -1, conn, "virDomainSuspend");
541 CAMLreturn (Val_unit);
545 ocaml_libvirt_domain_resume (value domv)
549 virDomainPtr dom = Domain_val (domv);
550 virConnectPtr conn = Connect_domv (domv);
553 NONBLOCKING (r = virDomainResume (dom));
554 CHECK_ERROR (r == -1, conn, "virDomainResume");
556 CAMLreturn (Val_unit);
560 ocaml_libvirt_domain_shutdown (value domv)
564 virDomainPtr dom = Domain_val (domv);
565 virConnectPtr conn = Connect_domv (domv);
568 NONBLOCKING (r = virDomainShutdown (dom));
569 CHECK_ERROR (r == -1, conn, "virDomainShutdown");
571 CAMLreturn (Val_unit);
575 ocaml_libvirt_domain_reboot (value domv)
579 virDomainPtr dom = Domain_val (domv);
580 virConnectPtr conn = Connect_domv (domv);
583 NONBLOCKING (r = virDomainReboot (dom, 0));
584 CHECK_ERROR (r == -1, conn, "virDomainReboot");
586 CAMLreturn (Val_unit);
590 ocaml_libvirt_domain_undefine (value domv)
594 virDomainPtr dom = Domain_val (domv);
595 virConnectPtr conn = Connect_domv (domv);
598 NONBLOCKING (r = virDomainUndefine (dom));
599 CHECK_ERROR (r == -1, conn, "virDomainUndefine");
601 CAMLreturn (Val_unit);
605 ocaml_libvirt_domain_create (value domv)
609 virDomainPtr dom = Domain_val (domv);
610 virConnectPtr conn = Connect_domv (domv);
613 NONBLOCKING (r = virDomainCreate (dom));
614 CHECK_ERROR (r == -1, conn, "virDomainCreate");
616 CAMLreturn (Val_unit);
620 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
622 CAMLparam2 (connv, strv);
625 virConnectPtr conn = Connect_val (connv);
626 char *str = String_val (strv);
629 NONBLOCKING (r = virNetworkLookupByName (conn, str));
630 CHECK_ERROR (!r, conn, "virNetworkLookupByName");
632 rv = Val_network (r, connv);
638 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
640 CAMLparam2 (connv, strv);
643 virConnectPtr conn = Connect_val (connv);
644 char *str = String_val (strv);
647 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
648 CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
650 rv = Val_network (r, connv);
656 ocaml_libvirt_network_get_name (value netv)
661 virNetworkPtr net = Network_val (netv);
662 virConnectPtr conn = Connect_netv (netv);
665 NONBLOCKING (r = virNetworkGetName (net));
666 CHECK_ERROR (!r, conn, "virNetworkGetName");
668 rv = caml_copy_string (r);
673 ocaml_libvirt_network_get_xml_desc (value netv)
678 virNetworkPtr net = Network_val (netv);
679 virConnectPtr conn = Connect_netv (netv);
682 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
683 CHECK_ERROR (!r, conn, "virNetworkGetXMLDesc");
685 rv = caml_copy_string (r);
691 ocaml_libvirt_network_get_bridge_name (value netv)
696 virNetworkPtr net = Network_val (netv);
697 virConnectPtr conn = Connect_netv (netv);
700 NONBLOCKING (r = virNetworkGetBridgeName (net));
701 CHECK_ERROR (!r, conn, "virNetworkGetBridgeName");
703 rv = caml_copy_string (r);
709 ocaml_libvirt_network_undefine (value netv)
713 virNetworkPtr net = Network_val (netv);
714 virConnectPtr conn = Connect_netv (netv);
717 NONBLOCKING (r = virNetworkUndefine (net));
718 CHECK_ERROR (r == -1, conn, "virNetworkUndefine");
720 CAMLreturn (Val_unit);
724 ocaml_libvirt_network_create (value netv)
728 virNetworkPtr net = Network_val (netv);
729 virConnectPtr conn = Connect_netv (netv);
732 NONBLOCKING (r = virNetworkCreate (net));
733 CHECK_ERROR (r == -1, conn, "virNetworkCreate");
735 CAMLreturn (Val_unit);
738 #ifdef HAVE_WEAK_SYMBOLS
739 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
740 extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn dom) __attribute__((weak));
745 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
747 CAMLparam2 (connv, strv);
748 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
749 /* Symbol virStoragePoolLookupByName not found at compile time. */
750 not_supported ("virStoragePoolLookupByName");
751 /* Suppresses a compiler warning. */
754 /* Check that the symbol virStoragePoolLookupByName
755 * is in runtime version of libvirt.
757 WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
760 virConnectPtr conn = Connect_val (connv);
761 char *str = String_val (strv);
764 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
765 CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
767 rv = Val_pool (r, connv);
773 #ifdef HAVE_WEAK_SYMBOLS
774 #ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
775 extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn dom) __attribute__((weak));
780 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
782 CAMLparam2 (connv, strv);
783 #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
784 /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
785 not_supported ("virStoragePoolLookupByUUIDString");
786 /* Suppresses a compiler warning. */
789 /* Check that the symbol virStoragePoolLookupByUUIDString
790 * is in runtime version of libvirt.
792 WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
795 virConnectPtr conn = Connect_val (connv);
796 char *str = String_val (strv);
799 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
800 CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
802 rv = Val_pool (r, connv);
808 #ifdef HAVE_WEAK_SYMBOLS
809 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
810 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
815 ocaml_libvirt_storage_pool_get_name (value poolv)
818 #ifndef HAVE_VIRSTORAGEPOOLGETNAME
819 /* Symbol virStoragePoolGetName not found at compile time. */
820 not_supported ("virStoragePoolGetName");
821 /* Suppresses a compiler warning. */
824 /* Check that the symbol virStoragePoolGetName
825 * is in runtime version of libvirt.
827 WEAK_SYMBOL_CHECK (virStoragePoolGetName);
830 virStoragePoolPtr pool = Pool_val (poolv);
831 virConnectPtr conn = Connect_polv (poolv);
834 NONBLOCKING (r = virStoragePoolGetName (pool));
835 CHECK_ERROR (!r, conn, "virStoragePoolGetName");
837 rv = caml_copy_string (r);
842 #ifdef HAVE_WEAK_SYMBOLS
843 #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC
844 extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
849 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
852 #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC
853 /* Symbol virStoragePoolGetXMLDesc not found at compile time. */
854 not_supported ("virStoragePoolGetXMLDesc");
855 /* Suppresses a compiler warning. */
858 /* Check that the symbol virStoragePoolGetXMLDesc
859 * is in runtime version of libvirt.
861 WEAK_SYMBOL_CHECK (virStoragePoolGetXMLDesc);
864 virStoragePoolPtr pool = Pool_val (poolv);
865 virConnectPtr conn = Connect_polv (poolv);
868 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
869 CHECK_ERROR (!r, conn, "virStoragePoolGetXMLDesc");
871 rv = caml_copy_string (r);
877 #ifdef HAVE_WEAK_SYMBOLS
878 #ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
879 extern char *virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
884 ocaml_libvirt_storage_pool_undefine (value poolv)
887 #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
888 /* Symbol virStoragePoolUndefine not found at compile time. */
889 not_supported ("virStoragePoolUndefine");
890 /* Suppresses a compiler warning. */
893 /* Check that the symbol virStoragePoolUndefine
894 * is in runtime version of libvirt.
896 WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
899 virStoragePoolPtr pool = Pool_val (poolv);
900 virConnectPtr conn = Connect_polv (poolv);
903 NONBLOCKING (r = virStoragePoolUndefine (pool));
904 CHECK_ERROR (!r, conn, "virStoragePoolUndefine");
906 rv = caml_copy_string (r);
912 #ifdef HAVE_WEAK_SYMBOLS
913 #ifdef HAVE_VIRSTORAGEPOOLCREATE
914 extern char *virStoragePoolCreate (virStoragePoolPtr pool) __attribute__((weak));
919 ocaml_libvirt_storage_pool_create (value poolv)
922 #ifndef HAVE_VIRSTORAGEPOOLCREATE
923 /* Symbol virStoragePoolCreate not found at compile time. */
924 not_supported ("virStoragePoolCreate");
925 /* Suppresses a compiler warning. */
928 /* Check that the symbol virStoragePoolCreate
929 * is in runtime version of libvirt.
931 WEAK_SYMBOL_CHECK (virStoragePoolCreate);
934 virStoragePoolPtr pool = Pool_val (poolv);
935 virConnectPtr conn = Connect_polv (poolv);
938 NONBLOCKING (r = virStoragePoolCreate (pool));
939 CHECK_ERROR (!r, conn, "virStoragePoolCreate");
941 rv = caml_copy_string (r);
947 #ifdef HAVE_WEAK_SYMBOLS
948 #ifdef HAVE_VIRSTORAGEPOOLSHUTDOWN
949 extern char *virStoragePoolShutdown (virStoragePoolPtr pool) __attribute__((weak));
954 ocaml_libvirt_storage_pool_shutdown (value poolv)
957 #ifndef HAVE_VIRSTORAGEPOOLSHUTDOWN
958 /* Symbol virStoragePoolShutdown not found at compile time. */
959 not_supported ("virStoragePoolShutdown");
960 /* Suppresses a compiler warning. */
963 /* Check that the symbol virStoragePoolShutdown
964 * is in runtime version of libvirt.
966 WEAK_SYMBOL_CHECK (virStoragePoolShutdown);
969 virStoragePoolPtr pool = Pool_val (poolv);
970 virConnectPtr conn = Connect_polv (poolv);
973 NONBLOCKING (r = virStoragePoolShutdown (pool));
974 CHECK_ERROR (!r, conn, "virStoragePoolShutdown");
976 rv = caml_copy_string (r);
982 #ifdef HAVE_WEAK_SYMBOLS
983 #ifdef HAVE_VIRSTORAGEPOOLREFRESH
984 extern char *virStoragePoolRefresh (virStoragePoolPtr pool, int flags) __attribute__((weak));
989 ocaml_libvirt_storage_pool_refresh (value poolv)
992 #ifndef HAVE_VIRSTORAGEPOOLREFRESH
993 /* Symbol virStoragePoolRefresh not found at compile time. */
994 not_supported ("virStoragePoolRefresh");
995 /* Suppresses a compiler warning. */
998 /* Check that the symbol virStoragePoolRefresh
999 * is in runtime version of libvirt.
1001 WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
1004 virStoragePoolPtr pool = Pool_val (poolv);
1005 virConnectPtr conn = Connect_polv (poolv);
1008 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
1009 CHECK_ERROR (!r, conn, "virStoragePoolRefresh");
1011 rv = caml_copy_string (r);
1017 #ifdef HAVE_WEAK_SYMBOLS
1018 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
1019 extern virStorageVolPtr virStorageVolLookupByName (virConnectPtr conn dom) __attribute__((weak));
1024 ocaml_libvirt_storage_vol_lookup_by_name (value connv, value strv)
1026 CAMLparam2 (connv, strv);
1027 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
1028 /* Symbol virStorageVolLookupByName not found at compile time. */
1029 not_supported ("virStorageVolLookupByName");
1030 /* Suppresses a compiler warning. */
1033 /* Check that the symbol virStorageVolLookupByName
1034 * is in runtime version of libvirt.
1036 WEAK_SYMBOL_CHECK (virStorageVolLookupByName);
1039 virConnectPtr conn = Connect_val (connv);
1040 char *str = String_val (strv);
1043 NONBLOCKING (r = virStorageVolLookupByName (conn, str));
1044 CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
1046 rv = Val_volume (r, connv);
1052 #ifdef HAVE_WEAK_SYMBOLS
1053 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
1054 extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn dom) __attribute__((weak));
1059 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
1061 CAMLparam2 (connv, strv);
1062 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
1063 /* Symbol virStorageVolLookupByKey not found at compile time. */
1064 not_supported ("virStorageVolLookupByKey");
1065 /* Suppresses a compiler warning. */
1068 /* Check that the symbol virStorageVolLookupByKey
1069 * is in runtime version of libvirt.
1071 WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
1074 virConnectPtr conn = Connect_val (connv);
1075 char *str = String_val (strv);
1078 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
1079 CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
1081 rv = Val_volume (r, connv);
1087 #ifdef HAVE_WEAK_SYMBOLS
1088 #ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
1089 extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn dom) __attribute__((weak));
1094 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
1096 CAMLparam2 (connv, strv);
1097 #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
1098 /* Symbol virStorageVolLookupByPath not found at compile time. */
1099 not_supported ("virStorageVolLookupByPath");
1100 /* Suppresses a compiler warning. */
1103 /* Check that the symbol virStorageVolLookupByPath
1104 * is in runtime version of libvirt.
1106 WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
1109 virConnectPtr conn = Connect_val (connv);
1110 char *str = String_val (strv);
1113 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
1114 CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
1116 rv = Val_volume (r, connv);
1122 #ifdef HAVE_WEAK_SYMBOLS
1123 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
1124 extern char *virStorageVolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
1129 ocaml_libvirt_storage_vol_get_xml_desc (value poolv)
1132 #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
1133 /* Symbol virStorageVolGetXMLDesc not found at compile time. */
1134 not_supported ("virStorageVolGetXMLDesc");
1135 /* Suppresses a compiler warning. */
1138 /* Check that the symbol virStorageVolGetXMLDesc
1139 * is in runtime version of libvirt.
1141 WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
1144 virStoragePoolPtr pool = Pool_val (poolv);
1145 virConnectPtr conn = Connect_polv (poolv);
1148 NONBLOCKING (r = virStorageVolGetXMLDesc (pool, 0));
1149 CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
1151 rv = caml_copy_string (r);
1157 #ifdef HAVE_WEAK_SYMBOLS
1158 #ifdef HAVE_VIRSTORAGEVOLGETPATH
1159 extern char *virStorageVolGetPath (virStoragePoolPtr pool) __attribute__((weak));
1164 ocaml_libvirt_storage_vol_get_path (value poolv)
1167 #ifndef HAVE_VIRSTORAGEVOLGETPATH
1168 /* Symbol virStorageVolGetPath not found at compile time. */
1169 not_supported ("virStorageVolGetPath");
1170 /* Suppresses a compiler warning. */
1173 /* Check that the symbol virStorageVolGetPath
1174 * is in runtime version of libvirt.
1176 WEAK_SYMBOL_CHECK (virStorageVolGetPath);
1179 virStoragePoolPtr pool = Pool_val (poolv);
1180 virConnectPtr conn = Connect_polv (poolv);
1183 NONBLOCKING (r = virStorageVolGetPath (pool));
1184 CHECK_ERROR (!r, conn, "virStorageVolGetPath");
1186 rv = caml_copy_string (r);
1192 #ifdef HAVE_WEAK_SYMBOLS
1193 #ifdef HAVE_VIRSTORAGEVOLGETKEY
1194 extern const char *virStorageVolGetKey (virStoragePoolPtr pool) __attribute__((weak));
1199 ocaml_libvirt_storage_vol_get_key (value poolv)
1202 #ifndef HAVE_VIRSTORAGEVOLGETKEY
1203 /* Symbol virStorageVolGetKey not found at compile time. */
1204 not_supported ("virStorageVolGetKey");
1205 /* Suppresses a compiler warning. */
1208 /* Check that the symbol virStorageVolGetKey
1209 * is in runtime version of libvirt.
1211 WEAK_SYMBOL_CHECK (virStorageVolGetKey);
1214 virStoragePoolPtr pool = Pool_val (poolv);
1215 virConnectPtr conn = Connect_polv (poolv);
1218 NONBLOCKING (r = virStorageVolGetKey (pool));
1219 CHECK_ERROR (!r, conn, "virStorageVolGetKey");
1221 rv = caml_copy_string (r);
1226 #ifdef HAVE_WEAK_SYMBOLS
1227 #ifdef HAVE_VIRSTORAGEVOLGETNAME
1228 extern const char *virStorageVolGetName (virStoragePoolPtr pool) __attribute__((weak));
1233 ocaml_libvirt_storage_vol_get_name (value poolv)
1236 #ifndef HAVE_VIRSTORAGEVOLGETNAME
1237 /* Symbol virStorageVolGetName not found at compile time. */
1238 not_supported ("virStorageVolGetName");
1239 /* Suppresses a compiler warning. */
1242 /* Check that the symbol virStorageVolGetName
1243 * is in runtime version of libvirt.
1245 WEAK_SYMBOL_CHECK (virStorageVolGetName);
1248 virStoragePoolPtr pool = Pool_val (poolv);
1249 virConnectPtr conn = Connect_polv (poolv);
1252 NONBLOCKING (r = virStorageVolGetName (pool));
1253 CHECK_ERROR (!r, conn, "virStorageVolGetName");
1255 rv = caml_copy_string (r);
1261 ocaml_libvirt_domain_create_job ()
1263 failwith ("ocaml_libvirt_domain_create_job is unimplemented");
1267 ocaml_libvirt_domain_core_dump_job ()
1269 failwith ("ocaml_libvirt_domain_core_dump_job is unimplemented");
1273 ocaml_libvirt_domain_restore_job ()
1275 failwith ("ocaml_libvirt_domain_restore_job is unimplemented");
1279 ocaml_libvirt_domain_save_job ()
1281 failwith ("ocaml_libvirt_domain_save_job is unimplemented");
1285 ocaml_libvirt_connect_create_linux_job ()
1287 failwith ("ocaml_libvirt_connect_create_linux_job is unimplemented");
1291 ocaml_libvirt_network_create_job ()
1293 failwith ("ocaml_libvirt_network_create_job is unimplemented");
1297 ocaml_libvirt_network_create_xml_job ()
1299 failwith ("ocaml_libvirt_network_create_xml_job is unimplemented");
1303 ocaml_libvirt_storage_pool_set_autostart ()
1305 failwith ("ocaml_libvirt_storage_pool_set_autostart is unimplemented");
1309 ocaml_libvirt_storage_pool_get_autostart ()
1311 failwith ("ocaml_libvirt_storage_pool_get_autostart is unimplemented");
1315 ocaml_libvirt_storage_pool_get_info ()
1317 failwith ("ocaml_libvirt_storage_pool_get_info is unimplemented");
1321 ocaml_libvirt_storage_pool_get_uuid_string ()
1323 failwith ("ocaml_libvirt_storage_pool_get_uuid_string is unimplemented");
1327 ocaml_libvirt_storage_pool_get_uuid ()
1329 failwith ("ocaml_libvirt_storage_pool_get_uuid is unimplemented");
1333 ocaml_libvirt_storage_pool_free ()
1335 failwith ("ocaml_libvirt_storage_pool_free is unimplemented");
1339 ocaml_libvirt_storage_pool_destroy ()
1341 failwith ("ocaml_libvirt_storage_pool_destroy is unimplemented");
1345 ocaml_libvirt_storage_pool_define_xml ()
1347 failwith ("ocaml_libvirt_storage_pool_define_xml is unimplemented");
1351 ocaml_libvirt_storage_pool_create_xml ()
1353 failwith ("ocaml_libvirt_storage_pool_create_xml is unimplemented");
1357 ocaml_libvirt_storage_pool_lookup_by_uuid ()
1359 failwith ("ocaml_libvirt_storage_pool_lookup_by_uuid is unimplemented");
1363 ocaml_libvirt_storage_vol_free ()
1365 failwith ("ocaml_libvirt_storage_vol_free is unimplemented");
1369 ocaml_libvirt_storage_vol_destroy ()
1371 failwith ("ocaml_libvirt_storage_vol_destroy is unimplemented");
1375 ocaml_libvirt_storage_vol_create_xml ()
1377 failwith ("ocaml_libvirt_storage_vol_create_xml is unimplemented");
1381 ocaml_libvirt_storage_vol_get_info ()
1383 failwith ("ocaml_libvirt_storage_vol_get_info is unimplemented");
1387 ocaml_libvirt_pool_of_volume ()
1389 failwith ("ocaml_libvirt_pool_of_volume is unimplemented");
1393 ocaml_libvirt_job_cancel ()
1395 failwith ("ocaml_libvirt_job_cancel is unimplemented");
1399 ocaml_libvirt_job_get_network ()
1401 failwith ("ocaml_libvirt_job_get_network is unimplemented");
1405 ocaml_libvirt_job_get_domain ()
1407 failwith ("ocaml_libvirt_job_get_domain is unimplemented");
1411 ocaml_libvirt_job_get_info ()
1413 failwith ("ocaml_libvirt_job_get_info is unimplemented");
1416 #include "libvirt_c_epilogue.c"