+/* Automatically generated binding for virStoragePoolGetUUID.
+ * In generator.pl this function has signature "pool : uuid".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLGETUUID
+extern int virStoragePoolGetUUID (virStoragePoolPtr pool, unsigned char *) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_get_uuid (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLGETUUID
+ /* Symbol virStoragePoolGetUUID not found at compile time. */
+ not_supported ("virStoragePoolGetUUID");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolGetUUID
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolGetUUID);
+
+ CAMLlocal1 (rv);
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID");
+
+ /* UUIDs are byte arrays with a fixed length. */
+ rv = caml_alloc_string (VIR_UUID_BUFLEN);
+ memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolGetUUIDString.
+ * In generator.pl this function has signature "pool : uuid string".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
+extern int virStoragePoolGetUUIDString (virStoragePoolPtr pool, char *) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_get_uuid_string (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING
+ /* Symbol virStoragePoolGetUUIDString not found at compile time. */
+ not_supported ("virStoragePoolGetUUIDString");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolGetUUIDString
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolGetUUIDString);
+
+ CAMLlocal1 (rv);
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virStoragePoolGetUUIDString (pool, uuid));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUIDString");
+
+ rv = caml_copy_string (uuid);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolCreateXML.
+ * In generator.pl this function has signature "conn, string : pool".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLCREATEXML
+extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_create_xml (value connv, value strv)
+{
+ CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEPOOLCREATEXML
+ /* Symbol virStoragePoolCreateXML not found at compile time. */
+ not_supported ("virStoragePoolCreateXML");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolCreateXML
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolCreateXML);
+
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ char *str = String_val (strv);
+ virStoragePoolPtr r;
+
+ NONBLOCKING (r = virStoragePoolCreateXML (conn, str));
+ CHECK_ERROR (!r, conn, "virStoragePoolCreateXML");
+
+ rv = Val_pool (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolDefineXML.
+ * In generator.pl this function has signature "conn, string : pool".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLDEFINEXML
+extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_define_xml (value connv, value strv)
+{
+ CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEPOOLDEFINEXML
+ /* Symbol virStoragePoolDefineXML not found at compile time. */
+ not_supported ("virStoragePoolDefineXML");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolDefineXML
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolDefineXML);
+
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ char *str = String_val (strv);
+ virStoragePoolPtr r;
+
+ NONBLOCKING (r = virStoragePoolDefineXML (conn, str));
+ CHECK_ERROR (!r, conn, "virStoragePoolDefineXML");
+
+ rv = Val_pool (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolUndefine.
+ * In generator.pl this function has signature "pool : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
+extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_undefine (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLUNDEFINE
+ /* Symbol virStoragePoolUndefine not found at compile time. */
+ not_supported ("virStoragePoolUndefine");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolUndefine
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolUndefine);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r;
+
+ NONBLOCKING (r = virStoragePoolUndefine (pool));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolUndefine");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolCreate.
+ * In generator.pl this function has signature "pool : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLCREATE
+extern int virStoragePoolCreate (virStoragePoolPtr pool) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_create (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLCREATE
+ /* Symbol virStoragePoolCreate not found at compile time. */
+ not_supported ("virStoragePoolCreate");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolCreate
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolCreate);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r;
+
+ NONBLOCKING (r = virStoragePoolCreate (pool));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolCreate");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolShutdown.
+ * In generator.pl this function has signature "pool : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLSHUTDOWN
+extern int virStoragePoolShutdown (virStoragePoolPtr pool) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_shutdown (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLSHUTDOWN
+ /* Symbol virStoragePoolShutdown not found at compile time. */
+ not_supported ("virStoragePoolShutdown");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolShutdown
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolShutdown);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r;
+
+ NONBLOCKING (r = virStoragePoolShutdown (pool));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolShutdown");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolRefresh.
+ * In generator.pl this function has signature "pool, 0U : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLREFRESH
+extern int virStoragePoolRefresh (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_refresh (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLREFRESH
+ /* Symbol virStoragePoolRefresh not found at compile time. */
+ not_supported ("virStoragePoolRefresh");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolRefresh
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolRefresh);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r;
+
+ NONBLOCKING (r = virStoragePoolRefresh (pool, 0));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolRefresh");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolGetAutostart.
+ * In generator.pl this function has signature "pool : bool".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLGETAUTOSTART
+extern int virStoragePoolGetAutostart (virStoragePoolPtr pool, int *r) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_get_autostart (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART
+ /* Symbol virStoragePoolGetAutostart not found at compile time. */
+ not_supported ("virStoragePoolGetAutostart");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolGetAutostart
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolGetAutostart);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r, b;
+
+ NONBLOCKING (r = virStoragePoolGetAutostart (pool, &b));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolGetAutostart");
+
+ CAMLreturn (b ? Val_true : Val_false);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolSetAutostart.
+ * In generator.pl this function has signature "pool, bool : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLSETAUTOSTART
+extern int virStoragePoolSetAutostart (virStoragePoolPtr pool, int b) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv)
+{
+ CAMLparam2 (poolv, bv);
+#ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART
+ /* Symbol virStoragePoolSetAutostart not found at compile time. */
+ not_supported ("virStoragePoolSetAutostart");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolSetAutostart
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolSetAutostart);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r, b;
+
+ b = bv == Val_true ? 1 : 0;
+
+ NONBLOCKING (r = virStoragePoolSetAutostart (pool, b));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolSetAutostart");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolFree.
+ * In generator.pl this function has signature "vol : free".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLFREE
+extern int virStorageVolFree (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_free (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLFREE
+ /* Symbol virStorageVolFree not found at compile time. */
+ not_supported ("virStorageVolFree");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolFree
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolFree);
+
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ int r;
+
+ NONBLOCKING (r = virStorageVolFree (vol));
+ CHECK_ERROR (r == -1, conn, "virStorageVolFree");
+
+ /* So that we don't double-free in the finalizer: */
+ Volume_val (volv) = NULL;
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolDestroy.
+ * In generator.pl this function has signature "vol : free".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLDESTROY
+extern int virStorageVolDestroy (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_destroy (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLDESTROY
+ /* Symbol virStorageVolDestroy not found at compile time. */
+ not_supported ("virStorageVolDestroy");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolDestroy
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolDestroy);
+
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ int r;
+
+ NONBLOCKING (r = virStorageVolDestroy (vol));
+ CHECK_ERROR (r == -1, conn, "virStorageVolDestroy");
+
+ /* So that we don't double-free in the finalizer: */
+ Volume_val (volv) = NULL;
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolLookupByName.
+ * In generator.pl this function has signature "pool, string : vol from pool".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
+extern virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, const char *str) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_lookup_by_name (value poolv, value strv)
+{
+ CAMLparam2 (poolv, strv);
+#ifndef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
+ /* Symbol virStorageVolLookupByName not found at compile time. */
+ not_supported ("virStorageVolLookupByName");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolLookupByName
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolLookupByName);
+
+ CAMLlocal2 (rv, connv);
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ char *str = String_val (strv);
+ virStorageVolPtr r;