{ name => "virDomainGetName", sig => "dom : static string" },
{ name => "virDomainGetOSType", sig => "dom : string" },
{ name => "virDomainGetXMLDesc", sig => "dom, 0 : string" },
+ { name => "virDomainGetUUID", sig => "dom : uuid" },
+ { name => "virDomainGetUUIDString", sig => "dom : uuid string" },
{ name => "virDomainSuspend", sig => "dom : unit" },
{ name => "virDomainResume", sig => "dom : unit" },
{ name => "virDomainShutdown", sig => "dom : unit" },
{ name => "virNetworkGetName", sig => "net : static string" },
{ name => "virNetworkGetXMLDesc", sig => "net, 0 : string" },
{ name => "virNetworkGetBridgeName", sig => "net : string" },
+ { name => "virNetworkGetUUID", sig => "net : uuid" },
+ { name => "virNetworkGetUUIDString", sig => "net : uuid string" },
{ name => "virNetworkUndefine", sig => "net : unit" },
{ name => "virNetworkCreate", sig => "net : unit" },
{ name => "virNetworkGetAutostart", sig => "net : bool" },
sig => "pool : static string", weak => 1 },
{ name => "virStoragePoolGetXMLDesc",
sig => "pool, 0 : string", weak => 1 },
+ { name => "virStoragePoolGetUUID",
+ sig => "pool : uuid", weak => 1 },
+ { name => "virStoragePoolGetUUIDString",
+ sig => "pool : uuid string", weak => 1 },
{ name => "virStoragePoolUndefine",
sig => "pool : unit", weak => 1 },
{ name => "virStoragePoolCreate",
"ocaml_libvirt_network_create_job",
"ocaml_libvirt_network_create_xml_job",
"ocaml_libvirt_storage_pool_get_info",
- "ocaml_libvirt_storage_pool_get_uuid_string", #?
- "ocaml_libvirt_storage_pool_get_uuid", #?
"ocaml_libvirt_storage_pool_free", #?
"ocaml_libvirt_storage_pool_destroy", #?
"ocaml_libvirt_storage_pool_define_xml",
} elsif ($sig =~ /^(\w+) : int$/) {
my $c_type = short_name_to_c_type ($1);
"int $c_name ($c_type $1)"
+ } elsif ($sig =~ /^(\w+) : uuid$/) {
+ my $c_type = short_name_to_c_type ($1);
+ "int $c_name ($c_type $1, unsigned char *)"
+ } elsif ($sig =~ /^(\w+) : uuid string$/) {
+ my $c_type = short_name_to_c_type ($1);
+ "int $c_name ($c_type $1, char *)"
} elsif ($sig =~ /^(\w+) : bool$/) {
my $c_type = short_name_to_c_type ($1);
"int $c_name ($c_type $1, int *r)"
( "$1v" )
} elsif ($sig =~ /^(\w+) : int$/) {
( "$1v" )
+ } elsif ($sig =~ /^(\w+) : uuid$/) {
+ ( "$1v" )
+ } elsif ($sig =~ /^(\w+) : uuid string$/) {
+ ( "$1v" )
} elsif ($sig =~ /^(\w+) : bool$/) {
( "$1v" )
} elsif ($sig =~ /^(\w+), bool : unit$/) {
CAMLreturn (Val_int (r));
"
+ } elsif ($sig =~ /^(\w+) : uuid$/) {
+ "\
+ CAMLlocal1 (rv);
+ " . gen_unpack_args ($1) . "
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = $c_name ($1, uuid));
+ CHECK_ERROR (r == -1, conn, \"$c_name\");
+
+ rv = caml_copy_string ((char *) uuid);
+ CAMLreturn (rv);
+"
+ } elsif ($sig =~ /^(\w+) : uuid string$/) {
+ "\
+ CAMLlocal1 (rv);
+ " . gen_unpack_args ($1) . "
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = $c_name ($1, uuid));
+ CHECK_ERROR (r == -1, conn, \"$c_name\");
+
+ rv = caml_copy_string (uuid);
+ CAMLreturn (rv);
+"
} elsif ($sig =~ /^(\w+) : bool$/) {
"\
" . gen_unpack_args ($1) . "
}
CAMLprim value
+ocaml_libvirt_domain_get_uuid (value domv)
+{
+ CAMLparam1 (domv);
+
+ CAMLlocal1 (rv);
+ virDomainPtr dom = Domain_val (domv);
+ virConnectPtr conn = Connect_domv (domv);
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virDomainGetUUID (dom, uuid));
+ CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
+
+ rv = caml_copy_string ((char *) uuid);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_domain_get_uuid_string (value domv)
+{
+ CAMLparam1 (domv);
+
+ CAMLlocal1 (rv);
+ virDomainPtr dom = Domain_val (domv);
+ virConnectPtr conn = Connect_domv (domv);
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
+ CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
+
+ rv = caml_copy_string (uuid);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
ocaml_libvirt_domain_suspend (value domv)
{
CAMLparam1 (domv);
}
CAMLprim value
+ocaml_libvirt_network_get_uuid (value netv)
+{
+ CAMLparam1 (netv);
+
+ CAMLlocal1 (rv);
+ virNetworkPtr net = Network_val (netv);
+ virConnectPtr conn = Connect_netv (netv);
+ unsigned char uuid[VIR_UUID_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virNetworkGetUUID (net, uuid));
+ CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
+
+ rv = caml_copy_string ((char *) uuid);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_libvirt_network_get_uuid_string (value netv)
+{
+ CAMLparam1 (netv);
+
+ CAMLlocal1 (rv);
+ virNetworkPtr net = Network_val (netv);
+ virConnectPtr conn = Connect_netv (netv);
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ int r;
+
+ NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
+ CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
+
+ rv = caml_copy_string (uuid);
+ CAMLreturn (rv);
+}
+
+CAMLprim value
ocaml_libvirt_network_undefine (value netv)
{
CAMLparam1 (netv);
}
#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");
+
+ 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
#ifdef HAVE_VIRSTORAGEPOOLUNDEFINE
extern int virStoragePoolUndefine (virStoragePoolPtr pool) __attribute__((weak));
#endif
}
CAMLprim value
-ocaml_libvirt_storage_pool_get_uuid_string ()
-{
- failwith ("ocaml_libvirt_storage_pool_get_uuid_string is unimplemented");
-}
-
-CAMLprim value
-ocaml_libvirt_storage_pool_get_uuid ()
-{
- failwith ("ocaml_libvirt_storage_pool_get_uuid is unimplemented");
-}
-
-CAMLprim value
ocaml_libvirt_storage_pool_free ()
{
failwith ("ocaml_libvirt_storage_pool_free is unimplemented");
}
CAMLprim value
-ocaml_libvirt_domain_get_uuid (value domv)
-{
- CAMLparam1 (domv);
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- unsigned char uuid[VIR_UUID_BUFLEN];
- int r;
-
- NONBLOCKING (r = virDomainGetUUID (dom, uuid));
- CHECK_ERROR (r == -1, conn, "virDomainGetUUID");
-
- rv = caml_copy_string ((char *) uuid);
- CAMLreturn (rv);
-}
-
-CAMLprim value
-ocaml_libvirt_domain_get_uuid_string (value domv)
-{
- CAMLparam1 (domv);
- CAMLlocal1 (rv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char uuid[VIR_UUID_STRING_BUFLEN];
- int r;
-
- NONBLOCKING (r = virDomainGetUUIDString (dom, uuid));
- CHECK_ERROR (r == -1, conn, "virDomainGetUUIDString");
-
- rv = caml_copy_string (uuid);
- CAMLreturn (rv);
-}
-
-CAMLprim value
ocaml_libvirt_domain_get_id (value domv)
{
CAMLparam1 (domv);
CAMLreturn (Val_unit);
}
-CAMLprim value
-ocaml_libvirt_network_get_uuid (value netv)
-{
- CAMLparam1 (netv);
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- unsigned char uuid[VIR_UUID_BUFLEN];
- int r;
-
- NONBLOCKING (r = virNetworkGetUUID (net, uuid));
- CHECK_ERROR (r == -1, conn, "virNetworkGetUUID");
-
- rv = caml_copy_string ((char *) uuid);
- CAMLreturn (rv);
-}
-
-CAMLprim value
-ocaml_libvirt_network_get_uuid_string (value netv)
-{
- CAMLparam1 (netv);
- CAMLlocal1 (rv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- char uuid[VIR_UUID_STRING_BUFLEN];
- int r;
-
- NONBLOCKING (r = virNetworkGetUUIDString (net, uuid));
- CHECK_ERROR (r == -1, conn, "virNetworkGetUUIDString");
-
- rv = caml_copy_string (uuid);
- CAMLreturn (rv);
-}
-
/*----------------------------------------------------------------------*/
CAMLprim value