+/* 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
+}
+