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-2015 Richard W.M. Jones, Red Hat Inc.
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version,
16 * with the OCaml linking exception described in ../COPYING.LIB.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34 #include <libvirt/libvirt.h>
35 #include <libvirt/virterror.h>
37 #include <caml/config.h>
38 #include <caml/alloc.h>
39 #include <caml/callback.h>
40 #include <caml/custom.h>
41 #include <caml/fail.h>
42 #include <caml/memory.h>
43 #include <caml/misc.h>
44 #include <caml/mlvalues.h>
45 #include <caml/signals.h>
47 #include "libvirt_c_prologue.c"
49 #include "libvirt_c_oneoffs.c"
51 /* Automatically generated binding for virConnectClose.
52 * In generator.pl this function has signature "conn : free".
56 ocaml_libvirt_connect_close (value connv)
60 virConnectPtr conn = Connect_val (connv);
63 NONBLOCKING (r = virConnectClose (conn));
64 CHECK_ERROR (r == -1, "virConnectClose");
66 /* So that we don't double-free in the finalizer: */
67 Connect_val (connv) = NULL;
69 CAMLreturn (Val_unit);
72 /* Automatically generated binding for virConnectGetHostname.
73 * In generator.pl this function has signature "conn : string".
77 ocaml_libvirt_connect_get_hostname (value connv)
82 virConnectPtr conn = Connect_val (connv);
85 NONBLOCKING (r = virConnectGetHostname (conn));
86 CHECK_ERROR (!r, "virConnectGetHostname");
88 rv = caml_copy_string (r);
93 /* Automatically generated binding for virConnectGetURI.
94 * In generator.pl this function has signature "conn : string".
98 ocaml_libvirt_connect_get_uri (value connv)
103 virConnectPtr conn = Connect_val (connv);
106 NONBLOCKING (r = virConnectGetURI (conn));
107 CHECK_ERROR (!r, "virConnectGetURI");
109 rv = caml_copy_string (r);
114 /* Automatically generated binding for virConnectGetType.
115 * In generator.pl this function has signature "conn : static string".
119 ocaml_libvirt_connect_get_type (value connv)
124 virConnectPtr conn = Connect_val (connv);
127 NONBLOCKING (r = virConnectGetType (conn));
128 CHECK_ERROR (!r, "virConnectGetType");
130 rv = caml_copy_string (r);
134 /* Automatically generated binding for virConnectNumOfDomains.
135 * In generator.pl this function has signature "conn : int".
139 ocaml_libvirt_connect_num_of_domains (value connv)
143 virConnectPtr conn = Connect_val (connv);
146 NONBLOCKING (r = virConnectNumOfDomains (conn));
147 CHECK_ERROR (r == -1, "virConnectNumOfDomains");
149 CAMLreturn (Val_int (r));
152 /* Automatically generated binding for virConnectListDomains.
153 * In generator.pl this function has signature "conn, int : int array".
157 ocaml_libvirt_connect_list_domains (value connv, value iv)
159 CAMLparam2 (connv, iv);
162 virConnectPtr conn = Connect_val (connv);
163 int i = Int_val (iv);
166 /* Some libvirt List* functions still throw exceptions if i == 0,
167 * so catch that and return an empty array directly. This changes
168 * the semantics slightly (masking other failures) but it's
169 * unlikely anyone will care. RWMJ 2008/06/10
172 rv = caml_alloc (0, 0);
176 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
177 CHECK_ERROR (r == -1, "virConnectListDomains");
179 rv = caml_alloc (r, 0);
180 for (i = 0; i < r; ++i)
181 Store_field (rv, i, Val_int (ids[i]));
186 /* Automatically generated binding for virConnectNumOfDefinedDomains.
187 * In generator.pl this function has signature "conn : int".
191 ocaml_libvirt_connect_num_of_defined_domains (value connv)
195 virConnectPtr conn = Connect_val (connv);
198 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
199 CHECK_ERROR (r == -1, "virConnectNumOfDefinedDomains");
201 CAMLreturn (Val_int (r));
204 /* Automatically generated binding for virConnectListDefinedDomains.
205 * In generator.pl this function has signature "conn, int : string array".
209 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
211 CAMLparam2 (connv, iv);
213 CAMLlocal2 (rv, strv);
214 virConnectPtr conn = Connect_val (connv);
215 int i = Int_val (iv);
219 /* Some libvirt List* functions still throw exceptions if i == 0,
220 * so catch that and return an empty array directly. This changes
221 * the semantics slightly (masking other failures) but it's
222 * unlikely anyone will care. RWMJ 2008/06/10
225 rv = caml_alloc (0, 0);
229 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
230 CHECK_ERROR (r == -1, "virConnectListDefinedDomains");
232 rv = caml_alloc (r, 0);
233 for (i = 0; i < r; ++i) {
234 strv = caml_copy_string (names[i]);
235 Store_field (rv, i, strv);
242 /* Automatically generated binding for virConnectNumOfNetworks.
243 * In generator.pl this function has signature "conn : int".
247 ocaml_libvirt_connect_num_of_networks (value connv)
251 virConnectPtr conn = Connect_val (connv);
254 NONBLOCKING (r = virConnectNumOfNetworks (conn));
255 CHECK_ERROR (r == -1, "virConnectNumOfNetworks");
257 CAMLreturn (Val_int (r));
260 /* Automatically generated binding for virConnectListNetworks.
261 * In generator.pl this function has signature "conn, int : string array".
265 ocaml_libvirt_connect_list_networks (value connv, value iv)
267 CAMLparam2 (connv, iv);
269 CAMLlocal2 (rv, strv);
270 virConnectPtr conn = Connect_val (connv);
271 int i = Int_val (iv);
275 /* Some libvirt List* functions still throw exceptions if i == 0,
276 * so catch that and return an empty array directly. This changes
277 * the semantics slightly (masking other failures) but it's
278 * unlikely anyone will care. RWMJ 2008/06/10
281 rv = caml_alloc (0, 0);
285 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
286 CHECK_ERROR (r == -1, "virConnectListNetworks");
288 rv = caml_alloc (r, 0);
289 for (i = 0; i < r; ++i) {
290 strv = caml_copy_string (names[i]);
291 Store_field (rv, i, strv);
298 /* Automatically generated binding for virConnectNumOfDefinedNetworks.
299 * In generator.pl this function has signature "conn : int".
303 ocaml_libvirt_connect_num_of_defined_networks (value connv)
307 virConnectPtr conn = Connect_val (connv);
310 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
311 CHECK_ERROR (r == -1, "virConnectNumOfDefinedNetworks");
313 CAMLreturn (Val_int (r));
316 /* Automatically generated binding for virConnectListDefinedNetworks.
317 * In generator.pl this function has signature "conn, int : string array".
321 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
323 CAMLparam2 (connv, iv);
325 CAMLlocal2 (rv, strv);
326 virConnectPtr conn = Connect_val (connv);
327 int i = Int_val (iv);
331 /* Some libvirt List* functions still throw exceptions if i == 0,
332 * so catch that and return an empty array directly. This changes
333 * the semantics slightly (masking other failures) but it's
334 * unlikely anyone will care. RWMJ 2008/06/10
337 rv = caml_alloc (0, 0);
341 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
342 CHECK_ERROR (r == -1, "virConnectListDefinedNetworks");
344 rv = caml_alloc (r, 0);
345 for (i = 0; i < r; ++i) {
346 strv = caml_copy_string (names[i]);
347 Store_field (rv, i, strv);
354 /* Automatically generated binding for virConnectNumOfStoragePools.
355 * In generator.pl this function has signature "conn : int".
359 ocaml_libvirt_connect_num_of_storage_pools (value connv)
363 virConnectPtr conn = Connect_val (connv);
366 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
367 CHECK_ERROR (r == -1, "virConnectNumOfStoragePools");
369 CAMLreturn (Val_int (r));
372 /* Automatically generated binding for virConnectListStoragePools.
373 * In generator.pl this function has signature "conn, int : string array".
377 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
379 CAMLparam2 (connv, iv);
381 CAMLlocal2 (rv, strv);
382 virConnectPtr conn = Connect_val (connv);
383 int i = Int_val (iv);
387 /* Some libvirt List* functions still throw exceptions if i == 0,
388 * so catch that and return an empty array directly. This changes
389 * the semantics slightly (masking other failures) but it's
390 * unlikely anyone will care. RWMJ 2008/06/10
393 rv = caml_alloc (0, 0);
397 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
398 CHECK_ERROR (r == -1, "virConnectListStoragePools");
400 rv = caml_alloc (r, 0);
401 for (i = 0; i < r; ++i) {
402 strv = caml_copy_string (names[i]);
403 Store_field (rv, i, strv);
410 /* Automatically generated binding for virConnectNumOfDefinedStoragePools.
411 * In generator.pl this function has signature "conn : int".
415 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
419 virConnectPtr conn = Connect_val (connv);
422 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
423 CHECK_ERROR (r == -1, "virConnectNumOfDefinedStoragePools");
425 CAMLreturn (Val_int (r));
428 /* Automatically generated binding for virConnectListDefinedStoragePools.
429 * In generator.pl this function has signature "conn, int : string array".
433 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
435 CAMLparam2 (connv, iv);
437 CAMLlocal2 (rv, strv);
438 virConnectPtr conn = Connect_val (connv);
439 int i = Int_val (iv);
443 /* Some libvirt List* functions still throw exceptions if i == 0,
444 * so catch that and return an empty array directly. This changes
445 * the semantics slightly (masking other failures) but it's
446 * unlikely anyone will care. RWMJ 2008/06/10
449 rv = caml_alloc (0, 0);
453 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
454 CHECK_ERROR (r == -1, "virConnectListDefinedStoragePools");
456 rv = caml_alloc (r, 0);
457 for (i = 0; i < r; ++i) {
458 strv = caml_copy_string (names[i]);
459 Store_field (rv, i, strv);
466 /* Automatically generated binding for virConnectGetCapabilities.
467 * In generator.pl this function has signature "conn : string".
471 ocaml_libvirt_connect_get_capabilities (value connv)
476 virConnectPtr conn = Connect_val (connv);
479 NONBLOCKING (r = virConnectGetCapabilities (conn));
480 CHECK_ERROR (!r, "virConnectGetCapabilities");
482 rv = caml_copy_string (r);
487 /* Automatically generated binding for virConnectDomainEventDeregisterAny.
488 * In generator.pl this function has signature "conn, int : unit".
492 ocaml_libvirt_connect_domain_event_deregister_any (value connv, value iv)
494 CAMLparam2 (connv, iv);
496 virConnectPtr conn = Connect_val (connv);
497 int i = Int_val (iv);
500 NONBLOCKING (r = virConnectDomainEventDeregisterAny (conn, i));
501 CHECK_ERROR (r == -1, "virConnectDomainEventDeregisterAny");
503 CAMLreturn (Val_unit);
506 /* Automatically generated binding for virDomainCreateLinux.
507 * In generator.pl this function has signature "conn, string, 0U : dom".
511 ocaml_libvirt_domain_create_linux (value connv, value strv)
513 CAMLparam2 (connv, strv);
516 virConnectPtr conn = Connect_val (connv);
517 char *str = String_val (strv);
520 NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
521 CHECK_ERROR (!r, "virDomainCreateLinux");
523 rv = Val_domain (r, connv);
528 /* Automatically generated binding for virDomainCreateXML.
529 * In generator.pl this function has signature "conn, string, unsigned : dom".
533 ocaml_libvirt_domain_create_xml (value connv, value strv, value uv)
535 CAMLparam3 (connv, strv, uv);
538 virConnectPtr conn = Connect_val (connv);
539 char *str = String_val (strv);
540 unsigned int u = Int_val (uv);
543 NONBLOCKING (r = virDomainCreateXML (conn, str, u));
544 CHECK_ERROR (!r, "virDomainCreateXML");
546 rv = Val_domain (r, connv);
551 /* Automatically generated binding for virDomainFree.
552 * In generator.pl this function has signature "dom : free".
556 ocaml_libvirt_domain_free (value domv)
560 virDomainPtr dom = Domain_val (domv);
563 NONBLOCKING (r = virDomainFree (dom));
564 CHECK_ERROR (r == -1, "virDomainFree");
566 /* So that we don't double-free in the finalizer: */
567 Domain_val (domv) = NULL;
569 CAMLreturn (Val_unit);
572 /* Automatically generated binding for virDomainDestroy.
573 * In generator.pl this function has signature "dom : free".
577 ocaml_libvirt_domain_destroy (value domv)
581 virDomainPtr dom = Domain_val (domv);
584 NONBLOCKING (r = virDomainDestroy (dom));
585 CHECK_ERROR (r == -1, "virDomainDestroy");
587 /* So that we don't double-free in the finalizer: */
588 Domain_val (domv) = NULL;
590 CAMLreturn (Val_unit);
593 /* Automatically generated binding for virDomainLookupByName.
594 * In generator.pl this function has signature "conn, string : dom".
598 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
600 CAMLparam2 (connv, strv);
603 virConnectPtr conn = Connect_val (connv);
604 char *str = String_val (strv);
607 NONBLOCKING (r = virDomainLookupByName (conn, str));
608 CHECK_ERROR (!r, "virDomainLookupByName");
610 rv = Val_domain (r, connv);
615 /* Automatically generated binding for virDomainLookupByID.
616 * In generator.pl this function has signature "conn, int : dom".
620 ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
622 CAMLparam2 (connv, iv);
625 virConnectPtr conn = Connect_val (connv);
626 int i = Int_val (iv);
629 NONBLOCKING (r = virDomainLookupByID (conn, i));
630 CHECK_ERROR (!r, "virDomainLookupByID");
632 rv = Val_domain (r, connv);
637 /* Automatically generated binding for virDomainLookupByUUID.
638 * In generator.pl this function has signature "conn, uuid : dom".
642 ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
644 CAMLparam2 (connv, uuidv);
647 virConnectPtr conn = Connect_val (connv);
648 unsigned char *uuid = (unsigned char *) String_val (uuidv);
651 NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
652 CHECK_ERROR (!r, "virDomainLookupByUUID");
654 rv = Val_domain (r, connv);
659 /* Automatically generated binding for virDomainLookupByUUIDString.
660 * In generator.pl this function has signature "conn, string : dom".
664 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
666 CAMLparam2 (connv, strv);
669 virConnectPtr conn = Connect_val (connv);
670 char *str = String_val (strv);
673 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
674 CHECK_ERROR (!r, "virDomainLookupByUUIDString");
676 rv = Val_domain (r, connv);
681 /* Automatically generated binding for virDomainGetName.
682 * In generator.pl this function has signature "dom : static string".
686 ocaml_libvirt_domain_get_name (value domv)
691 virDomainPtr dom = Domain_val (domv);
694 NONBLOCKING (r = virDomainGetName (dom));
695 CHECK_ERROR (!r, "virDomainGetName");
697 rv = caml_copy_string (r);
701 /* Automatically generated binding for virDomainGetOSType.
702 * In generator.pl this function has signature "dom : string".
706 ocaml_libvirt_domain_get_os_type (value domv)
711 virDomainPtr dom = Domain_val (domv);
714 NONBLOCKING (r = virDomainGetOSType (dom));
715 CHECK_ERROR (!r, "virDomainGetOSType");
717 rv = caml_copy_string (r);
722 /* Automatically generated binding for virDomainGetXMLDesc.
723 * In generator.pl this function has signature "dom, 0 : string".
727 ocaml_libvirt_domain_get_xml_desc (value domv)
732 virDomainPtr dom = Domain_val (domv);
735 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
736 CHECK_ERROR (!r, "virDomainGetXMLDesc");
738 rv = caml_copy_string (r);
743 /* Automatically generated binding for virDomainGetUUID.
744 * In generator.pl this function has signature "dom : uuid".
748 ocaml_libvirt_domain_get_uuid (value domv)
753 virDomainPtr dom = Domain_val (domv);
754 unsigned char uuid[VIR_UUID_BUFLEN];
757 NONBLOCKING (r = virDomainGetUUID (dom, uuid));
758 CHECK_ERROR (r == -1, "virDomainGetUUID");
760 /* UUIDs are byte arrays with a fixed length. */
761 rv = caml_alloc_string (VIR_UUID_BUFLEN);
762 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
766 /* Automatically generated binding for virDomainGetUUIDString.
767 * In generator.pl this function has signature "dom : uuid string".
771 ocaml_libvirt_domain_get_uuid_string (value domv)
776 virDomainPtr dom = Domain_val (domv);
777 char uuid[VIR_UUID_STRING_BUFLEN];
780 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
781 CHECK_ERROR (r == -1, "virDomainGetUUIDString");
783 rv = caml_copy_string (uuid);
787 /* Automatically generated binding for virDomainGetMaxVcpus.
788 * In generator.pl this function has signature "dom : int".
792 ocaml_libvirt_domain_get_max_vcpus (value domv)
796 virDomainPtr dom = Domain_val (domv);
799 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
800 CHECK_ERROR (r == -1, "virDomainGetMaxVcpus");
802 CAMLreturn (Val_int (r));
805 /* Automatically generated binding for virDomainSave.
806 * In generator.pl this function has signature "dom, string : unit".
810 ocaml_libvirt_domain_save (value domv, value strv)
812 CAMLparam2 (domv, strv);
814 virDomainPtr dom = Domain_val (domv);
815 char *str = String_val (strv);
818 NONBLOCKING (r = virDomainSave (dom, str));
819 CHECK_ERROR (r == -1, "virDomainSave");
821 CAMLreturn (Val_unit);
824 /* Automatically generated binding for virDomainRestore.
825 * In generator.pl this function has signature "conn, string : unit".
829 ocaml_libvirt_domain_restore (value connv, value strv)
831 CAMLparam2 (connv, strv);
833 virConnectPtr conn = Connect_val (connv);
834 char *str = String_val (strv);
837 NONBLOCKING (r = virDomainRestore (conn, str));
838 CHECK_ERROR (r == -1, "virDomainRestore");
840 CAMLreturn (Val_unit);
843 /* Automatically generated binding for virDomainCoreDump.
844 * In generator.pl this function has signature "dom, string, 0 : unit".
848 ocaml_libvirt_domain_core_dump (value domv, value strv)
850 CAMLparam2 (domv, strv);
853 virDomainPtr dom = Domain_val (domv);
854 char *str = String_val (strv);
857 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
858 CHECK_ERROR (!r, "virDomainCoreDump");
860 CAMLreturn (Val_unit);
863 /* Automatically generated binding for virDomainSuspend.
864 * In generator.pl this function has signature "dom : unit".
868 ocaml_libvirt_domain_suspend (value domv)
872 virDomainPtr dom = Domain_val (domv);
875 NONBLOCKING (r = virDomainSuspend (dom));
876 CHECK_ERROR (r == -1, "virDomainSuspend");
878 CAMLreturn (Val_unit);
881 /* Automatically generated binding for virDomainResume.
882 * In generator.pl this function has signature "dom : unit".
886 ocaml_libvirt_domain_resume (value domv)
890 virDomainPtr dom = Domain_val (domv);
893 NONBLOCKING (r = virDomainResume (dom));
894 CHECK_ERROR (r == -1, "virDomainResume");
896 CAMLreturn (Val_unit);
899 /* Automatically generated binding for virDomainShutdown.
900 * In generator.pl this function has signature "dom : unit".
904 ocaml_libvirt_domain_shutdown (value domv)
908 virDomainPtr dom = Domain_val (domv);
911 NONBLOCKING (r = virDomainShutdown (dom));
912 CHECK_ERROR (r == -1, "virDomainShutdown");
914 CAMLreturn (Val_unit);
917 /* Automatically generated binding for virDomainReboot.
918 * In generator.pl this function has signature "dom, 0 : unit".
922 ocaml_libvirt_domain_reboot (value domv)
926 virDomainPtr dom = Domain_val (domv);
929 NONBLOCKING (r = virDomainReboot (dom, 0));
930 CHECK_ERROR (r == -1, "virDomainReboot");
932 CAMLreturn (Val_unit);
935 /* Automatically generated binding for virDomainDefineXML.
936 * In generator.pl this function has signature "conn, string : dom".
940 ocaml_libvirt_domain_define_xml (value connv, value strv)
942 CAMLparam2 (connv, strv);
945 virConnectPtr conn = Connect_val (connv);
946 char *str = String_val (strv);
949 NONBLOCKING (r = virDomainDefineXML (conn, str));
950 CHECK_ERROR (!r, "virDomainDefineXML");
952 rv = Val_domain (r, connv);
957 /* Automatically generated binding for virDomainUndefine.
958 * In generator.pl this function has signature "dom : unit".
962 ocaml_libvirt_domain_undefine (value domv)
966 virDomainPtr dom = Domain_val (domv);
969 NONBLOCKING (r = virDomainUndefine (dom));
970 CHECK_ERROR (r == -1, "virDomainUndefine");
972 CAMLreturn (Val_unit);
975 /* Automatically generated binding for virDomainCreate.
976 * In generator.pl this function has signature "dom : unit".
980 ocaml_libvirt_domain_create (value domv)
984 virDomainPtr dom = Domain_val (domv);
987 NONBLOCKING (r = virDomainCreate (dom));
988 CHECK_ERROR (r == -1, "virDomainCreate");
990 CAMLreturn (Val_unit);
993 /* Automatically generated binding for virDomainAttachDevice.
994 * In generator.pl this function has signature "dom, string : unit".
998 ocaml_libvirt_domain_attach_device (value domv, value strv)
1000 CAMLparam2 (domv, strv);
1002 virDomainPtr dom = Domain_val (domv);
1003 char *str = String_val (strv);
1006 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1007 CHECK_ERROR (r == -1, "virDomainAttachDevice");
1009 CAMLreturn (Val_unit);
1012 /* Automatically generated binding for virDomainDetachDevice.
1013 * In generator.pl this function has signature "dom, string : unit".
1017 ocaml_libvirt_domain_detach_device (value domv, value strv)
1019 CAMLparam2 (domv, strv);
1021 virDomainPtr dom = Domain_val (domv);
1022 char *str = String_val (strv);
1025 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1026 CHECK_ERROR (r == -1, "virDomainDetachDevice");
1028 CAMLreturn (Val_unit);
1031 /* Automatically generated binding for virDomainGetAutostart.
1032 * In generator.pl this function has signature "dom : bool".
1036 ocaml_libvirt_domain_get_autostart (value domv)
1040 virDomainPtr dom = Domain_val (domv);
1043 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1044 CHECK_ERROR (r == -1, "virDomainGetAutostart");
1046 CAMLreturn (b ? Val_true : Val_false);
1049 /* Automatically generated binding for virDomainSetAutostart.
1050 * In generator.pl this function has signature "dom, bool : unit".
1054 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1056 CAMLparam2 (domv, bv);
1058 virDomainPtr dom = Domain_val (domv);
1061 b = bv == Val_true ? 1 : 0;
1063 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1064 CHECK_ERROR (r == -1, "virDomainSetAutostart");
1066 CAMLreturn (Val_unit);
1069 /* Automatically generated binding for virNetworkFree.
1070 * In generator.pl this function has signature "net : free".
1074 ocaml_libvirt_network_free (value netv)
1078 virNetworkPtr net = Network_val (netv);
1081 NONBLOCKING (r = virNetworkFree (net));
1082 CHECK_ERROR (r == -1, "virNetworkFree");
1084 /* So that we don't double-free in the finalizer: */
1085 Network_val (netv) = NULL;
1087 CAMLreturn (Val_unit);
1090 /* Automatically generated binding for virNetworkDestroy.
1091 * In generator.pl this function has signature "net : free".
1095 ocaml_libvirt_network_destroy (value netv)
1099 virNetworkPtr net = Network_val (netv);
1102 NONBLOCKING (r = virNetworkDestroy (net));
1103 CHECK_ERROR (r == -1, "virNetworkDestroy");
1105 /* So that we don't double-free in the finalizer: */
1106 Network_val (netv) = NULL;
1108 CAMLreturn (Val_unit);
1111 /* Automatically generated binding for virNetworkLookupByName.
1112 * In generator.pl this function has signature "conn, string : net".
1116 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1118 CAMLparam2 (connv, strv);
1121 virConnectPtr conn = Connect_val (connv);
1122 char *str = String_val (strv);
1125 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1126 CHECK_ERROR (!r, "virNetworkLookupByName");
1128 rv = Val_network (r, connv);
1133 /* Automatically generated binding for virNetworkLookupByUUID.
1134 * In generator.pl this function has signature "conn, uuid : net".
1138 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1140 CAMLparam2 (connv, uuidv);
1143 virConnectPtr conn = Connect_val (connv);
1144 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1147 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1148 CHECK_ERROR (!r, "virNetworkLookupByUUID");
1150 rv = Val_network (r, connv);
1155 /* Automatically generated binding for virNetworkLookupByUUIDString.
1156 * In generator.pl this function has signature "conn, string : net".
1160 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1162 CAMLparam2 (connv, strv);
1165 virConnectPtr conn = Connect_val (connv);
1166 char *str = String_val (strv);
1169 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1170 CHECK_ERROR (!r, "virNetworkLookupByUUIDString");
1172 rv = Val_network (r, connv);
1177 /* Automatically generated binding for virNetworkGetName.
1178 * In generator.pl this function has signature "net : static string".
1182 ocaml_libvirt_network_get_name (value netv)
1187 virNetworkPtr net = Network_val (netv);
1190 NONBLOCKING (r = virNetworkGetName (net));
1191 CHECK_ERROR (!r, "virNetworkGetName");
1193 rv = caml_copy_string (r);
1197 /* Automatically generated binding for virNetworkGetXMLDesc.
1198 * In generator.pl this function has signature "net, 0 : string".
1202 ocaml_libvirt_network_get_xml_desc (value netv)
1207 virNetworkPtr net = Network_val (netv);
1210 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1211 CHECK_ERROR (!r, "virNetworkGetXMLDesc");
1213 rv = caml_copy_string (r);
1218 /* Automatically generated binding for virNetworkGetBridgeName.
1219 * In generator.pl this function has signature "net : string".
1223 ocaml_libvirt_network_get_bridge_name (value netv)
1228 virNetworkPtr net = Network_val (netv);
1231 NONBLOCKING (r = virNetworkGetBridgeName (net));
1232 CHECK_ERROR (!r, "virNetworkGetBridgeName");
1234 rv = caml_copy_string (r);
1239 /* Automatically generated binding for virNetworkGetUUID.
1240 * In generator.pl this function has signature "net : uuid".
1244 ocaml_libvirt_network_get_uuid (value netv)
1249 virNetworkPtr net = Network_val (netv);
1250 unsigned char uuid[VIR_UUID_BUFLEN];
1253 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1254 CHECK_ERROR (r == -1, "virNetworkGetUUID");
1256 /* UUIDs are byte arrays with a fixed length. */
1257 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1258 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1262 /* Automatically generated binding for virNetworkGetUUIDString.
1263 * In generator.pl this function has signature "net : uuid string".
1267 ocaml_libvirt_network_get_uuid_string (value netv)
1272 virNetworkPtr net = Network_val (netv);
1273 char uuid[VIR_UUID_STRING_BUFLEN];
1276 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1277 CHECK_ERROR (r == -1, "virNetworkGetUUIDString");
1279 rv = caml_copy_string (uuid);
1283 /* Automatically generated binding for virNetworkUndefine.
1284 * In generator.pl this function has signature "net : unit".
1288 ocaml_libvirt_network_undefine (value netv)
1292 virNetworkPtr net = Network_val (netv);
1295 NONBLOCKING (r = virNetworkUndefine (net));
1296 CHECK_ERROR (r == -1, "virNetworkUndefine");
1298 CAMLreturn (Val_unit);
1301 /* Automatically generated binding for virNetworkCreateXML.
1302 * In generator.pl this function has signature "conn, string : net".
1306 ocaml_libvirt_network_create_xml (value connv, value strv)
1308 CAMLparam2 (connv, strv);
1311 virConnectPtr conn = Connect_val (connv);
1312 char *str = String_val (strv);
1315 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1316 CHECK_ERROR (!r, "virNetworkCreateXML");
1318 rv = Val_network (r, connv);
1323 /* Automatically generated binding for virNetworkDefineXML.
1324 * In generator.pl this function has signature "conn, string : net".
1328 ocaml_libvirt_network_define_xml (value connv, value strv)
1330 CAMLparam2 (connv, strv);
1333 virConnectPtr conn = Connect_val (connv);
1334 char *str = String_val (strv);
1337 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1338 CHECK_ERROR (!r, "virNetworkDefineXML");
1340 rv = Val_network (r, connv);
1345 /* Automatically generated binding for virNetworkCreate.
1346 * In generator.pl this function has signature "net : unit".
1350 ocaml_libvirt_network_create (value netv)
1354 virNetworkPtr net = Network_val (netv);
1357 NONBLOCKING (r = virNetworkCreate (net));
1358 CHECK_ERROR (r == -1, "virNetworkCreate");
1360 CAMLreturn (Val_unit);
1363 /* Automatically generated binding for virNetworkGetAutostart.
1364 * In generator.pl this function has signature "net : bool".
1368 ocaml_libvirt_network_get_autostart (value netv)
1372 virNetworkPtr net = Network_val (netv);
1375 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1376 CHECK_ERROR (r == -1, "virNetworkGetAutostart");
1378 CAMLreturn (b ? Val_true : Val_false);
1381 /* Automatically generated binding for virNetworkSetAutostart.
1382 * In generator.pl this function has signature "net, bool : unit".
1386 ocaml_libvirt_network_set_autostart (value netv, value bv)
1388 CAMLparam2 (netv, bv);
1390 virNetworkPtr net = Network_val (netv);
1393 b = bv == Val_true ? 1 : 0;
1395 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1396 CHECK_ERROR (r == -1, "virNetworkSetAutostart");
1398 CAMLreturn (Val_unit);
1401 /* Automatically generated binding for virStoragePoolFree.
1402 * In generator.pl this function has signature "pool : free".
1406 ocaml_libvirt_storage_pool_free (value poolv)
1410 virStoragePoolPtr pool = Pool_val (poolv);
1413 NONBLOCKING (r = virStoragePoolFree (pool));
1414 CHECK_ERROR (r == -1, "virStoragePoolFree");
1416 /* So that we don't double-free in the finalizer: */
1417 Pool_val (poolv) = NULL;
1419 CAMLreturn (Val_unit);
1422 /* Automatically generated binding for virStoragePoolDestroy.
1423 * In generator.pl this function has signature "pool : free".
1427 ocaml_libvirt_storage_pool_destroy (value poolv)
1431 virStoragePoolPtr pool = Pool_val (poolv);
1434 NONBLOCKING (r = virStoragePoolDestroy (pool));
1435 CHECK_ERROR (r == -1, "virStoragePoolDestroy");
1437 /* So that we don't double-free in the finalizer: */
1438 Pool_val (poolv) = NULL;
1440 CAMLreturn (Val_unit);
1443 /* Automatically generated binding for virStoragePoolLookupByName.
1444 * In generator.pl this function has signature "conn, string : pool".
1448 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1450 CAMLparam2 (connv, strv);
1453 virConnectPtr conn = Connect_val (connv);
1454 char *str = String_val (strv);
1455 virStoragePoolPtr r;
1457 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1458 CHECK_ERROR (!r, "virStoragePoolLookupByName");
1460 rv = Val_pool (r, connv);
1465 /* Automatically generated binding for virStoragePoolLookupByUUID.
1466 * In generator.pl this function has signature "conn, uuid : pool".
1470 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1472 CAMLparam2 (connv, uuidv);
1475 virConnectPtr conn = Connect_val (connv);
1476 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1477 virStoragePoolPtr r;
1479 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1480 CHECK_ERROR (!r, "virStoragePoolLookupByUUID");
1482 rv = Val_pool (r, connv);
1487 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1488 * In generator.pl this function has signature "conn, string : pool".
1492 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1494 CAMLparam2 (connv, strv);
1497 virConnectPtr conn = Connect_val (connv);
1498 char *str = String_val (strv);
1499 virStoragePoolPtr r;
1501 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1502 CHECK_ERROR (!r, "virStoragePoolLookupByUUIDString");
1504 rv = Val_pool (r, connv);
1509 /* Automatically generated binding for virStoragePoolGetName.
1510 * In generator.pl this function has signature "pool : static string".
1514 ocaml_libvirt_storage_pool_get_name (value poolv)
1519 virStoragePoolPtr pool = Pool_val (poolv);
1522 NONBLOCKING (r = virStoragePoolGetName (pool));
1523 CHECK_ERROR (!r, "virStoragePoolGetName");
1525 rv = caml_copy_string (r);
1529 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1530 * In generator.pl this function has signature "pool, 0U : string".
1534 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1539 virStoragePoolPtr pool = Pool_val (poolv);
1542 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1543 CHECK_ERROR (!r, "virStoragePoolGetXMLDesc");
1545 rv = caml_copy_string (r);
1550 /* Automatically generated binding for virStoragePoolGetUUID.
1551 * In generator.pl this function has signature "pool : uuid".
1555 ocaml_libvirt_storage_pool_get_uuid (value poolv)
1560 virStoragePoolPtr pool = Pool_val (poolv);
1561 unsigned char uuid[VIR_UUID_BUFLEN];
1564 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
1565 CHECK_ERROR (r == -1, "virStoragePoolGetUUID");
1567 /* UUIDs are byte arrays with a fixed length. */
1568 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1569 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1573 /* Automatically generated binding for virStoragePoolGetUUIDString.
1574 * In generator.pl this function has signature "pool : uuid string".
1578 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
1583 virStoragePoolPtr pool = Pool_val (poolv);
1584 char uuid[VIR_UUID_STRING_BUFLEN];
1587 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
1588 CHECK_ERROR (r == -1, "virStoragePoolGetUUIDString");
1590 rv = caml_copy_string (uuid);
1594 /* Automatically generated binding for virStoragePoolCreateXML.
1595 * In generator.pl this function has signature "conn, string, 0U : pool".
1599 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
1601 CAMLparam2 (connv, strv);
1604 virConnectPtr conn = Connect_val (connv);
1605 char *str = String_val (strv);
1606 virStoragePoolPtr r;
1608 NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0));
1609 CHECK_ERROR (!r, "virStoragePoolCreateXML");
1611 rv = Val_pool (r, connv);
1616 /* Automatically generated binding for virStoragePoolDefineXML.
1617 * In generator.pl this function has signature "conn, string, 0U : pool".
1621 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
1623 CAMLparam2 (connv, strv);
1626 virConnectPtr conn = Connect_val (connv);
1627 char *str = String_val (strv);
1628 virStoragePoolPtr r;
1630 NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0));
1631 CHECK_ERROR (!r, "virStoragePoolDefineXML");
1633 rv = Val_pool (r, connv);
1638 /* Automatically generated binding for virStoragePoolBuild.
1639 * In generator.pl this function has signature "pool, uint : unit".
1643 ocaml_libvirt_storage_pool_build (value poolv, value iv)
1645 CAMLparam2 (poolv, iv);
1647 virStoragePoolPtr pool = Pool_val (poolv);
1648 unsigned int i = Int_val (iv);
1651 NONBLOCKING (r = virStoragePoolBuild (pool, i));
1652 CHECK_ERROR (r == -1, "virStoragePoolBuild");
1654 CAMLreturn (Val_unit);
1657 /* Automatically generated binding for virStoragePoolUndefine.
1658 * In generator.pl this function has signature "pool : unit".
1662 ocaml_libvirt_storage_pool_undefine (value poolv)
1666 virStoragePoolPtr pool = Pool_val (poolv);
1669 NONBLOCKING (r = virStoragePoolUndefine (pool));
1670 CHECK_ERROR (r == -1, "virStoragePoolUndefine");
1672 CAMLreturn (Val_unit);
1675 /* Automatically generated binding for virStoragePoolCreate.
1676 * In generator.pl this function has signature "pool, 0U : unit".
1680 ocaml_libvirt_storage_pool_create (value poolv)
1684 virStoragePoolPtr pool = Pool_val (poolv);
1687 NONBLOCKING (r = virStoragePoolCreate (pool, 0));
1688 CHECK_ERROR (r == -1, "virStoragePoolCreate");
1690 CAMLreturn (Val_unit);
1693 /* Automatically generated binding for virStoragePoolDelete.
1694 * In generator.pl this function has signature "pool, uint : unit".
1698 ocaml_libvirt_storage_pool_delete (value poolv, value iv)
1700 CAMLparam2 (poolv, iv);
1702 virStoragePoolPtr pool = Pool_val (poolv);
1703 unsigned int i = Int_val (iv);
1706 NONBLOCKING (r = virStoragePoolDelete (pool, i));
1707 CHECK_ERROR (r == -1, "virStoragePoolDelete");
1709 CAMLreturn (Val_unit);
1712 /* Automatically generated binding for virStoragePoolRefresh.
1713 * In generator.pl this function has signature "pool, 0U : unit".
1717 ocaml_libvirt_storage_pool_refresh (value poolv)
1721 virStoragePoolPtr pool = Pool_val (poolv);
1724 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
1725 CHECK_ERROR (r == -1, "virStoragePoolRefresh");
1727 CAMLreturn (Val_unit);
1730 /* Automatically generated binding for virStoragePoolGetAutostart.
1731 * In generator.pl this function has signature "pool : bool".
1735 ocaml_libvirt_storage_pool_get_autostart (value poolv)
1739 virStoragePoolPtr pool = Pool_val (poolv);
1742 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
1743 CHECK_ERROR (r == -1, "virStoragePoolGetAutostart");
1745 CAMLreturn (b ? Val_true : Val_false);
1748 /* Automatically generated binding for virStoragePoolSetAutostart.
1749 * In generator.pl this function has signature "pool, bool : unit".
1753 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
1755 CAMLparam2 (poolv, bv);
1757 virStoragePoolPtr pool = Pool_val (poolv);
1760 b = bv == Val_true ? 1 : 0;
1762 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
1763 CHECK_ERROR (r == -1, "virStoragePoolSetAutostart");
1765 CAMLreturn (Val_unit);
1768 /* Automatically generated binding for virStoragePoolNumOfVolumes.
1769 * In generator.pl this function has signature "pool : int".
1773 ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
1777 virStoragePoolPtr pool = Pool_val (poolv);
1780 NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
1781 CHECK_ERROR (r == -1, "virStoragePoolNumOfVolumes");
1783 CAMLreturn (Val_int (r));
1786 /* Automatically generated binding for virStoragePoolListVolumes.
1787 * In generator.pl this function has signature "pool, int : string array".
1791 ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
1793 CAMLparam2 (poolv, iv);
1795 CAMLlocal2 (rv, strv);
1796 virStoragePoolPtr pool = Pool_val (poolv);
1797 int i = Int_val (iv);
1801 /* Some libvirt List* functions still throw exceptions if i == 0,
1802 * so catch that and return an empty array directly. This changes
1803 * the semantics slightly (masking other failures) but it's
1804 * unlikely anyone will care. RWMJ 2008/06/10
1807 rv = caml_alloc (0, 0);
1811 NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
1812 CHECK_ERROR (r == -1, "virStoragePoolListVolumes");
1814 rv = caml_alloc (r, 0);
1815 for (i = 0; i < r; ++i) {
1816 strv = caml_copy_string (names[i]);
1817 Store_field (rv, i, strv);
1824 /* Automatically generated binding for virStorageVolFree.
1825 * In generator.pl this function has signature "vol : free".
1829 ocaml_libvirt_storage_vol_free (value volv)
1833 virStorageVolPtr vol = Volume_val (volv);
1836 NONBLOCKING (r = virStorageVolFree (vol));
1837 CHECK_ERROR (r == -1, "virStorageVolFree");
1839 /* So that we don't double-free in the finalizer: */
1840 Volume_val (volv) = NULL;
1842 CAMLreturn (Val_unit);
1845 /* Automatically generated binding for virStorageVolDelete.
1846 * In generator.pl this function has signature "vol, uint : unit".
1850 ocaml_libvirt_storage_vol_delete (value volv, value iv)
1852 CAMLparam2 (volv, iv);
1854 virStorageVolPtr vol = Volume_val (volv);
1855 unsigned int i = Int_val (iv);
1858 NONBLOCKING (r = virStorageVolDelete (vol, i));
1859 CHECK_ERROR (r == -1, "virStorageVolDelete");
1861 CAMLreturn (Val_unit);
1864 /* Automatically generated binding for virStorageVolLookupByName.
1865 * In generator.pl this function has signature "pool, string : vol from pool".
1869 ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
1871 CAMLparam2 (poolv, strv);
1873 CAMLlocal2 (rv, connv);
1874 virStoragePoolPtr pool = Pool_val (poolv);
1875 char *str = String_val (strv);
1878 NONBLOCKING (r = virStorageVolLookupByName (pool, str));
1879 CHECK_ERROR (!r, "virStorageVolLookupByName");
1881 connv = Field (poolv, 1);
1882 rv = Val_volume (r, connv);
1887 /* Automatically generated binding for virStorageVolLookupByKey.
1888 * In generator.pl this function has signature "conn, string : vol".
1892 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
1894 CAMLparam2 (connv, strv);
1897 virConnectPtr conn = Connect_val (connv);
1898 char *str = String_val (strv);
1901 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
1902 CHECK_ERROR (!r, "virStorageVolLookupByKey");
1904 rv = Val_volume (r, connv);
1909 /* Automatically generated binding for virStorageVolLookupByPath.
1910 * In generator.pl this function has signature "conn, string : vol".
1914 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
1916 CAMLparam2 (connv, strv);
1919 virConnectPtr conn = Connect_val (connv);
1920 char *str = String_val (strv);
1923 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
1924 CHECK_ERROR (!r, "virStorageVolLookupByPath");
1926 rv = Val_volume (r, connv);
1931 /* Automatically generated binding for virStorageVolCreateXML.
1932 * In generator.pl this function has signature "pool, string, 0U : vol from pool".
1936 ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
1938 CAMLparam2 (poolv, strv);
1940 CAMLlocal2 (rv, connv);
1941 virStoragePoolPtr pool = Pool_val (poolv);
1942 char *str = String_val (strv);
1945 NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
1946 CHECK_ERROR (!r, "virStorageVolCreateXML");
1948 connv = Field (poolv, 1);
1949 rv = Val_volume (r, connv);
1954 /* Automatically generated binding for virStorageVolGetXMLDesc.
1955 * In generator.pl this function has signature "vol, 0U : string".
1959 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
1964 virStorageVolPtr vol = Volume_val (volv);
1967 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
1968 CHECK_ERROR (!r, "virStorageVolGetXMLDesc");
1970 rv = caml_copy_string (r);
1975 /* Automatically generated binding for virStorageVolGetPath.
1976 * In generator.pl this function has signature "vol : string".
1980 ocaml_libvirt_storage_vol_get_path (value volv)
1985 virStorageVolPtr vol = Volume_val (volv);
1988 NONBLOCKING (r = virStorageVolGetPath (vol));
1989 CHECK_ERROR (!r, "virStorageVolGetPath");
1991 rv = caml_copy_string (r);
1996 /* Automatically generated binding for virStorageVolGetKey.
1997 * In generator.pl this function has signature "vol : static string".
2001 ocaml_libvirt_storage_vol_get_key (value volv)
2006 virStorageVolPtr vol = Volume_val (volv);
2009 NONBLOCKING (r = virStorageVolGetKey (vol));
2010 CHECK_ERROR (!r, "virStorageVolGetKey");
2012 rv = caml_copy_string (r);
2016 /* Automatically generated binding for virStorageVolGetName.
2017 * In generator.pl this function has signature "vol : static string".
2021 ocaml_libvirt_storage_vol_get_name (value volv)
2026 virStorageVolPtr vol = Volume_val (volv);
2029 NONBLOCKING (r = virStorageVolGetName (vol));
2030 CHECK_ERROR (!r, "virStorageVolGetName");
2032 rv = caml_copy_string (r);
2036 /* Automatically generated binding for virStoragePoolLookupByVolume.
2037 * In generator.pl this function has signature "vol : pool from vol".
2041 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2045 CAMLlocal2 (rv, connv);
2046 virStorageVolPtr vol = Volume_val (volv);
2047 virStoragePoolPtr r;
2049 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2050 CHECK_ERROR (!r, "virStoragePoolLookupByVolume");
2052 connv = Field (volv, 1);
2053 rv = Val_pool (r, connv);
2058 #include "libvirt_c_epilogue.c"