+
+/* 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;
+
+ NONBLOCKING (r = virStorageVolLookupByName (pool, str));
+ CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
+
+ connv = Field (poolv, 1);
+ rv = Val_volume (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolLookupByKey.
+ * In generator.pl this function has signature "conn, string : vol".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
+extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, const char *str) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv)
+{
+ CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
+ /* Symbol virStorageVolLookupByKey not found at compile time. */
+ not_supported ("virStorageVolLookupByKey");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolLookupByKey
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolLookupByKey);
+
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ char *str = String_val (strv);
+ virStorageVolPtr r;
+
+ NONBLOCKING (r = virStorageVolLookupByKey (conn, str));
+ CHECK_ERROR (!r, conn, "virStorageVolLookupByKey");
+
+ rv = Val_volume (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolLookupByPath.
+ * In generator.pl this function has signature "conn, string : vol".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
+extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, const char *str) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv)
+{
+ CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
+ /* Symbol virStorageVolLookupByPath not found at compile time. */
+ not_supported ("virStorageVolLookupByPath");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolLookupByPath
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolLookupByPath);
+
+ CAMLlocal1 (rv);
+ virConnectPtr conn = Connect_val (connv);
+ char *str = String_val (strv);
+ virStorageVolPtr r;
+
+ NONBLOCKING (r = virStorageVolLookupByPath (conn, str));
+ CHECK_ERROR (!r, conn, "virStorageVolLookupByPath");
+
+ rv = Val_volume (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolCreateXML.
+ * In generator.pl this function has signature "pool, string, 0 : vol from pool".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLCREATEXML
+extern virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *str, int flags) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_create_xml (value poolv, value strv)
+{
+ CAMLparam2 (poolv, strv);
+#ifndef HAVE_VIRSTORAGEVOLCREATEXML
+ /* Symbol virStorageVolCreateXML not found at compile time. */
+ not_supported ("virStorageVolCreateXML");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolCreateXML
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolCreateXML);
+
+ CAMLlocal2 (rv, connv);
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ char *str = String_val (strv);
+ virStorageVolPtr r;
+
+ NONBLOCKING (r = virStorageVolCreateXML (pool, str, 0));
+ CHECK_ERROR (!r, conn, "virStorageVolCreateXML");
+
+ connv = Field (poolv, 1);
+ rv = Val_volume (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolGetXMLDesc.
+ * In generator.pl this function has signature "vol, 0 : string".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
+extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, int flags) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_get_xml_desc (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLGETXMLDESC
+ /* Symbol virStorageVolGetXMLDesc not found at compile time. */
+ not_supported ("virStorageVolGetXMLDesc");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolGetXMLDesc
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolGetXMLDesc);
+
+ CAMLlocal1 (rv);
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ char *r;
+
+ NONBLOCKING (r = virStorageVolGetXMLDesc (vol, 0));
+ CHECK_ERROR (!r, conn, "virStorageVolGetXMLDesc");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolGetPath.
+ * In generator.pl this function has signature "vol : string".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLGETPATH
+extern char *virStorageVolGetPath (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_get_path (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLGETPATH
+ /* Symbol virStorageVolGetPath not found at compile time. */
+ not_supported ("virStorageVolGetPath");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolGetPath
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolGetPath);
+
+ CAMLlocal1 (rv);
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ char *r;
+
+ NONBLOCKING (r = virStorageVolGetPath (vol));
+ CHECK_ERROR (!r, conn, "virStorageVolGetPath");
+
+ rv = caml_copy_string (r);
+ free (r);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolGetKey.
+ * In generator.pl this function has signature "vol : static string".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLGETKEY
+extern const char *virStorageVolGetKey (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_get_key (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLGETKEY
+ /* Symbol virStorageVolGetKey not found at compile time. */
+ not_supported ("virStorageVolGetKey");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolGetKey
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolGetKey);
+
+ CAMLlocal1 (rv);
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ const char *r;
+
+ NONBLOCKING (r = virStorageVolGetKey (vol));
+ CHECK_ERROR (!r, conn, "virStorageVolGetKey");
+
+ rv = caml_copy_string (r);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStorageVolGetName.
+ * In generator.pl this function has signature "vol : static string".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLGETNAME
+extern const char *virStorageVolGetName (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_get_name (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEVOLGETNAME
+ /* Symbol virStorageVolGetName not found at compile time. */
+ not_supported ("virStorageVolGetName");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStorageVolGetName
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStorageVolGetName);
+
+ CAMLlocal1 (rv);
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ const char *r;
+
+ NONBLOCKING (r = virStorageVolGetName (vol));
+ CHECK_ERROR (!r, conn, "virStorageVolGetName");
+
+ rv = caml_copy_string (r);
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolLookupByVolume.
+ * In generator.pl this function has signature "vol : pool from vol".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
+extern virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_lookup_by_volume (value volv)
+{
+ CAMLparam1 (volv);
+#ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME
+ /* Symbol virStoragePoolLookupByVolume not found at compile time. */
+ not_supported ("virStoragePoolLookupByVolume");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolLookupByVolume
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolLookupByVolume);
+
+ CAMLlocal2 (rv, connv);
+ virStorageVolPtr vol = Volume_val (volv);
+ virConnectPtr conn = Connect_volv (volv);
+ virStoragePoolPtr r;
+
+ NONBLOCKING (r = virStoragePoolLookupByVolume (vol));
+ CHECK_ERROR (!r, conn, "virStoragePoolLookupByVolume");
+
+ connv = Field (volv, 1);
+ rv = Val_pool (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virJobFree.
+ * In generator.pl this function has signature "job : free".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRJOBFREE
+extern int virJobFree (virJobPtr job) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_job_free (value jobv)
+{
+ CAMLparam1 (jobv);
+#ifndef HAVE_VIRJOBFREE
+ /* Symbol virJobFree not found at compile time. */
+ not_supported ("virJobFree");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virJobFree
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virJobFree);
+
+ virJobPtr job = Job_val (jobv);
+ virConnectPtr conn = Connect_jobv (jobv);
+ int r;
+
+ NONBLOCKING (r = virJobFree (job));
+ CHECK_ERROR (r == -1, conn, "virJobFree");
+
+ /* So that we don't double-free in the finalizer: */
+ Job_val (jobv) = NULL;
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virJobCancel.
+ * In generator.pl this function has signature "job : unit".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRJOBCANCEL
+extern int virJobCancel (virJobPtr job) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_job_cancel (value jobv)
+{
+ CAMLparam1 (jobv);
+#ifndef HAVE_VIRJOBCANCEL
+ /* Symbol virJobCancel not found at compile time. */
+ not_supported ("virJobCancel");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virJobCancel
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virJobCancel);
+
+ virJobPtr job = Job_val (jobv);
+ virConnectPtr conn = Connect_jobv (jobv);
+ int r;
+
+ NONBLOCKING (r = virJobCancel (job));
+ CHECK_ERROR (r == -1, conn, "virJobCancel");
+
+ CAMLreturn (Val_unit);
+#endif
+}
+
+/* Automatically generated binding for virJobGetNetwork.
+ * In generator.pl this function has signature "job : net from job".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRJOBGETNETWORK
+extern virNetworkPtr virJobGetNetwork (virJobPtr job) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_job_get_network (value jobv)
+{
+ CAMLparam1 (jobv);
+#ifndef HAVE_VIRJOBGETNETWORK
+ /* Symbol virJobGetNetwork not found at compile time. */
+ not_supported ("virJobGetNetwork");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virJobGetNetwork
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virJobGetNetwork);
+
+ CAMLlocal2 (rv, connv);
+ virJobPtr job = Job_val (jobv);
+ virConnectPtr conn = Connect_jobv (jobv);
+ virNetworkPtr r;
+
+ NONBLOCKING (r = virJobGetNetwork (job));
+ CHECK_ERROR (!r, conn, "virJobGetNetwork");
+
+ connv = Field (jobv, 1);
+ rv = Val_network (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+/* Automatically generated binding for virJobGetDomain.
+ * In generator.pl this function has signature "job : dom from job".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRJOBGETDOMAIN
+extern virDomainPtr virJobGetDomain (virJobPtr job) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_job_get_domain (value jobv)
+{
+ CAMLparam1 (jobv);
+#ifndef HAVE_VIRJOBGETDOMAIN
+ /* Symbol virJobGetDomain not found at compile time. */
+ not_supported ("virJobGetDomain");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virJobGetDomain
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virJobGetDomain);
+
+ CAMLlocal2 (rv, connv);
+ virJobPtr job = Job_val (jobv);
+ virConnectPtr conn = Connect_jobv (jobv);
+ virDomainPtr r;
+
+ NONBLOCKING (r = virJobGetDomain (job));
+ CHECK_ERROR (!r, conn, "virJobGetDomain");
+
+ connv = Field (jobv, 1);
+ rv = Val_domain (r, connv);
+
+ CAMLreturn (rv);
+#endif
+}
+
+#include "libvirt_c_epilogue.c"
+
+/* EOF */