More bindings autogenerated, more coverage of storage API.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 18 Jan 2008 19:32:54 +0000 (19:32 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 18 Jan 2008 19:32:54 +0000 (19:32 +0000)
config.h.in
configure.ac
libvirt/generator.pl
libvirt/libvirt_c.c
libvirt/libvirt_c_oneoffs.c

index 37c309a..95757f8 100644 (file)
@@ -89,9 +89,6 @@
 /* Define to 1 if you have the `virDomainSetSchedulerParameters' function. */
 #undef HAVE_VIRDOMAINSETSCHEDULERPARAMETERS
 
 /* Define to 1 if you have the `virDomainSetSchedulerParameters' function. */
 #undef HAVE_VIRDOMAINSETSCHEDULERPARAMETERS
 
-/* Define to 1 if the system has the type `virJob'. */
-#undef HAVE_VIRJOB
-
 /* Define to 1 if you have the `virJobCancel' function. */
 #undef HAVE_VIRJOBCANCEL
 
 /* Define to 1 if you have the `virJobCancel' function. */
 #undef HAVE_VIRJOBCANCEL
 
 /* Define to 1 if you have the `virJobGetNetwork' function. */
 #undef HAVE_VIRJOBGETNETWORK
 
 /* Define to 1 if you have the `virJobGetNetwork' function. */
 #undef HAVE_VIRJOBGETNETWORK
 
+/* Define to 1 if the system has the type `virJobPtr'. */
+#undef HAVE_VIRJOBPTR
+
 /* Define to 1 if you have the `virNetworkCreateJob' function. */
 #undef HAVE_VIRNETWORKCREATEJOB
 
 /* Define to 1 if you have the `virNetworkCreateJob' function. */
 #undef HAVE_VIRNETWORKCREATEJOB
 
 /* Define to 1 if you have the `virNodeGetFreeMemory' function. */
 #undef HAVE_VIRNODEGETFREEMEMORY
 
 /* Define to 1 if you have the `virNodeGetFreeMemory' function. */
 #undef HAVE_VIRNODEGETFREEMEMORY
 
-/* Define to 1 if the system has the type `virStoragePool'. */
-#undef HAVE_VIRSTORAGEPOOL
-
 /* Define to 1 if you have the `virStoragePoolCreate' function. */
 #undef HAVE_VIRSTORAGEPOOLCREATE
 
 /* Define to 1 if you have the `virStoragePoolCreate' function. */
 #undef HAVE_VIRSTORAGEPOOLCREATE
 
 /* Define to 1 if you have the `virStoragePoolNumOfVolumes' function. */
 #undef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
 
 /* Define to 1 if you have the `virStoragePoolNumOfVolumes' function. */
 #undef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
 
+/* Define to 1 if the system has the type `virStoragePoolPtr'. */
+#undef HAVE_VIRSTORAGEPOOLPTR
+
 /* Define to 1 if you have the `virStoragePoolRefresh' function. */
 #undef HAVE_VIRSTORAGEPOOLREFRESH
 
 /* Define to 1 if you have the `virStoragePoolRefresh' function. */
 #undef HAVE_VIRSTORAGEPOOLREFRESH
 
 /* Define to 1 if you have the `virStoragePoolUndefine' function. */
 #undef HAVE_VIRSTORAGEPOOLUNDEFINE
 
 /* Define to 1 if you have the `virStoragePoolUndefine' function. */
 #undef HAVE_VIRSTORAGEPOOLUNDEFINE
 
-/* Define to 1 if the system has the type `virStorageVol'. */
-#undef HAVE_VIRSTORAGEVOL
-
 /* Define to 1 if you have the `virStorageVolCreateXML' function. */
 #undef HAVE_VIRSTORAGEVOLCREATEXML
 
 /* Define to 1 if you have the `virStorageVolCreateXML' function. */
 #undef HAVE_VIRSTORAGEVOLCREATEXML
 
 /* Define to 1 if you have the `virStorageVolFree' function. */
 #undef HAVE_VIRSTORAGEVOLFREE
 
 /* Define to 1 if you have the `virStorageVolFree' function. */
 #undef HAVE_VIRSTORAGEVOLFREE
 
-/* Define to 1 if you have the `virStorageVolGetConnect' function. */
-#undef HAVE_VIRSTORAGEVOLGETCONNECT
-
 /* Define to 1 if you have the `virStorageVolGetInfo' function. */
 #undef HAVE_VIRSTORAGEVOLGETINFO
 
 /* Define to 1 if you have the `virStorageVolGetInfo' function. */
 #undef HAVE_VIRSTORAGEVOLGETINFO
 
 /* Define to 1 if you have the `virStorageVolLookupByPath' function. */
 #undef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
 
 /* Define to 1 if you have the `virStorageVolLookupByPath' function. */
 #undef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
 
+/* Define to 1 if the system has the type `virStorageVolPtr'. */
+#undef HAVE_VIRSTORAGEVOLPTR
+
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #undef NO_MINUS_C_MINUS_O
 
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #undef NO_MINUS_C_MINUS_O
 
index 0fe2bda..9331243 100644 (file)
@@ -119,7 +119,6 @@ AC_CHECK_FUNCS([virConnectGetHostname \
                virStoragePoolSetAutostart \
                virStoragePoolNumOfVolumes \
                virStoragePoolListVolumes \
                virStoragePoolSetAutostart \
                virStoragePoolNumOfVolumes \
                virStoragePoolListVolumes \
-               virStorageVolGetConnect \
                virStorageVolLookupByName \
                virStorageVolLookupByKey \
                virStorageVolLookupByPath \
                virStorageVolLookupByName \
                virStorageVolLookupByKey \
                virStorageVolLookupByPath \
index a54bd94..fa7f5bc 100755 (executable)
@@ -51,6 +51,8 @@ my @functions = (
       sig => "conn, int : string array", weak => 1 },
     { name => "virConnectGetCapabilities", sig => "conn : string" },
 
       sig => "conn, int : string array", weak => 1 },
     { name => "virConnectGetCapabilities", sig => "conn : string" },
 
+    { name => "virDomainLookupByName", sig => "conn, string : dom" },
+    { name => "virDomainLookupByUUIDString", sig => "conn, string : dom" },
     { name => "virDomainGetName", sig => "dom : static string" },
     { name => "virDomainGetOSType", sig => "dom : string" },
     { name => "virDomainGetXMLDesc", sig => "dom, 0 : string" },
     { name => "virDomainGetName", sig => "dom : static string" },
     { name => "virDomainGetOSType", sig => "dom : string" },
     { name => "virDomainGetXMLDesc", sig => "dom, 0 : string" },
@@ -61,12 +63,18 @@ my @functions = (
     { name => "virDomainUndefine", sig => "dom : unit" },
     { name => "virDomainCreate", sig => "dom : unit" },
 
     { name => "virDomainUndefine", sig => "dom : unit" },
     { name => "virDomainCreate", sig => "dom : unit" },
 
+    { name => "virNetworkLookupByName", sig => "conn, string : net" },
+    { name => "virNetworkLookupByUUIDString", sig => "conn, string : net" },
     { name => "virNetworkGetName", sig => "net : static string" },
     { name => "virNetworkGetXMLDesc", sig => "net, 0 : string" },
     { name => "virNetworkGetBridgeName", sig => "net : string" },
     { name => "virNetworkUndefine", sig => "net : unit" },
     { name => "virNetworkCreate", sig => "net : unit" },
 
     { name => "virNetworkGetName", sig => "net : static string" },
     { name => "virNetworkGetXMLDesc", sig => "net, 0 : string" },
     { name => "virNetworkGetBridgeName", sig => "net : string" },
     { name => "virNetworkUndefine", sig => "net : unit" },
     { name => "virNetworkCreate", sig => "net : unit" },
 
+    { name => "virStoragePoolLookupByName",
+      sig => "conn, string : pool", weak => 1 },
+    { name => "virStoragePoolLookupByUUIDString",
+      sig => "conn, string : pool", weak => 1 },
     { name => "virStoragePoolGetName",
       sig => "pool : static string", weak => 1 },
     { name => "virStoragePoolGetXMLDesc",
     { name => "virStoragePoolGetName",
       sig => "pool : static string", weak => 1 },
     { name => "virStoragePoolGetXMLDesc",
@@ -80,6 +88,12 @@ my @functions = (
     { name => "virStoragePoolRefresh",
       sig => "pool, 0 : string", weak => 1 },
 
     { name => "virStoragePoolRefresh",
       sig => "pool, 0 : string", weak => 1 },
 
+    { name => "virStorageVolLookupByName",
+      sig => "conn, string : vol", weak => 1 },
+    { name => "virStorageVolLookupByKey",
+      sig => "conn, string : vol", weak => 1 },
+    { name => "virStorageVolLookupByPath",
+      sig => "conn, string : vol", weak => 1 },
     { name => "virStorageVolGetXMLDesc",
       sig => "pool, 0 : string", weak => 1 },
     { name => "virStorageVolGetPath",
     { name => "virStorageVolGetXMLDesc",
       sig => "pool, 0 : string", weak => 1 },
     { name => "virStorageVolGetPath",
@@ -112,17 +126,12 @@ my @unimplemented = (
     "ocaml_libvirt_storage_pool_destroy",
     "ocaml_libvirt_storage_pool_define_xml",
     "ocaml_libvirt_storage_pool_create_xml",
     "ocaml_libvirt_storage_pool_destroy",
     "ocaml_libvirt_storage_pool_define_xml",
     "ocaml_libvirt_storage_pool_create_xml",
-    "ocaml_libvirt_storage_pool_lookup_by_uuid_string",
     "ocaml_libvirt_storage_pool_lookup_by_uuid",
     "ocaml_libvirt_storage_pool_lookup_by_uuid",
-    "ocaml_libvirt_storage_pool_lookup_by_name",
     "ocaml_libvirt_storage_vol_free",
     "ocaml_libvirt_storage_vol_destroy",
     "ocaml_libvirt_storage_vol_create_xml",
     "ocaml_libvirt_storage_vol_get_info",
     "ocaml_libvirt_pool_of_volume",
     "ocaml_libvirt_storage_vol_free",
     "ocaml_libvirt_storage_vol_destroy",
     "ocaml_libvirt_storage_vol_create_xml",
     "ocaml_libvirt_storage_vol_get_info",
     "ocaml_libvirt_pool_of_volume",
-    "ocaml_libvirt_storage_vol_lookup_by_path",
-    "ocaml_libvirt_storage_vol_lookup_by_key",
-    "ocaml_libvirt_storage_vol_lookup_by_name",
     "ocaml_libvirt_job_cancel",
     "ocaml_libvirt_job_get_network",
     "ocaml_libvirt_job_get_domain",
     "ocaml_libvirt_job_cancel",
     "ocaml_libvirt_job_get_network",
     "ocaml_libvirt_job_get_domain",
@@ -193,7 +202,7 @@ sub camel_case_to_underscores
 {
     my $name = shift;
 
 {
     my $name = shift;
 
-    $name =~ s/([A-Z][a-z]+|XML|URI|OS)/$1,/g;
+    $name =~ s/([A-Z][a-z]+|XML|URI|OS|UUID)/$1,/g;
     my @subs = split (/,/, $name);
     @subs = map { lc($_) } @subs;
     join "_", @subs
     my @subs = split (/,/, $name);
     @subs = map { lc($_) } @subs;
     join "_", @subs
@@ -242,6 +251,10 @@ sub gen_c_signature
     } elsif ($sig =~ /^(\w+) : unit$/) {
        my $c_type = short_name_to_c_type ($1);
        "int $c_name ($c_type $1 dom)"
     } elsif ($sig =~ /^(\w+) : unit$/) {
        my $c_type = short_name_to_c_type ($1);
        "int $c_name ($c_type $1 dom)"
+    } elsif ($sig =~ /^(\w+), string : (\w+)$/) {
+       my $c_type = short_name_to_c_type ($1);
+       my $c_ret_type = short_name_to_c_type ($2);
+       "$c_ret_type $c_name ($c_type $1 dom)"
     } else {
        die "unknown signature $sig"
     }
     } else {
        die "unknown signature $sig"
     }
@@ -267,6 +280,8 @@ sub gen_arg_names
        ( "$1v" )
     } elsif ($sig =~ /^(\w+) : unit$/) {
        ( "$1v" )
        ( "$1v" )
     } elsif ($sig =~ /^(\w+) : unit$/) {
        ( "$1v" )
+    } elsif ($sig =~ /^(\w+), string : (\w+)$/) {
+       ( "$1v", "strv" )
     } else {
        die "unknown signature $sig"
     }
     } else {
        die "unknown signature $sig"
     }
@@ -295,6 +310,21 @@ sub gen_unpack_args
     }
 }
 
     }
 }
 
+sub gen_pack_result
+{
+    local $_ = shift;
+
+    if ($_ eq "dom") {
+       "rv = Val_domain (r, connv);"
+    } elsif ($_ eq "net") {
+       "rv = Val_network (r, connv);"
+    } elsif ($_ eq "pool") {
+       "rv = Val_pool (r, connv);"
+    } elsif ($_ eq "vol") {
+       "rv = Val_volume (r, connv);"
+    }
+}
+
 sub gen_c_code
 {
     my $sig = shift;
 sub gen_c_code
 {
     my $sig = shift;
@@ -404,6 +434,21 @@ sub gen_c_code
 
   CAMLreturn (Val_unit);
 "
 
   CAMLreturn (Val_unit);
 "
+    } elsif ($sig =~ /^(\w+), string : (\w+)$/) {
+       my $c_ret_type = short_name_to_c_type ($2);
+       "\
+  CAMLlocal1 (rv);
+  " . gen_unpack_args ($1) . "
+  char *str = String_val (strv);
+  $c_ret_type r;
+
+  NONBLOCKING (r = $c_name ($1, str));
+  CHECK_ERROR (!r, conn, \"$c_name\");
+
+  " . gen_pack_result ($2) . "
+
+  CAMLreturn (rv);
+"
     } else {
        die "unknown signature $sig"
     }
     } else {
        die "unknown signature $sig"
     }
index 27aa4c0..0bb9442 100644 (file)
@@ -438,6 +438,42 @@ ocaml_libvirt_connect_get_capabilities (value connv)
 }
 
 CAMLprim value
 }
 
 CAMLprim value
+ocaml_libvirt_domain_lookup_by_name (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virDomainPtr r;
+
+  NONBLOCKING (r = virDomainLookupByName (conn, str));
+  CHECK_ERROR (!r, conn, "virDomainLookupByName");
+
+  rv = Val_domain (r, connv);
+
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virDomainPtr r;
+
+  NONBLOCKING (r = virDomainLookupByUUIDString (conn, str));
+  CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
+
+  rv = Val_domain (r, connv);
+
+  CAMLreturn (rv);
+}
+
+CAMLprim value
 ocaml_libvirt_domain_get_name (value domv)
 {
   CAMLparam1 (domv);
 ocaml_libvirt_domain_get_name (value domv)
 {
   CAMLparam1 (domv);
@@ -581,6 +617,42 @@ ocaml_libvirt_domain_create (value domv)
 }
 
 CAMLprim value
 }
 
 CAMLprim value
+ocaml_libvirt_network_lookup_by_name (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virNetworkPtr r;
+
+  NONBLOCKING (r = virNetworkLookupByName (conn, str));
+  CHECK_ERROR (!r, conn, "virNetworkLookupByName");
+
+  rv = Val_network (r, connv);
+
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virNetworkPtr r;
+
+  NONBLOCKING (r = virNetworkLookupByUUIDString (conn, str));
+  CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
+
+  rv = Val_network (r, connv);
+
+  CAMLreturn (rv);
+}
+
+CAMLprim value
 ocaml_libvirt_network_get_name (value netv)
 {
   CAMLparam1 (netv);
 ocaml_libvirt_network_get_name (value netv)
 {
   CAMLparam1 (netv);
@@ -664,6 +736,76 @@ ocaml_libvirt_network_create (value netv)
 }
 
 #ifdef HAVE_WEAK_SYMBOLS
 }
 
 #ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
+extern virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn dom) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME
+  /* Symbol virStoragePoolLookupByName not found at compile time. */
+  not_supported ("virStoragePoolLookupByName");
+  /* Suppresses a compiler warning. */
+  (void) caml__frame;
+#else
+  /* Check that the symbol virStoragePoolLookupByName
+   * is in runtime version of libvirt.
+   */
+  WEAK_SYMBOL_CHECK (virStoragePoolLookupByName);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virStoragePoolPtr r;
+
+  NONBLOCKING (r = virStoragePoolLookupByName (conn, str));
+  CHECK_ERROR (!r, conn, "virStoragePoolLookupByName");
+
+  rv = Val_pool (r, connv);
+
+  CAMLreturn (rv);
+#endif
+}
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
+extern virStoragePoolPtr virStoragePoolLookupByUUIDString (virConnectPtr conn dom) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv)
+{
+  CAMLparam2 (connv, strv);
+#ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING
+  /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */
+  not_supported ("virStoragePoolLookupByUUIDString");
+  /* Suppresses a compiler warning. */
+  (void) caml__frame;
+#else
+  /* Check that the symbol virStoragePoolLookupByUUIDString
+   * is in runtime version of libvirt.
+   */
+  WEAK_SYMBOL_CHECK (virStoragePoolLookupByUUIDString);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virStoragePoolPtr r;
+
+  NONBLOCKING (r = virStoragePoolLookupByUUIDString (conn, str));
+  CHECK_ERROR (!r, conn, "virStoragePoolLookupByUUIDString");
+
+  rv = Val_pool (r, connv);
+
+  CAMLreturn (rv);
+#endif
+}
+
+#ifdef HAVE_WEAK_SYMBOLS
 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
 #endif
 #ifdef HAVE_VIRSTORAGEPOOLGETNAME
 extern const char *virStoragePoolGetName (virStoragePoolPtr pool) __attribute__((weak));
 #endif
@@ -873,6 +1015,111 @@ ocaml_libvirt_storage_pool_refresh (value poolv)
 }
 
 #ifdef HAVE_WEAK_SYMBOLS
 }
 
 #ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYNAME
+extern virStorageVolPtr virStorageVolLookupByName (virConnectPtr conn dom) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_vol_lookup_by_name (value connv, value strv)
+{
+  CAMLparam2 (connv, 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);
+
+  CAMLlocal1 (rv);
+  virConnectPtr conn = Connect_val (connv);
+  char *str = String_val (strv);
+  virStorageVolPtr r;
+
+  NONBLOCKING (r = virStorageVolLookupByName (conn, str));
+  CHECK_ERROR (!r, conn, "virStorageVolLookupByName");
+
+  rv = Val_volume (r, connv);
+
+  CAMLreturn (rv);
+#endif
+}
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYKEY
+extern virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn dom) __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
+}
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEVOLLOOKUPBYPATH
+extern virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn dom) __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
+}
+
+#ifdef HAVE_WEAK_SYMBOLS
 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
 extern char *virStorageVolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
 #endif
 #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC
 extern char *virStorageVolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak));
 #endif
@@ -1107,24 +1354,12 @@ ocaml_libvirt_storage_pool_create_xml ()
 }
 
 CAMLprim value
 }
 
 CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_uuid_string ()
-{
-  failwith ("ocaml_libvirt_storage_pool_lookup_by_uuid_string is unimplemented");
-}
-
-CAMLprim value
 ocaml_libvirt_storage_pool_lookup_by_uuid ()
 {
   failwith ("ocaml_libvirt_storage_pool_lookup_by_uuid is unimplemented");
 }
 
 CAMLprim value
 ocaml_libvirt_storage_pool_lookup_by_uuid ()
 {
   failwith ("ocaml_libvirt_storage_pool_lookup_by_uuid is unimplemented");
 }
 
 CAMLprim value
-ocaml_libvirt_storage_pool_lookup_by_name ()
-{
-  failwith ("ocaml_libvirt_storage_pool_lookup_by_name is unimplemented");
-}
-
-CAMLprim value
 ocaml_libvirt_storage_vol_free ()
 {
   failwith ("ocaml_libvirt_storage_vol_free is unimplemented");
 ocaml_libvirt_storage_vol_free ()
 {
   failwith ("ocaml_libvirt_storage_vol_free is unimplemented");
@@ -1155,24 +1390,6 @@ ocaml_libvirt_pool_of_volume ()
 }
 
 CAMLprim value
 }
 
 CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_path ()
-{
-  failwith ("ocaml_libvirt_storage_vol_lookup_by_path is unimplemented");
-}
-
-CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_key ()
-{
-  failwith ("ocaml_libvirt_storage_vol_lookup_by_key is unimplemented");
-}
-
-CAMLprim value
-ocaml_libvirt_storage_vol_lookup_by_name ()
-{
-  failwith ("ocaml_libvirt_storage_vol_lookup_by_name is unimplemented");
-}
-
-CAMLprim value
 ocaml_libvirt_job_cancel ()
 {
   failwith ("ocaml_libvirt_job_cancel is unimplemented");
 ocaml_libvirt_job_cancel ()
 {
   failwith ("ocaml_libvirt_job_cancel is unimplemented");
index 6387b52..a9ed5b7 100644 (file)
@@ -293,38 +293,6 @@ ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv)
 }
 
 CAMLprim value
 }
 
 CAMLprim value
-ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value uuidv)
-{
-  CAMLparam2 (connv, uuidv);
-  CAMLlocal1 (rv);
-  virConnectPtr conn = Connect_val (connv);
-  char *uuid = String_val (uuidv);
-  virDomainPtr r;
-
-  NONBLOCKING (r = virDomainLookupByUUIDString (conn, uuid));
-  CHECK_ERROR (!r, conn, "virDomainLookupByUUIDString");
-
-  rv = Val_domain (r, connv);
-  CAMLreturn (rv);
-}
-
-CAMLprim value
-ocaml_libvirt_domain_lookup_by_name (value connv, value namev)
-{
-  CAMLparam2 (connv, namev);
-  CAMLlocal1 (rv);
-  virConnectPtr conn = Connect_val (connv);
-  char *name = String_val (namev);
-  virDomainPtr r;
-
-  NONBLOCKING (r = virDomainLookupByName (conn, name));
-  CHECK_ERROR (!r, conn, "virDomainLookupByName");
-
-  rv = Val_domain (r, connv);
-  CAMLreturn (rv);
-}
-
-CAMLprim value
 ocaml_libvirt_domain_destroy (value domv)
 {
   CAMLparam1 (domv);
 ocaml_libvirt_domain_destroy (value domv)
 {
   CAMLparam1 (domv);
@@ -936,22 +904,6 @@ ocaml_libvirt_domain_interface_stats (value domv, value pathv)
 }
 
 CAMLprim value
 }
 
 CAMLprim value
-ocaml_libvirt_network_lookup_by_name (value connv, value namev)
-{
-  CAMLparam2 (connv, namev);
-  CAMLlocal1 (rv);
-  virConnectPtr conn = Connect_val (connv);
-  char *name = String_val (namev);
-  virNetworkPtr r;
-
-  NONBLOCKING (r = virNetworkLookupByName (conn, name));
-  CHECK_ERROR (!r, conn, "virNetworkLookupByName");
-
-  rv = Val_network (r, connv);
-  CAMLreturn (rv);
-}
-
-CAMLprim value
 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
 {
   CAMLparam2 (connv, uuidv);
 ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
 {
   CAMLparam2 (connv, uuidv);
@@ -968,22 +920,6 @@ ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv)
 }
 
 CAMLprim value
 }
 
 CAMLprim value
-ocaml_libvirt_network_lookup_by_uuid_string (value connv, value uuidv)
-{
-  CAMLparam2 (connv, uuidv);
-  CAMLlocal1 (rv);
-  virConnectPtr conn = Connect_val (connv);
-  char *uuid = String_val (uuidv);
-  virNetworkPtr r;
-
-  NONBLOCKING (r = virNetworkLookupByUUIDString (conn, uuid));
-  CHECK_ERROR (!r, conn, "virNetworkLookupByUUIDString");
-
-  rv = Val_network (r, connv);
-  CAMLreturn (rv);
-}
-
-CAMLprim value
 ocaml_libvirt_network_create_xml (value connv, value xmlv)
 {
   CAMLparam2 (connv, xmlv);
 ocaml_libvirt_network_create_xml (value connv, value xmlv)
 {
   CAMLparam2 (connv, xmlv);