+#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");
+
+ rv = caml_copy_string ((char *) uuid);
+ CAMLreturn (rv);
+#endif
+}
+
+#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
+}
+
+#ifdef HAVE_WEAK_SYMBOLS