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 ids = malloc (sizeof (*ids) * i);
178 caml_raise_out_of_memory ();
180 NONBLOCKING (r = virConnectListDomains (conn, ids, i));
181 CHECK_ERROR_CLEANUP (r == -1, free (ids), "virConnectListDomains");
183 rv = caml_alloc (r, 0);
184 for (i = 0; i < r; ++i)
185 Store_field (rv, i, Val_int (ids[i]));
191 /* Automatically generated binding for virConnectNumOfDefinedDomains.
192 * In generator.pl this function has signature "conn : int".
196 ocaml_libvirt_connect_num_of_defined_domains (value connv)
200 virConnectPtr conn = Connect_val (connv);
203 NONBLOCKING (r = virConnectNumOfDefinedDomains (conn));
204 CHECK_ERROR (r == -1, "virConnectNumOfDefinedDomains");
206 CAMLreturn (Val_int (r));
209 /* Automatically generated binding for virConnectListDefinedDomains.
210 * In generator.pl this function has signature "conn, int : string array".
214 ocaml_libvirt_connect_list_defined_domains (value connv, value iv)
216 CAMLparam2 (connv, iv);
218 CAMLlocal2 (rv, strv);
219 virConnectPtr conn = Connect_val (connv);
220 int i = Int_val (iv);
224 /* Some libvirt List* functions still throw exceptions if i == 0,
225 * so catch that and return an empty array directly. This changes
226 * the semantics slightly (masking other failures) but it's
227 * unlikely anyone will care. RWMJ 2008/06/10
230 rv = caml_alloc (0, 0);
234 names = malloc (sizeof (*names) * i);
236 caml_raise_out_of_memory ();
238 NONBLOCKING (r = virConnectListDefinedDomains (conn, names, i));
239 CHECK_ERROR_CLEANUP (r == -1, free (names), "virConnectListDefinedDomains");
241 rv = caml_alloc (r, 0);
242 for (i = 0; i < r; ++i) {
243 strv = caml_copy_string (names[i]);
244 Store_field (rv, i, strv);
252 /* Automatically generated binding for virConnectNumOfNetworks.
253 * In generator.pl this function has signature "conn : int".
257 ocaml_libvirt_connect_num_of_networks (value connv)
261 virConnectPtr conn = Connect_val (connv);
264 NONBLOCKING (r = virConnectNumOfNetworks (conn));
265 CHECK_ERROR (r == -1, "virConnectNumOfNetworks");
267 CAMLreturn (Val_int (r));
270 /* Automatically generated binding for virConnectListNetworks.
271 * In generator.pl this function has signature "conn, int : string array".
275 ocaml_libvirt_connect_list_networks (value connv, value iv)
277 CAMLparam2 (connv, iv);
279 CAMLlocal2 (rv, strv);
280 virConnectPtr conn = Connect_val (connv);
281 int i = Int_val (iv);
285 /* Some libvirt List* functions still throw exceptions if i == 0,
286 * so catch that and return an empty array directly. This changes
287 * the semantics slightly (masking other failures) but it's
288 * unlikely anyone will care. RWMJ 2008/06/10
291 rv = caml_alloc (0, 0);
295 names = malloc (sizeof (*names) * i);
297 caml_raise_out_of_memory ();
299 NONBLOCKING (r = virConnectListNetworks (conn, names, i));
300 CHECK_ERROR_CLEANUP (r == -1, free (names), "virConnectListNetworks");
302 rv = caml_alloc (r, 0);
303 for (i = 0; i < r; ++i) {
304 strv = caml_copy_string (names[i]);
305 Store_field (rv, i, strv);
313 /* Automatically generated binding for virConnectNumOfDefinedNetworks.
314 * In generator.pl this function has signature "conn : int".
318 ocaml_libvirt_connect_num_of_defined_networks (value connv)
322 virConnectPtr conn = Connect_val (connv);
325 NONBLOCKING (r = virConnectNumOfDefinedNetworks (conn));
326 CHECK_ERROR (r == -1, "virConnectNumOfDefinedNetworks");
328 CAMLreturn (Val_int (r));
331 /* Automatically generated binding for virConnectListDefinedNetworks.
332 * In generator.pl this function has signature "conn, int : string array".
336 ocaml_libvirt_connect_list_defined_networks (value connv, value iv)
338 CAMLparam2 (connv, iv);
340 CAMLlocal2 (rv, strv);
341 virConnectPtr conn = Connect_val (connv);
342 int i = Int_val (iv);
346 /* Some libvirt List* functions still throw exceptions if i == 0,
347 * so catch that and return an empty array directly. This changes
348 * the semantics slightly (masking other failures) but it's
349 * unlikely anyone will care. RWMJ 2008/06/10
352 rv = caml_alloc (0, 0);
356 names = malloc (sizeof (*names) * i);
358 caml_raise_out_of_memory ();
360 NONBLOCKING (r = virConnectListDefinedNetworks (conn, names, i));
361 CHECK_ERROR_CLEANUP (r == -1, free (names), "virConnectListDefinedNetworks");
363 rv = caml_alloc (r, 0);
364 for (i = 0; i < r; ++i) {
365 strv = caml_copy_string (names[i]);
366 Store_field (rv, i, strv);
374 /* Automatically generated binding for virConnectNumOfStoragePools.
375 * In generator.pl this function has signature "conn : int".
379 ocaml_libvirt_connect_num_of_storage_pools (value connv)
383 virConnectPtr conn = Connect_val (connv);
386 NONBLOCKING (r = virConnectNumOfStoragePools (conn));
387 CHECK_ERROR (r == -1, "virConnectNumOfStoragePools");
389 CAMLreturn (Val_int (r));
392 /* Automatically generated binding for virConnectListStoragePools.
393 * In generator.pl this function has signature "conn, int : string array".
397 ocaml_libvirt_connect_list_storage_pools (value connv, value iv)
399 CAMLparam2 (connv, iv);
401 CAMLlocal2 (rv, strv);
402 virConnectPtr conn = Connect_val (connv);
403 int i = Int_val (iv);
407 /* Some libvirt List* functions still throw exceptions if i == 0,
408 * so catch that and return an empty array directly. This changes
409 * the semantics slightly (masking other failures) but it's
410 * unlikely anyone will care. RWMJ 2008/06/10
413 rv = caml_alloc (0, 0);
417 names = malloc (sizeof (*names) * i);
419 caml_raise_out_of_memory ();
421 NONBLOCKING (r = virConnectListStoragePools (conn, names, i));
422 CHECK_ERROR_CLEANUP (r == -1, free (names), "virConnectListStoragePools");
424 rv = caml_alloc (r, 0);
425 for (i = 0; i < r; ++i) {
426 strv = caml_copy_string (names[i]);
427 Store_field (rv, i, strv);
435 /* Automatically generated binding for virConnectNumOfDefinedStoragePools.
436 * In generator.pl this function has signature "conn : int".
440 ocaml_libvirt_connect_num_of_defined_storage_pools (value connv)
444 virConnectPtr conn = Connect_val (connv);
447 NONBLOCKING (r = virConnectNumOfDefinedStoragePools (conn));
448 CHECK_ERROR (r == -1, "virConnectNumOfDefinedStoragePools");
450 CAMLreturn (Val_int (r));
453 /* Automatically generated binding for virConnectListDefinedStoragePools.
454 * In generator.pl this function has signature "conn, int : string array".
458 ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv)
460 CAMLparam2 (connv, iv);
462 CAMLlocal2 (rv, strv);
463 virConnectPtr conn = Connect_val (connv);
464 int i = Int_val (iv);
468 /* Some libvirt List* functions still throw exceptions if i == 0,
469 * so catch that and return an empty array directly. This changes
470 * the semantics slightly (masking other failures) but it's
471 * unlikely anyone will care. RWMJ 2008/06/10
474 rv = caml_alloc (0, 0);
478 names = malloc (sizeof (*names) * i);
480 caml_raise_out_of_memory ();
482 NONBLOCKING (r = virConnectListDefinedStoragePools (conn, names, i));
483 CHECK_ERROR_CLEANUP (r == -1, free (names), "virConnectListDefinedStoragePools");
485 rv = caml_alloc (r, 0);
486 for (i = 0; i < r; ++i) {
487 strv = caml_copy_string (names[i]);
488 Store_field (rv, i, strv);
496 /* Automatically generated binding for virConnectGetCapabilities.
497 * In generator.pl this function has signature "conn : string".
501 ocaml_libvirt_connect_get_capabilities (value connv)
506 virConnectPtr conn = Connect_val (connv);
509 NONBLOCKING (r = virConnectGetCapabilities (conn));
510 CHECK_ERROR (!r, "virConnectGetCapabilities");
512 rv = caml_copy_string (r);
517 /* Automatically generated binding for virConnectDomainEventDeregisterAny.
518 * In generator.pl this function has signature "conn, int : unit".
522 ocaml_libvirt_connect_domain_event_deregister_any (value connv, value iv)
524 CAMLparam2 (connv, iv);
526 virConnectPtr conn = Connect_val (connv);
527 int i = Int_val (iv);
530 NONBLOCKING (r = virConnectDomainEventDeregisterAny (conn, i));
531 CHECK_ERROR (r == -1, "virConnectDomainEventDeregisterAny");
533 CAMLreturn (Val_unit);
536 /* Automatically generated binding for virDomainCreateLinux.
537 * In generator.pl this function has signature "conn, string, 0U : dom".
541 ocaml_libvirt_domain_create_linux (value connv, value strv)
543 CAMLparam2 (connv, strv);
546 virConnectPtr conn = Connect_val (connv);
547 char *str = String_val (strv);
550 NONBLOCKING (r = virDomainCreateLinux (conn, str, 0));
551 CHECK_ERROR (!r, "virDomainCreateLinux");
553 rv = Val_domain (r, connv);
558 /* Automatically generated binding for virDomainCreateXML.
559 * In generator.pl this function has signature "conn, string, unsigned : dom".
563 ocaml_libvirt_domain_create_xml (value connv, value strv, value uv)
565 CAMLparam3 (connv, strv, uv);
568 virConnectPtr conn = Connect_val (connv);
569 char *str = String_val (strv);
570 unsigned int u = Int_val (uv);
573 NONBLOCKING (r = virDomainCreateXML (conn, str, u));
574 CHECK_ERROR (!r, "virDomainCreateXML");
576 rv = Val_domain (r, connv);
581 /* Automatically generated binding for virDomainFree.
582 * In generator.pl this function has signature "dom : free".
586 ocaml_libvirt_domain_free (value domv)
590 virDomainPtr dom = Domain_val (domv);
593 NONBLOCKING (r = virDomainFree (dom));
594 CHECK_ERROR (r == -1, "virDomainFree");
596 /* So that we don't double-free in the finalizer: */
597 Domain_val (domv) = NULL;
599 CAMLreturn (Val_unit);
602 /* Automatically generated binding for virDomainDestroy.
603 * In generator.pl this function has signature "dom : free".
607 ocaml_libvirt_domain_destroy (value domv)
611 virDomainPtr dom = Domain_val (domv);
614 NONBLOCKING (r = virDomainDestroy (dom));
615 CHECK_ERROR (r == -1, "virDomainDestroy");
617 /* So that we don't double-free in the finalizer: */
618 Domain_val (domv) = NULL;
620 CAMLreturn (Val_unit);
623 /* Automatically generated binding for virDomainLookupByName.
624 * In generator.pl this function has signature "conn, string : dom".
628 ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
630 CAMLparam2 (connv, strv);
633 virConnectPtr conn = Connect_val (connv);
634 char *str = String_val (strv);
637 NONBLOCKING (r = virDomainLookupByName (conn, str));
638 CHECK_ERROR (!r, "virDomainLookupByName");
640 rv = Val_domain (r, connv);
645 /* Automatically generated binding for virDomainLookupByID.
646 * In generator.pl this function has signature "conn, int : dom".
650 ocaml_libvirt_domain_lookup_by_id (value connv, value iv)
652 CAMLparam2 (connv, iv);
655 virConnectPtr conn = Connect_val (connv);
656 int i = Int_val (iv);
659 NONBLOCKING (r = virDomainLookupByID (conn, i));
660 CHECK_ERROR (!r, "virDomainLookupByID");
662 rv = Val_domain (r, connv);
667 /* Automatically generated binding for virDomainLookupByUUID.
668 * In generator.pl this function has signature "conn, uuid : dom".
672 ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
674 CAMLparam2 (connv, uuidv);
677 virConnectPtr conn = Connect_val (connv);
678 unsigned char *uuid = (unsigned char *) String_val (uuidv);
681 NONBLOCKING (r = virDomainLookupByUUID (conn, uuid));
682 CHECK_ERROR (!r, "virDomainLookupByUUID");
684 rv = Val_domain (r, connv);
689 /* Automatically generated binding for virDomainLookupByUUIDString.
690 * In generator.pl this function has signature "conn, string : dom".
694 ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
696 CAMLparam2 (connv, strv);
699 virConnectPtr conn = Connect_val (connv);
700 char *str = String_val (strv);
703 NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
704 CHECK_ERROR (!r, "virDomainLookupByUUIDString");
706 rv = Val_domain (r, connv);
711 /* Automatically generated binding for virDomainGetName.
712 * In generator.pl this function has signature "dom : static string".
716 ocaml_libvirt_domain_get_name (value domv)
721 virDomainPtr dom = Domain_val (domv);
724 NONBLOCKING (r = virDomainGetName (dom));
725 CHECK_ERROR (!r, "virDomainGetName");
727 rv = caml_copy_string (r);
731 /* Automatically generated binding for virDomainGetOSType.
732 * In generator.pl this function has signature "dom : string".
736 ocaml_libvirt_domain_get_os_type (value domv)
741 virDomainPtr dom = Domain_val (domv);
744 NONBLOCKING (r = virDomainGetOSType (dom));
745 CHECK_ERROR (!r, "virDomainGetOSType");
747 rv = caml_copy_string (r);
752 /* Automatically generated binding for virDomainGetXMLDesc.
753 * In generator.pl this function has signature "dom, 0 : string".
757 ocaml_libvirt_domain_get_xml_desc (value domv)
762 virDomainPtr dom = Domain_val (domv);
765 NONBLOCKING (r = virDomainGetXMLDesc (dom, 0));
766 CHECK_ERROR (!r, "virDomainGetXMLDesc");
768 rv = caml_copy_string (r);
773 /* Automatically generated binding for virDomainGetUUID.
774 * In generator.pl this function has signature "dom : uuid".
778 ocaml_libvirt_domain_get_uuid (value domv)
783 virDomainPtr dom = Domain_val (domv);
784 unsigned char uuid[VIR_UUID_BUFLEN];
787 NONBLOCKING (r = virDomainGetUUID (dom, uuid));
788 CHECK_ERROR (r == -1, "virDomainGetUUID");
790 /* UUIDs are byte arrays with a fixed length. */
791 rv = caml_alloc_string (VIR_UUID_BUFLEN);
792 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
796 /* Automatically generated binding for virDomainGetUUIDString.
797 * In generator.pl this function has signature "dom : uuid string".
801 ocaml_libvirt_domain_get_uuid_string (value domv)
806 virDomainPtr dom = Domain_val (domv);
807 char uuid[VIR_UUID_STRING_BUFLEN];
810 NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
811 CHECK_ERROR (r == -1, "virDomainGetUUIDString");
813 rv = caml_copy_string (uuid);
817 /* Automatically generated binding for virDomainGetMaxVcpus.
818 * In generator.pl this function has signature "dom : int".
822 ocaml_libvirt_domain_get_max_vcpus (value domv)
826 virDomainPtr dom = Domain_val (domv);
829 NONBLOCKING (r = virDomainGetMaxVcpus (dom));
830 CHECK_ERROR (r == -1, "virDomainGetMaxVcpus");
832 CAMLreturn (Val_int (r));
835 /* Automatically generated binding for virDomainSave.
836 * In generator.pl this function has signature "dom, string : unit".
840 ocaml_libvirt_domain_save (value domv, value strv)
842 CAMLparam2 (domv, strv);
844 virDomainPtr dom = Domain_val (domv);
845 char *str = String_val (strv);
848 NONBLOCKING (r = virDomainSave (dom, str));
849 CHECK_ERROR (r == -1, "virDomainSave");
851 CAMLreturn (Val_unit);
854 /* Automatically generated binding for virDomainRestore.
855 * In generator.pl this function has signature "conn, string : unit".
859 ocaml_libvirt_domain_restore (value connv, value strv)
861 CAMLparam2 (connv, strv);
863 virConnectPtr conn = Connect_val (connv);
864 char *str = String_val (strv);
867 NONBLOCKING (r = virDomainRestore (conn, str));
868 CHECK_ERROR (r == -1, "virDomainRestore");
870 CAMLreturn (Val_unit);
873 /* Automatically generated binding for virDomainCoreDump.
874 * In generator.pl this function has signature "dom, string, 0 : unit".
878 ocaml_libvirt_domain_core_dump (value domv, value strv)
880 CAMLparam2 (domv, strv);
883 virDomainPtr dom = Domain_val (domv);
884 char *str = String_val (strv);
887 NONBLOCKING (r = virDomainCoreDump (dom, str, 0));
888 CHECK_ERROR (!r, "virDomainCoreDump");
890 CAMLreturn (Val_unit);
893 /* Automatically generated binding for virDomainSuspend.
894 * In generator.pl this function has signature "dom : unit".
898 ocaml_libvirt_domain_suspend (value domv)
902 virDomainPtr dom = Domain_val (domv);
905 NONBLOCKING (r = virDomainSuspend (dom));
906 CHECK_ERROR (r == -1, "virDomainSuspend");
908 CAMLreturn (Val_unit);
911 /* Automatically generated binding for virDomainResume.
912 * In generator.pl this function has signature "dom : unit".
916 ocaml_libvirt_domain_resume (value domv)
920 virDomainPtr dom = Domain_val (domv);
923 NONBLOCKING (r = virDomainResume (dom));
924 CHECK_ERROR (r == -1, "virDomainResume");
926 CAMLreturn (Val_unit);
929 /* Automatically generated binding for virDomainShutdown.
930 * In generator.pl this function has signature "dom : unit".
934 ocaml_libvirt_domain_shutdown (value domv)
938 virDomainPtr dom = Domain_val (domv);
941 NONBLOCKING (r = virDomainShutdown (dom));
942 CHECK_ERROR (r == -1, "virDomainShutdown");
944 CAMLreturn (Val_unit);
947 /* Automatically generated binding for virDomainReboot.
948 * In generator.pl this function has signature "dom, 0 : unit".
952 ocaml_libvirt_domain_reboot (value domv)
956 virDomainPtr dom = Domain_val (domv);
959 NONBLOCKING (r = virDomainReboot (dom, 0));
960 CHECK_ERROR (r == -1, "virDomainReboot");
962 CAMLreturn (Val_unit);
965 /* Automatically generated binding for virDomainDefineXML.
966 * In generator.pl this function has signature "conn, string : dom".
970 ocaml_libvirt_domain_define_xml (value connv, value strv)
972 CAMLparam2 (connv, strv);
975 virConnectPtr conn = Connect_val (connv);
976 char *str = String_val (strv);
979 NONBLOCKING (r = virDomainDefineXML (conn, str));
980 CHECK_ERROR (!r, "virDomainDefineXML");
982 rv = Val_domain (r, connv);
987 /* Automatically generated binding for virDomainUndefine.
988 * In generator.pl this function has signature "dom : unit".
992 ocaml_libvirt_domain_undefine (value domv)
996 virDomainPtr dom = Domain_val (domv);
999 NONBLOCKING (r = virDomainUndefine (dom));
1000 CHECK_ERROR (r == -1, "virDomainUndefine");
1002 CAMLreturn (Val_unit);
1005 /* Automatically generated binding for virDomainCreate.
1006 * In generator.pl this function has signature "dom : unit".
1010 ocaml_libvirt_domain_create (value domv)
1014 virDomainPtr dom = Domain_val (domv);
1017 NONBLOCKING (r = virDomainCreate (dom));
1018 CHECK_ERROR (r == -1, "virDomainCreate");
1020 CAMLreturn (Val_unit);
1023 /* Automatically generated binding for virDomainAttachDevice.
1024 * In generator.pl this function has signature "dom, string : unit".
1028 ocaml_libvirt_domain_attach_device (value domv, value strv)
1030 CAMLparam2 (domv, strv);
1032 virDomainPtr dom = Domain_val (domv);
1033 char *str = String_val (strv);
1036 NONBLOCKING (r = virDomainAttachDevice (dom, str));
1037 CHECK_ERROR (r == -1, "virDomainAttachDevice");
1039 CAMLreturn (Val_unit);
1042 /* Automatically generated binding for virDomainDetachDevice.
1043 * In generator.pl this function has signature "dom, string : unit".
1047 ocaml_libvirt_domain_detach_device (value domv, value strv)
1049 CAMLparam2 (domv, strv);
1051 virDomainPtr dom = Domain_val (domv);
1052 char *str = String_val (strv);
1055 NONBLOCKING (r = virDomainDetachDevice (dom, str));
1056 CHECK_ERROR (r == -1, "virDomainDetachDevice");
1058 CAMLreturn (Val_unit);
1061 /* Automatically generated binding for virDomainGetAutostart.
1062 * In generator.pl this function has signature "dom : bool".
1066 ocaml_libvirt_domain_get_autostart (value domv)
1070 virDomainPtr dom = Domain_val (domv);
1073 NONBLOCKING (r = virDomainGetAutostart (dom, &b));
1074 CHECK_ERROR (r == -1, "virDomainGetAutostart");
1076 CAMLreturn (b ? Val_true : Val_false);
1079 /* Automatically generated binding for virDomainSetAutostart.
1080 * In generator.pl this function has signature "dom, bool : unit".
1084 ocaml_libvirt_domain_set_autostart (value domv, value bv)
1086 CAMLparam2 (domv, bv);
1088 virDomainPtr dom = Domain_val (domv);
1091 b = bv == Val_true ? 1 : 0;
1093 NONBLOCKING (r = virDomainSetAutostart (dom, b));
1094 CHECK_ERROR (r == -1, "virDomainSetAutostart");
1096 CAMLreturn (Val_unit);
1099 /* Automatically generated binding for virNetworkFree.
1100 * In generator.pl this function has signature "net : free".
1104 ocaml_libvirt_network_free (value netv)
1108 virNetworkPtr net = Network_val (netv);
1111 NONBLOCKING (r = virNetworkFree (net));
1112 CHECK_ERROR (r == -1, "virNetworkFree");
1114 /* So that we don't double-free in the finalizer: */
1115 Network_val (netv) = NULL;
1117 CAMLreturn (Val_unit);
1120 /* Automatically generated binding for virNetworkDestroy.
1121 * In generator.pl this function has signature "net : free".
1125 ocaml_libvirt_network_destroy (value netv)
1129 virNetworkPtr net = Network_val (netv);
1132 NONBLOCKING (r = virNetworkDestroy (net));
1133 CHECK_ERROR (r == -1, "virNetworkDestroy");
1135 /* So that we don't double-free in the finalizer: */
1136 Network_val (netv) = NULL;
1138 CAMLreturn (Val_unit);
1141 /* Automatically generated binding for virNetworkLookupByName.
1142 * In generator.pl this function has signature "conn, string : net".
1146 ocaml_libvirt_network_lookup_by_name (value connv, value strv)
1148 CAMLparam2 (connv, strv);
1151 virConnectPtr conn = Connect_val (connv);
1152 char *str = String_val (strv);
1155 NONBLOCKING (r = virNetworkLookupByName (conn, str));
1156 CHECK_ERROR (!r, "virNetworkLookupByName");
1158 rv = Val_network (r, connv);
1163 /* Automatically generated binding for virNetworkLookupByUUID.
1164 * In generator.pl this function has signature "conn, uuid : net".
1168 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
1170 CAMLparam2 (connv, uuidv);
1173 virConnectPtr conn = Connect_val (connv);
1174 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1177 NONBLOCKING (r = virNetworkLookupByUUID (conn, uuid));
1178 CHECK_ERROR (!r, "virNetworkLookupByUUID");
1180 rv = Val_network (r, connv);
1185 /* Automatically generated binding for virNetworkLookupByUUIDString.
1186 * In generator.pl this function has signature "conn, string : net".
1190 ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
1192 CAMLparam2 (connv, strv);
1195 virConnectPtr conn = Connect_val (connv);
1196 char *str = String_val (strv);
1199 NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
1200 CHECK_ERROR (!r, "virNetworkLookupByUUIDString");
1202 rv = Val_network (r, connv);
1207 /* Automatically generated binding for virNetworkGetName.
1208 * In generator.pl this function has signature "net : static string".
1212 ocaml_libvirt_network_get_name (value netv)
1217 virNetworkPtr net = Network_val (netv);
1220 NONBLOCKING (r = virNetworkGetName (net));
1221 CHECK_ERROR (!r, "virNetworkGetName");
1223 rv = caml_copy_string (r);
1227 /* Automatically generated binding for virNetworkGetXMLDesc.
1228 * In generator.pl this function has signature "net, 0 : string".
1232 ocaml_libvirt_network_get_xml_desc (value netv)
1237 virNetworkPtr net = Network_val (netv);
1240 NONBLOCKING (r = virNetworkGetXMLDesc (net, 0));
1241 CHECK_ERROR (!r, "virNetworkGetXMLDesc");
1243 rv = caml_copy_string (r);
1248 /* Automatically generated binding for virNetworkGetBridgeName.
1249 * In generator.pl this function has signature "net : string".
1253 ocaml_libvirt_network_get_bridge_name (value netv)
1258 virNetworkPtr net = Network_val (netv);
1261 NONBLOCKING (r = virNetworkGetBridgeName (net));
1262 CHECK_ERROR (!r, "virNetworkGetBridgeName");
1264 rv = caml_copy_string (r);
1269 /* Automatically generated binding for virNetworkGetUUID.
1270 * In generator.pl this function has signature "net : uuid".
1274 ocaml_libvirt_network_get_uuid (value netv)
1279 virNetworkPtr net = Network_val (netv);
1280 unsigned char uuid[VIR_UUID_BUFLEN];
1283 NONBLOCKING (r = virNetworkGetUUID (net, uuid));
1284 CHECK_ERROR (r == -1, "virNetworkGetUUID");
1286 /* UUIDs are byte arrays with a fixed length. */
1287 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1288 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1292 /* Automatically generated binding for virNetworkGetUUIDString.
1293 * In generator.pl this function has signature "net : uuid string".
1297 ocaml_libvirt_network_get_uuid_string (value netv)
1302 virNetworkPtr net = Network_val (netv);
1303 char uuid[VIR_UUID_STRING_BUFLEN];
1306 NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
1307 CHECK_ERROR (r == -1, "virNetworkGetUUIDString");
1309 rv = caml_copy_string (uuid);
1313 /* Automatically generated binding for virNetworkUndefine.
1314 * In generator.pl this function has signature "net : unit".
1318 ocaml_libvirt_network_undefine (value netv)
1322 virNetworkPtr net = Network_val (netv);
1325 NONBLOCKING (r = virNetworkUndefine (net));
1326 CHECK_ERROR (r == -1, "virNetworkUndefine");
1328 CAMLreturn (Val_unit);
1331 /* Automatically generated binding for virNetworkCreateXML.
1332 * In generator.pl this function has signature "conn, string : net".
1336 ocaml_libvirt_network_create_xml (value connv, value strv)
1338 CAMLparam2 (connv, strv);
1341 virConnectPtr conn = Connect_val (connv);
1342 char *str = String_val (strv);
1345 NONBLOCKING (r = virNetworkCreateXML (conn, str));
1346 CHECK_ERROR (!r, "virNetworkCreateXML");
1348 rv = Val_network (r, connv);
1353 /* Automatically generated binding for virNetworkDefineXML.
1354 * In generator.pl this function has signature "conn, string : net".
1358 ocaml_libvirt_network_define_xml (value connv, value strv)
1360 CAMLparam2 (connv, strv);
1363 virConnectPtr conn = Connect_val (connv);
1364 char *str = String_val (strv);
1367 NONBLOCKING (r = virNetworkDefineXML (conn, str));
1368 CHECK_ERROR (!r, "virNetworkDefineXML");
1370 rv = Val_network (r, connv);
1375 /* Automatically generated binding for virNetworkCreate.
1376 * In generator.pl this function has signature "net : unit".
1380 ocaml_libvirt_network_create (value netv)
1384 virNetworkPtr net = Network_val (netv);
1387 NONBLOCKING (r = virNetworkCreate (net));
1388 CHECK_ERROR (r == -1, "virNetworkCreate");
1390 CAMLreturn (Val_unit);
1393 /* Automatically generated binding for virNetworkGetAutostart.
1394 * In generator.pl this function has signature "net : bool".
1398 ocaml_libvirt_network_get_autostart (value netv)
1402 virNetworkPtr net = Network_val (netv);
1405 NONBLOCKING (r = virNetworkGetAutostart (net, &b));
1406 CHECK_ERROR (r == -1, "virNetworkGetAutostart");
1408 CAMLreturn (b ? Val_true : Val_false);
1411 /* Automatically generated binding for virNetworkSetAutostart.
1412 * In generator.pl this function has signature "net, bool : unit".
1416 ocaml_libvirt_network_set_autostart (value netv, value bv)
1418 CAMLparam2 (netv, bv);
1420 virNetworkPtr net = Network_val (netv);
1423 b = bv == Val_true ? 1 : 0;
1425 NONBLOCKING (r = virNetworkSetAutostart (net, b));
1426 CHECK_ERROR (r == -1, "virNetworkSetAutostart");
1428 CAMLreturn (Val_unit);
1431 /* Automatically generated binding for virStoragePoolFree.
1432 * In generator.pl this function has signature "pool : free".
1436 ocaml_libvirt_storage_pool_free (value poolv)
1440 virStoragePoolPtr pool = Pool_val (poolv);
1443 NONBLOCKING (r = virStoragePoolFree (pool));
1444 CHECK_ERROR (r == -1, "virStoragePoolFree");
1446 /* So that we don't double-free in the finalizer: */
1447 Pool_val (poolv) = NULL;
1449 CAMLreturn (Val_unit);
1452 /* Automatically generated binding for virStoragePoolDestroy.
1453 * In generator.pl this function has signature "pool : free".
1457 ocaml_libvirt_storage_pool_destroy (value poolv)
1461 virStoragePoolPtr pool = Pool_val (poolv);
1464 NONBLOCKING (r = virStoragePoolDestroy (pool));
1465 CHECK_ERROR (r == -1, "virStoragePoolDestroy");
1467 /* So that we don't double-free in the finalizer: */
1468 Pool_val (poolv) = NULL;
1470 CAMLreturn (Val_unit);
1473 /* Automatically generated binding for virStoragePoolLookupByName.
1474 * In generator.pl this function has signature "conn, string : pool".
1478 ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
1480 CAMLparam2 (connv, strv);
1483 virConnectPtr conn = Connect_val (connv);
1484 char *str = String_val (strv);
1485 virStoragePoolPtr r;
1487 NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
1488 CHECK_ERROR (!r, "virStoragePoolLookupByName");
1490 rv = Val_pool (r, connv);
1495 /* Automatically generated binding for virStoragePoolLookupByUUID.
1496 * In generator.pl this function has signature "conn, uuid : pool".
1500 ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv)
1502 CAMLparam2 (connv, uuidv);
1505 virConnectPtr conn = Connect_val (connv);
1506 unsigned char *uuid = (unsigned char *) String_val (uuidv);
1507 virStoragePoolPtr r;
1509 NONBLOCKING (r = virStoragePoolLookupByUUID (conn, uuid));
1510 CHECK_ERROR (!r, "virStoragePoolLookupByUUID");
1512 rv = Val_pool (r, connv);
1517 /* Automatically generated binding for virStoragePoolLookupByUUIDString.
1518 * In generator.pl this function has signature "conn, string : pool".
1522 ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
1524 CAMLparam2 (connv, strv);
1527 virConnectPtr conn = Connect_val (connv);
1528 char *str = String_val (strv);
1529 virStoragePoolPtr r;
1531 NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
1532 CHECK_ERROR (!r, "virStoragePoolLookupByUUIDString");
1534 rv = Val_pool (r, connv);
1539 /* Automatically generated binding for virStoragePoolGetName.
1540 * In generator.pl this function has signature "pool : static string".
1544 ocaml_libvirt_storage_pool_get_name (value poolv)
1549 virStoragePoolPtr pool = Pool_val (poolv);
1552 NONBLOCKING (r = virStoragePoolGetName (pool));
1553 CHECK_ERROR (!r, "virStoragePoolGetName");
1555 rv = caml_copy_string (r);
1559 /* Automatically generated binding for virStoragePoolGetXMLDesc.
1560 * In generator.pl this function has signature "pool, 0U : string".
1564 ocaml_libvirt_storage_pool_get_xml_desc (value poolv)
1569 virStoragePoolPtr pool = Pool_val (poolv);
1572 NONBLOCKING (r = virStoragePoolGetXMLDesc (pool, 0));
1573 CHECK_ERROR (!r, "virStoragePoolGetXMLDesc");
1575 rv = caml_copy_string (r);
1580 /* Automatically generated binding for virStoragePoolGetUUID.
1581 * In generator.pl this function has signature "pool : uuid".
1585 ocaml_libvirt_storage_pool_get_uuid (value poolv)
1590 virStoragePoolPtr pool = Pool_val (poolv);
1591 unsigned char uuid[VIR_UUID_BUFLEN];
1594 NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
1595 CHECK_ERROR (r == -1, "virStoragePoolGetUUID");
1597 /* UUIDs are byte arrays with a fixed length. */
1598 rv = caml_alloc_string (VIR_UUID_BUFLEN);
1599 memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
1603 /* Automatically generated binding for virStoragePoolGetUUIDString.
1604 * In generator.pl this function has signature "pool : uuid string".
1608 ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
1613 virStoragePoolPtr pool = Pool_val (poolv);
1614 char uuid[VIR_UUID_STRING_BUFLEN];
1617 NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
1618 CHECK_ERROR (r == -1, "virStoragePoolGetUUIDString");
1620 rv = caml_copy_string (uuid);
1624 /* Automatically generated binding for virStoragePoolCreateXML.
1625 * In generator.pl this function has signature "conn, string, 0U : pool".
1629 ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
1631 CAMLparam2 (connv, strv);
1634 virConnectPtr conn = Connect_val (connv);
1635 char *str = String_val (strv);
1636 virStoragePoolPtr r;
1638 NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0));
1639 CHECK_ERROR (!r, "virStoragePoolCreateXML");
1641 rv = Val_pool (r, connv);
1646 /* Automatically generated binding for virStoragePoolDefineXML.
1647 * In generator.pl this function has signature "conn, string, 0U : pool".
1651 ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
1653 CAMLparam2 (connv, strv);
1656 virConnectPtr conn = Connect_val (connv);
1657 char *str = String_val (strv);
1658 virStoragePoolPtr r;
1660 NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0));
1661 CHECK_ERROR (!r, "virStoragePoolDefineXML");
1663 rv = Val_pool (r, connv);
1668 /* Automatically generated binding for virStoragePoolBuild.
1669 * In generator.pl this function has signature "pool, uint : unit".
1673 ocaml_libvirt_storage_pool_build (value poolv, value iv)
1675 CAMLparam2 (poolv, iv);
1677 virStoragePoolPtr pool = Pool_val (poolv);
1678 unsigned int i = Int_val (iv);
1681 NONBLOCKING (r = virStoragePoolBuild (pool, i));
1682 CHECK_ERROR (r == -1, "virStoragePoolBuild");
1684 CAMLreturn (Val_unit);
1687 /* Automatically generated binding for virStoragePoolUndefine.
1688 * In generator.pl this function has signature "pool : unit".
1692 ocaml_libvirt_storage_pool_undefine (value poolv)
1696 virStoragePoolPtr pool = Pool_val (poolv);
1699 NONBLOCKING (r = virStoragePoolUndefine (pool));
1700 CHECK_ERROR (r == -1, "virStoragePoolUndefine");
1702 CAMLreturn (Val_unit);
1705 /* Automatically generated binding for virStoragePoolCreate.
1706 * In generator.pl this function has signature "pool, 0U : unit".
1710 ocaml_libvirt_storage_pool_create (value poolv)
1714 virStoragePoolPtr pool = Pool_val (poolv);
1717 NONBLOCKING (r = virStoragePoolCreate (pool, 0));
1718 CHECK_ERROR (r == -1, "virStoragePoolCreate");
1720 CAMLreturn (Val_unit);
1723 /* Automatically generated binding for virStoragePoolDelete.
1724 * In generator.pl this function has signature "pool, uint : unit".
1728 ocaml_libvirt_storage_pool_delete (value poolv, value iv)
1730 CAMLparam2 (poolv, iv);
1732 virStoragePoolPtr pool = Pool_val (poolv);
1733 unsigned int i = Int_val (iv);
1736 NONBLOCKING (r = virStoragePoolDelete (pool, i));
1737 CHECK_ERROR (r == -1, "virStoragePoolDelete");
1739 CAMLreturn (Val_unit);
1742 /* Automatically generated binding for virStoragePoolRefresh.
1743 * In generator.pl this function has signature "pool, 0U : unit".
1747 ocaml_libvirt_storage_pool_refresh (value poolv)
1751 virStoragePoolPtr pool = Pool_val (poolv);
1754 NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
1755 CHECK_ERROR (r == -1, "virStoragePoolRefresh");
1757 CAMLreturn (Val_unit);
1760 /* Automatically generated binding for virStoragePoolGetAutostart.
1761 * In generator.pl this function has signature "pool : bool".
1765 ocaml_libvirt_storage_pool_get_autostart (value poolv)
1769 virStoragePoolPtr pool = Pool_val (poolv);
1772 NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
1773 CHECK_ERROR (r == -1, "virStoragePoolGetAutostart");
1775 CAMLreturn (b ? Val_true : Val_false);
1778 /* Automatically generated binding for virStoragePoolSetAutostart.
1779 * In generator.pl this function has signature "pool, bool : unit".
1783 ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
1785 CAMLparam2 (poolv, bv);
1787 virStoragePoolPtr pool = Pool_val (poolv);
1790 b = bv == Val_true ? 1 : 0;
1792 NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
1793 CHECK_ERROR (r == -1, "virStoragePoolSetAutostart");
1795 CAMLreturn (Val_unit);
1798 /* Automatically generated binding for virStoragePoolNumOfVolumes.
1799 * In generator.pl this function has signature "pool : int".
1803 ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
1807 virStoragePoolPtr pool = Pool_val (poolv);
1810 NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
1811 CHECK_ERROR (r == -1, "virStoragePoolNumOfVolumes");
1813 CAMLreturn (Val_int (r));
1816 /* Automatically generated binding for virStoragePoolListVolumes.
1817 * In generator.pl this function has signature "pool, int : string array".
1821 ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
1823 CAMLparam2 (poolv, iv);
1825 CAMLlocal2 (rv, strv);
1826 virStoragePoolPtr pool = Pool_val (poolv);
1827 int i = Int_val (iv);
1831 /* Some libvirt List* functions still throw exceptions if i == 0,
1832 * so catch that and return an empty array directly. This changes
1833 * the semantics slightly (masking other failures) but it's
1834 * unlikely anyone will care. RWMJ 2008/06/10
1837 rv = caml_alloc (0, 0);
1841 names = malloc (sizeof (*names) * i);
1843 caml_raise_out_of_memory ();
1845 NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
1846 CHECK_ERROR_CLEANUP (r == -1, free (names), "virStoragePoolListVolumes");
1848 rv = caml_alloc (r, 0);
1849 for (i = 0; i < r; ++i) {
1850 strv = caml_copy_string (names[i]);
1851 Store_field (rv, i, strv);
1859 /* Automatically generated binding for virStorageVolFree.
1860 * In generator.pl this function has signature "vol : free".
1864 ocaml_libvirt_storage_vol_free (value volv)
1868 virStorageVolPtr vol = Volume_val (volv);
1871 NONBLOCKING (r = virStorageVolFree (vol));
1872 CHECK_ERROR (r == -1, "virStorageVolFree");
1874 /* So that we don't double-free in the finalizer: */
1875 Volume_val (volv) = NULL;
1877 CAMLreturn (Val_unit);
1880 /* Automatically generated binding for virStorageVolDelete.
1881 * In generator.pl this function has signature "vol, uint : unit".
1885 ocaml_libvirt_storage_vol_delete (value volv, value iv)
1887 CAMLparam2 (volv, iv);
1889 virStorageVolPtr vol = Volume_val (volv);
1890 unsigned int i = Int_val (iv);
1893 NONBLOCKING (r = virStorageVolDelete (vol, i));
1894 CHECK_ERROR (r == -1, "virStorageVolDelete");
1896 CAMLreturn (Val_unit);
1899 /* Automatically generated binding for virStorageVolLookupByName.
1900 * In generator.pl this function has signature "pool, string : vol from pool".
1904 ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
1906 CAMLparam2 (poolv, strv);
1908 CAMLlocal2 (rv, connv);
1909 virStoragePoolPtr pool = Pool_val (poolv);
1910 char *str = String_val (strv);
1913 NONBLOCKING (r = virStorageVolLookupByName (pool, str));
1914 CHECK_ERROR (!r, "virStorageVolLookupByName");
1916 connv = Field (poolv, 1);
1917 rv = Val_volume (r, connv);
1922 /* Automatically generated binding for virStorageVolLookupByKey.
1923 * In generator.pl this function has signature "conn, string : vol".
1927 ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
1929 CAMLparam2 (connv, strv);
1932 virConnectPtr conn = Connect_val (connv);
1933 char *str = String_val (strv);
1936 NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
1937 CHECK_ERROR (!r, "virStorageVolLookupByKey");
1939 rv = Val_volume (r, connv);
1944 /* Automatically generated binding for virStorageVolLookupByPath.
1945 * In generator.pl this function has signature "conn, string : vol".
1949 ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
1951 CAMLparam2 (connv, strv);
1954 virConnectPtr conn = Connect_val (connv);
1955 char *str = String_val (strv);
1958 NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
1959 CHECK_ERROR (!r, "virStorageVolLookupByPath");
1961 rv = Val_volume (r, connv);
1966 /* Automatically generated binding for virStorageVolCreateXML.
1967 * In generator.pl this function has signature "pool, string, 0U : vol from pool".
1971 ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
1973 CAMLparam2 (poolv, strv);
1975 CAMLlocal2 (rv, connv);
1976 virStoragePoolPtr pool = Pool_val (poolv);
1977 char *str = String_val (strv);
1980 NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
1981 CHECK_ERROR (!r, "virStorageVolCreateXML");
1983 connv = Field (poolv, 1);
1984 rv = Val_volume (r, connv);
1989 /* Automatically generated binding for virStorageVolGetXMLDesc.
1990 * In generator.pl this function has signature "vol, 0U : string".
1994 ocaml_libvirt_storage_vol_get_xml_desc (value volv)
1999 virStorageVolPtr vol = Volume_val (volv);
2002 NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
2003 CHECK_ERROR (!r, "virStorageVolGetXMLDesc");
2005 rv = caml_copy_string (r);
2010 /* Automatically generated binding for virStorageVolGetPath.
2011 * In generator.pl this function has signature "vol : string".
2015 ocaml_libvirt_storage_vol_get_path (value volv)
2020 virStorageVolPtr vol = Volume_val (volv);
2023 NONBLOCKING (r = virStorageVolGetPath (vol));
2024 CHECK_ERROR (!r, "virStorageVolGetPath");
2026 rv = caml_copy_string (r);
2031 /* Automatically generated binding for virStorageVolGetKey.
2032 * In generator.pl this function has signature "vol : static string".
2036 ocaml_libvirt_storage_vol_get_key (value volv)
2041 virStorageVolPtr vol = Volume_val (volv);
2044 NONBLOCKING (r = virStorageVolGetKey (vol));
2045 CHECK_ERROR (!r, "virStorageVolGetKey");
2047 rv = caml_copy_string (r);
2051 /* Automatically generated binding for virStorageVolGetName.
2052 * In generator.pl this function has signature "vol : static string".
2056 ocaml_libvirt_storage_vol_get_name (value volv)
2061 virStorageVolPtr vol = Volume_val (volv);
2064 NONBLOCKING (r = virStorageVolGetName (vol));
2065 CHECK_ERROR (!r, "virStorageVolGetName");
2067 rv = caml_copy_string (r);
2071 /* Automatically generated binding for virStoragePoolLookupByVolume.
2072 * In generator.pl this function has signature "vol : pool from vol".
2076 ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
2080 CAMLlocal2 (rv, connv);
2081 virStorageVolPtr vol = Volume_val (volv);
2082 virStoragePoolPtr r;
2084 NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
2085 CHECK_ERROR (!r, "virStoragePoolLookupByVolume");
2087 connv = Field (volv, 1);
2088 rv = Val_pool (r, connv);
2093 #include "libvirt_c_epilogue.c"