X-Git-Url: http://git.annexia.org/?p=virt-top.git;a=blobdiff_plain;f=libvirt%2Flibvirt_c.c;h=ca7f30350598931eea001907d63942aba3670245;hp=407c0fd5dda0a3a55803f3a1b95dee09a070e5da;hb=0bdb08c61ec66a16a81c2778a2a76cac77b08fda;hpb=77448a532e21983b65664e33525d18e76f41e348 diff --git a/libvirt/libvirt_c.c b/libvirt/libvirt_c.c index 407c0fd..ca7f303 100644 --- a/libvirt/libvirt_c.c +++ b/libvirt/libvirt_c.c @@ -48,7 +48,7 @@ #include "libvirt_c_oneoffs.c" /* Automatically generated binding for virConnectClose. - * Function signature in generator.pl is "conn : free" + * In generator.pl this function has signature "conn : free". */ CAMLprim value @@ -69,7 +69,7 @@ ocaml_libvirt_connect_close (value connv) } /* Automatically generated binding for virConnectGetHostname. - * Function signature in generator.pl is "conn : string" + * In generator.pl this function has signature "conn : string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -85,8 +85,7 @@ ocaml_libvirt_connect_get_hostname (value connv) #ifndef HAVE_VIRCONNECTGETHOSTNAME /* Symbol virConnectGetHostname not found at compile time. */ not_supported ("virConnectGetHostname"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectGetHostname * is in runtime version of libvirt. @@ -107,7 +106,7 @@ ocaml_libvirt_connect_get_hostname (value connv) } /* Automatically generated binding for virConnectGetURI. - * Function signature in generator.pl is "conn : string" + * In generator.pl this function has signature "conn : string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -123,8 +122,7 @@ ocaml_libvirt_connect_get_uri (value connv) #ifndef HAVE_VIRCONNECTGETURI /* Symbol virConnectGetURI not found at compile time. */ not_supported ("virConnectGetURI"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectGetURI * is in runtime version of libvirt. @@ -145,7 +143,7 @@ ocaml_libvirt_connect_get_uri (value connv) } /* Automatically generated binding for virConnectGetType. - * Function signature in generator.pl is "conn : static string" + * In generator.pl this function has signature "conn : static string". */ CAMLprim value @@ -165,7 +163,7 @@ ocaml_libvirt_connect_get_type (value connv) } /* Automatically generated binding for virConnectNumOfDomains. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ CAMLprim value @@ -183,7 +181,7 @@ ocaml_libvirt_connect_num_of_domains (value connv) } /* Automatically generated binding for virConnectListDomains. - * Function signature in generator.pl is "conn, int : int array" + * In generator.pl this function has signature "conn, int : int array". */ CAMLprim value @@ -207,7 +205,7 @@ ocaml_libvirt_connect_list_domains (value connv, value iv) } /* Automatically generated binding for virConnectNumOfDefinedDomains. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ CAMLprim value @@ -225,7 +223,7 @@ ocaml_libvirt_connect_num_of_defined_domains (value connv) } /* Automatically generated binding for virConnectListDefinedDomains. - * Function signature in generator.pl is "conn, int : string array" + * In generator.pl this function has signature "conn, int : string array". */ CAMLprim value @@ -253,7 +251,7 @@ ocaml_libvirt_connect_list_defined_domains (value connv, value iv) } /* Automatically generated binding for virConnectNumOfNetworks. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ CAMLprim value @@ -271,7 +269,7 @@ ocaml_libvirt_connect_num_of_networks (value connv) } /* Automatically generated binding for virConnectListNetworks. - * Function signature in generator.pl is "conn, int : string array" + * In generator.pl this function has signature "conn, int : string array". */ CAMLprim value @@ -299,7 +297,7 @@ ocaml_libvirt_connect_list_networks (value connv, value iv) } /* Automatically generated binding for virConnectNumOfDefinedNetworks. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ CAMLprim value @@ -317,7 +315,7 @@ ocaml_libvirt_connect_num_of_defined_networks (value connv) } /* Automatically generated binding for virConnectListDefinedNetworks. - * Function signature in generator.pl is "conn, int : string array" + * In generator.pl this function has signature "conn, int : string array". */ CAMLprim value @@ -345,7 +343,7 @@ ocaml_libvirt_connect_list_defined_networks (value connv, value iv) } /* Automatically generated binding for virConnectNumOfStoragePools. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ #ifdef HAVE_WEAK_SYMBOLS @@ -361,8 +359,7 @@ ocaml_libvirt_connect_num_of_storage_pools (value connv) #ifndef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS /* Symbol virConnectNumOfStoragePools not found at compile time. */ not_supported ("virConnectNumOfStoragePools"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectNumOfStoragePools * is in runtime version of libvirt. @@ -380,7 +377,7 @@ ocaml_libvirt_connect_num_of_storage_pools (value connv) } /* Automatically generated binding for virConnectListStoragePools. - * Function signature in generator.pl is "conn, int : string array" + * In generator.pl this function has signature "conn, int : string array". */ #ifdef HAVE_WEAK_SYMBOLS @@ -396,8 +393,7 @@ ocaml_libvirt_connect_list_storage_pools (value connv, value iv) #ifndef HAVE_VIRCONNECTLISTSTORAGEPOOLS /* Symbol virConnectListStoragePools not found at compile time. */ not_supported ("virConnectListStoragePools"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectListStoragePools * is in runtime version of libvirt. @@ -425,7 +421,7 @@ ocaml_libvirt_connect_list_storage_pools (value connv, value iv) } /* Automatically generated binding for virConnectNumOfDefinedStoragePools. - * Function signature in generator.pl is "conn : int" + * In generator.pl this function has signature "conn : int". */ #ifdef HAVE_WEAK_SYMBOLS @@ -441,8 +437,7 @@ ocaml_libvirt_connect_num_of_defined_storage_pools (value connv) #ifndef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS /* Symbol virConnectNumOfDefinedStoragePools not found at compile time. */ not_supported ("virConnectNumOfDefinedStoragePools"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectNumOfDefinedStoragePools * is in runtime version of libvirt. @@ -460,7 +455,7 @@ ocaml_libvirt_connect_num_of_defined_storage_pools (value connv) } /* Automatically generated binding for virConnectListDefinedStoragePools. - * Function signature in generator.pl is "conn, int : string array" + * In generator.pl this function has signature "conn, int : string array". */ #ifdef HAVE_WEAK_SYMBOLS @@ -476,8 +471,7 @@ ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv) #ifndef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS /* Symbol virConnectListDefinedStoragePools not found at compile time. */ not_supported ("virConnectListDefinedStoragePools"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virConnectListDefinedStoragePools * is in runtime version of libvirt. @@ -505,7 +499,7 @@ ocaml_libvirt_connect_list_defined_storage_pools (value connv, value iv) } /* Automatically generated binding for virConnectGetCapabilities. - * Function signature in generator.pl is "conn : string" + * In generator.pl this function has signature "conn : string". */ CAMLprim value @@ -526,7 +520,7 @@ ocaml_libvirt_connect_get_capabilities (value connv) } /* Automatically generated binding for virDomainCreateLinux. - * Function signature in generator.pl is "conn, string, 0U : dom" + * In generator.pl this function has signature "conn, string, 0U : dom". */ CAMLprim value @@ -548,12 +542,12 @@ ocaml_libvirt_domain_create_linux (value connv, value strv) } /* Automatically generated binding for virDomainCreateLinuxJob. - * Function signature in generator.pl is "conn, string, 0U : job" + * In generator.pl this function has signature "conn, string, 0U : job". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRDOMAINCREATELINUXJOB -extern virJobPtr virDomainCreateLinuxJob (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak)); +extern virJobPtr virDomainCreateLinuxJob (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak)); #endif #endif @@ -564,8 +558,7 @@ ocaml_libvirt_domain_create_linux_job (value connv, value strv) #ifndef HAVE_VIRDOMAINCREATELINUXJOB /* Symbol virDomainCreateLinuxJob not found at compile time. */ not_supported ("virDomainCreateLinuxJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virDomainCreateLinuxJob * is in runtime version of libvirt. @@ -587,7 +580,7 @@ ocaml_libvirt_domain_create_linux_job (value connv, value strv) } /* Automatically generated binding for virDomainFree. - * Function signature in generator.pl is "dom : free" + * In generator.pl this function has signature "dom : free". */ CAMLprim value @@ -609,7 +602,7 @@ ocaml_libvirt_domain_free (value domv) } /* Automatically generated binding for virDomainDestroy. - * Function signature in generator.pl is "dom : free" + * In generator.pl this function has signature "dom : free". */ CAMLprim value @@ -631,7 +624,7 @@ ocaml_libvirt_domain_destroy (value domv) } /* Automatically generated binding for virDomainLookupByName. - * Function signature in generator.pl is "conn, string : dom" + * In generator.pl this function has signature "conn, string : dom". */ CAMLprim value @@ -653,7 +646,7 @@ ocaml_libvirt_domain_lookup_by_name (value connv, value strv) } /* Automatically generated binding for virDomainLookupByID. - * Function signature in generator.pl is "conn, int : dom" + * In generator.pl this function has signature "conn, int : dom". */ CAMLprim value @@ -675,7 +668,7 @@ ocaml_libvirt_domain_lookup_by_id (value connv, value iv) } /* Automatically generated binding for virDomainLookupByUUID. - * Function signature in generator.pl is "conn, uuid : dom" + * In generator.pl this function has signature "conn, uuid : dom". */ CAMLprim value @@ -697,7 +690,7 @@ ocaml_libvirt_domain_lookup_by_uuid (value connv, value uuidv) } /* Automatically generated binding for virDomainLookupByUUIDString. - * Function signature in generator.pl is "conn, string : dom" + * In generator.pl this function has signature "conn, string : dom". */ CAMLprim value @@ -719,7 +712,7 @@ ocaml_libvirt_domain_lookup_by_uuid_string (value connv, value strv) } /* Automatically generated binding for virDomainGetName. - * Function signature in generator.pl is "dom : static string" + * In generator.pl this function has signature "dom : static string". */ CAMLprim value @@ -740,7 +733,7 @@ ocaml_libvirt_domain_get_name (value domv) } /* Automatically generated binding for virDomainGetOSType. - * Function signature in generator.pl is "dom : string" + * In generator.pl this function has signature "dom : string". */ CAMLprim value @@ -762,7 +755,7 @@ ocaml_libvirt_domain_get_os_type (value domv) } /* Automatically generated binding for virDomainGetXMLDesc. - * Function signature in generator.pl is "dom, 0 : string" + * In generator.pl this function has signature "dom, 0 : string". */ CAMLprim value @@ -784,7 +777,7 @@ ocaml_libvirt_domain_get_xml_desc (value domv) } /* Automatically generated binding for virDomainGetUUID. - * Function signature in generator.pl is "dom : uuid" + * In generator.pl this function has signature "dom : uuid". */ CAMLprim value @@ -801,12 +794,14 @@ ocaml_libvirt_domain_get_uuid (value domv) NONBLOCKING (r = virDomainGetUUID (dom, uuid)); CHECK_ERROR (r == -1, conn, "virDomainGetUUID"); - rv = caml_copy_string ((char *) uuid); + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); CAMLreturn (rv); } /* Automatically generated binding for virDomainGetUUIDString. - * Function signature in generator.pl is "dom : uuid string" + * In generator.pl this function has signature "dom : uuid string". */ CAMLprim value @@ -828,7 +823,7 @@ ocaml_libvirt_domain_get_uuid_string (value domv) } /* Automatically generated binding for virDomainGetMaxVcpus. - * Function signature in generator.pl is "dom : int" + * In generator.pl this function has signature "dom : int". */ CAMLprim value @@ -847,7 +842,7 @@ ocaml_libvirt_domain_get_max_vcpus (value domv) } /* Automatically generated binding for virDomainSave. - * Function signature in generator.pl is "dom, string : unit" + * In generator.pl this function has signature "dom, string : unit". */ CAMLprim value @@ -855,7 +850,6 @@ ocaml_libvirt_domain_save (value domv, value strv) { CAMLparam2 (domv, strv); - CAMLlocal1 (rv); virDomainPtr dom = Domain_val (domv); virConnectPtr conn = Connect_domv (domv); char *str = String_val (strv); @@ -868,7 +862,7 @@ ocaml_libvirt_domain_save (value domv, value strv) } /* Automatically generated binding for virDomainSaveJob. - * Function signature in generator.pl is "dom, string : job from dom" + * In generator.pl this function has signature "dom, string : job from dom". */ #ifdef HAVE_WEAK_SYMBOLS @@ -884,8 +878,7 @@ ocaml_libvirt_domain_save_job (value domv, value strv) #ifndef HAVE_VIRDOMAINSAVEJOB /* Symbol virDomainSaveJob not found at compile time. */ not_supported ("virDomainSaveJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virDomainSaveJob * is in runtime version of libvirt. @@ -909,7 +902,7 @@ ocaml_libvirt_domain_save_job (value domv, value strv) } /* Automatically generated binding for virDomainRestore. - * Function signature in generator.pl is "conn, string : unit" + * In generator.pl this function has signature "conn, string : unit". */ CAMLprim value @@ -917,7 +910,6 @@ ocaml_libvirt_domain_restore (value connv, value strv) { CAMLparam2 (connv, strv); - CAMLlocal1 (rv); virConnectPtr conn = Connect_val (connv); char *str = String_val (strv); int r; @@ -929,7 +921,7 @@ ocaml_libvirt_domain_restore (value connv, value strv) } /* Automatically generated binding for virDomainRestoreJob. - * Function signature in generator.pl is "conn, string : job" + * In generator.pl this function has signature "conn, string : job". */ #ifdef HAVE_WEAK_SYMBOLS @@ -945,8 +937,7 @@ ocaml_libvirt_domain_restore_job (value connv, value strv) #ifndef HAVE_VIRDOMAINRESTOREJOB /* Symbol virDomainRestoreJob not found at compile time. */ not_supported ("virDomainRestoreJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virDomainRestoreJob * is in runtime version of libvirt. @@ -968,7 +959,7 @@ ocaml_libvirt_domain_restore_job (value connv, value strv) } /* Automatically generated binding for virDomainCoreDump. - * Function signature in generator.pl is "dom, string, 0 : unit" + * In generator.pl this function has signature "dom, string, 0 : unit". */ CAMLprim value @@ -989,7 +980,7 @@ ocaml_libvirt_domain_core_dump (value domv, value strv) } /* Automatically generated binding for virDomainCoreDumpJob. - * Function signature in generator.pl is "dom, string, 0 : job from dom" + * In generator.pl this function has signature "dom, string, 0 : job from dom". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1005,8 +996,7 @@ ocaml_libvirt_domain_core_dump_job (value domv, value strv) #ifndef HAVE_VIRDOMAINCOREDUMPJOB /* Symbol virDomainCoreDumpJob not found at compile time. */ not_supported ("virDomainCoreDumpJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virDomainCoreDumpJob * is in runtime version of libvirt. @@ -1030,7 +1020,7 @@ ocaml_libvirt_domain_core_dump_job (value domv, value strv) } /* Automatically generated binding for virDomainSuspend. - * Function signature in generator.pl is "dom : unit" + * In generator.pl this function has signature "dom : unit". */ CAMLprim value @@ -1049,7 +1039,7 @@ ocaml_libvirt_domain_suspend (value domv) } /* Automatically generated binding for virDomainResume. - * Function signature in generator.pl is "dom : unit" + * In generator.pl this function has signature "dom : unit". */ CAMLprim value @@ -1068,7 +1058,7 @@ ocaml_libvirt_domain_resume (value domv) } /* Automatically generated binding for virDomainShutdown. - * Function signature in generator.pl is "dom : unit" + * In generator.pl this function has signature "dom : unit". */ CAMLprim value @@ -1087,7 +1077,7 @@ ocaml_libvirt_domain_shutdown (value domv) } /* Automatically generated binding for virDomainReboot. - * Function signature in generator.pl is "dom, 0 : unit" + * In generator.pl this function has signature "dom, 0 : unit". */ CAMLprim value @@ -1106,7 +1096,7 @@ ocaml_libvirt_domain_reboot (value domv) } /* Automatically generated binding for virDomainDefineXML. - * Function signature in generator.pl is "conn, string : dom" + * In generator.pl this function has signature "conn, string : dom". */ CAMLprim value @@ -1128,7 +1118,7 @@ ocaml_libvirt_domain_define_xml (value connv, value strv) } /* Automatically generated binding for virDomainUndefine. - * Function signature in generator.pl is "dom : unit" + * In generator.pl this function has signature "dom : unit". */ CAMLprim value @@ -1147,7 +1137,7 @@ ocaml_libvirt_domain_undefine (value domv) } /* Automatically generated binding for virDomainCreate. - * Function signature in generator.pl is "dom : unit" + * In generator.pl this function has signature "dom : unit". */ CAMLprim value @@ -1166,7 +1156,7 @@ ocaml_libvirt_domain_create (value domv) } /* Automatically generated binding for virDomainCreateJob. - * Function signature in generator.pl is "dom, 0U : job from dom" + * In generator.pl this function has signature "dom, 0U : job from dom". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1182,8 +1172,7 @@ ocaml_libvirt_domain_create_job (value domv) #ifndef HAVE_VIRDOMAINCREATEJOB /* Symbol virDomainCreateJob not found at compile time. */ not_supported ("virDomainCreateJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virDomainCreateJob * is in runtime version of libvirt. @@ -1206,7 +1195,7 @@ ocaml_libvirt_domain_create_job (value domv) } /* Automatically generated binding for virDomainAttachDevice. - * Function signature in generator.pl is "dom, string : unit" + * In generator.pl this function has signature "dom, string : unit". */ CAMLprim value @@ -1214,7 +1203,6 @@ ocaml_libvirt_domain_attach_device (value domv, value strv) { CAMLparam2 (domv, strv); - CAMLlocal1 (rv); virDomainPtr dom = Domain_val (domv); virConnectPtr conn = Connect_domv (domv); char *str = String_val (strv); @@ -1227,7 +1215,7 @@ ocaml_libvirt_domain_attach_device (value domv, value strv) } /* Automatically generated binding for virDomainDetachDevice. - * Function signature in generator.pl is "dom, string : unit" + * In generator.pl this function has signature "dom, string : unit". */ CAMLprim value @@ -1235,7 +1223,6 @@ ocaml_libvirt_domain_detach_device (value domv, value strv) { CAMLparam2 (domv, strv); - CAMLlocal1 (rv); virDomainPtr dom = Domain_val (domv); virConnectPtr conn = Connect_domv (domv); char *str = String_val (strv); @@ -1248,7 +1235,7 @@ ocaml_libvirt_domain_detach_device (value domv, value strv) } /* Automatically generated binding for virDomainGetAutostart. - * Function signature in generator.pl is "dom : bool" + * In generator.pl this function has signature "dom : bool". */ CAMLprim value @@ -1267,7 +1254,7 @@ ocaml_libvirt_domain_get_autostart (value domv) } /* Automatically generated binding for virDomainSetAutostart. - * Function signature in generator.pl is "dom, bool : unit" + * In generator.pl this function has signature "dom, bool : unit". */ CAMLprim value @@ -1288,7 +1275,7 @@ ocaml_libvirt_domain_set_autostart (value domv, value bv) } /* Automatically generated binding for virNetworkFree. - * Function signature in generator.pl is "net : free" + * In generator.pl this function has signature "net : free". */ CAMLprim value @@ -1310,7 +1297,7 @@ ocaml_libvirt_network_free (value netv) } /* Automatically generated binding for virNetworkDestroy. - * Function signature in generator.pl is "net : free" + * In generator.pl this function has signature "net : free". */ CAMLprim value @@ -1332,7 +1319,7 @@ ocaml_libvirt_network_destroy (value netv) } /* Automatically generated binding for virNetworkLookupByName. - * Function signature in generator.pl is "conn, string : net" + * In generator.pl this function has signature "conn, string : net". */ CAMLprim value @@ -1354,7 +1341,7 @@ ocaml_libvirt_network_lookup_by_name (value connv, value strv) } /* Automatically generated binding for virNetworkLookupByUUID. - * Function signature in generator.pl is "conn, uuid : net" + * In generator.pl this function has signature "conn, uuid : net". */ CAMLprim value @@ -1376,7 +1363,7 @@ ocaml_libvirt_network_lookup_by_uuid (value connv, value uuidv) } /* Automatically generated binding for virNetworkLookupByUUIDString. - * Function signature in generator.pl is "conn, string : net" + * In generator.pl this function has signature "conn, string : net". */ CAMLprim value @@ -1398,7 +1385,7 @@ ocaml_libvirt_network_lookup_by_uuid_string (value connv, value strv) } /* Automatically generated binding for virNetworkGetName. - * Function signature in generator.pl is "net : static string" + * In generator.pl this function has signature "net : static string". */ CAMLprim value @@ -1419,7 +1406,7 @@ ocaml_libvirt_network_get_name (value netv) } /* Automatically generated binding for virNetworkGetXMLDesc. - * Function signature in generator.pl is "net, 0 : string" + * In generator.pl this function has signature "net, 0 : string". */ CAMLprim value @@ -1441,7 +1428,7 @@ ocaml_libvirt_network_get_xml_desc (value netv) } /* Automatically generated binding for virNetworkGetBridgeName. - * Function signature in generator.pl is "net : string" + * In generator.pl this function has signature "net : string". */ CAMLprim value @@ -1463,7 +1450,7 @@ ocaml_libvirt_network_get_bridge_name (value netv) } /* Automatically generated binding for virNetworkGetUUID. - * Function signature in generator.pl is "net : uuid" + * In generator.pl this function has signature "net : uuid". */ CAMLprim value @@ -1480,12 +1467,14 @@ ocaml_libvirt_network_get_uuid (value netv) NONBLOCKING (r = virNetworkGetUUID (net, uuid)); CHECK_ERROR (r == -1, conn, "virNetworkGetUUID"); - rv = caml_copy_string ((char *) uuid); + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); CAMLreturn (rv); } /* Automatically generated binding for virNetworkGetUUIDString. - * Function signature in generator.pl is "net : uuid string" + * In generator.pl this function has signature "net : uuid string". */ CAMLprim value @@ -1507,7 +1496,7 @@ ocaml_libvirt_network_get_uuid_string (value netv) } /* Automatically generated binding for virNetworkUndefine. - * Function signature in generator.pl is "net : unit" + * In generator.pl this function has signature "net : unit". */ CAMLprim value @@ -1526,7 +1515,7 @@ ocaml_libvirt_network_undefine (value netv) } /* Automatically generated binding for virNetworkCreateXML. - * Function signature in generator.pl is "conn, string : net" + * In generator.pl this function has signature "conn, string : net". */ CAMLprim value @@ -1548,7 +1537,7 @@ ocaml_libvirt_network_create_xml (value connv, value strv) } /* Automatically generated binding for virNetworkCreateXMLJob. - * Function signature in generator.pl is "conn, string : job" + * In generator.pl this function has signature "conn, string : job". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1564,8 +1553,7 @@ ocaml_libvirt_network_create_xml_job (value connv, value strv) #ifndef HAVE_VIRNETWORKCREATEXMLJOB /* Symbol virNetworkCreateXMLJob not found at compile time. */ not_supported ("virNetworkCreateXMLJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virNetworkCreateXMLJob * is in runtime version of libvirt. @@ -1587,7 +1575,7 @@ ocaml_libvirt_network_create_xml_job (value connv, value strv) } /* Automatically generated binding for virNetworkDefineXML. - * Function signature in generator.pl is "conn, string : net" + * In generator.pl this function has signature "conn, string : net". */ CAMLprim value @@ -1609,7 +1597,7 @@ ocaml_libvirt_network_define_xml (value connv, value strv) } /* Automatically generated binding for virNetworkCreate. - * Function signature in generator.pl is "net : unit" + * In generator.pl this function has signature "net : unit". */ CAMLprim value @@ -1628,7 +1616,7 @@ ocaml_libvirt_network_create (value netv) } /* Automatically generated binding for virNetworkCreateJob. - * Function signature in generator.pl is "net : job from net" + * In generator.pl this function has signature "net : job from net". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1644,8 +1632,7 @@ ocaml_libvirt_network_create_job (value netv) #ifndef HAVE_VIRNETWORKCREATEJOB /* Symbol virNetworkCreateJob not found at compile time. */ not_supported ("virNetworkCreateJob"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virNetworkCreateJob * is in runtime version of libvirt. @@ -1668,7 +1655,7 @@ ocaml_libvirt_network_create_job (value netv) } /* Automatically generated binding for virNetworkGetAutostart. - * Function signature in generator.pl is "net : bool" + * In generator.pl this function has signature "net : bool". */ CAMLprim value @@ -1687,7 +1674,7 @@ ocaml_libvirt_network_get_autostart (value netv) } /* Automatically generated binding for virNetworkSetAutostart. - * Function signature in generator.pl is "net, bool : unit" + * In generator.pl this function has signature "net, bool : unit". */ CAMLprim value @@ -1708,7 +1695,7 @@ ocaml_libvirt_network_set_autostart (value netv, value bv) } /* Automatically generated binding for virStoragePoolFree. - * Function signature in generator.pl is "pool : free" + * In generator.pl this function has signature "pool : free". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1724,8 +1711,7 @@ ocaml_libvirt_storage_pool_free (value poolv) #ifndef HAVE_VIRSTORAGEPOOLFREE /* Symbol virStoragePoolFree not found at compile time. */ not_supported ("virStoragePoolFree"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolFree * is in runtime version of libvirt. @@ -1747,7 +1733,7 @@ ocaml_libvirt_storage_pool_free (value poolv) } /* Automatically generated binding for virStoragePoolDestroy. - * Function signature in generator.pl is "pool : free" + * In generator.pl this function has signature "pool : free". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1763,8 +1749,7 @@ ocaml_libvirt_storage_pool_destroy (value poolv) #ifndef HAVE_VIRSTORAGEPOOLDESTROY /* Symbol virStoragePoolDestroy not found at compile time. */ not_supported ("virStoragePoolDestroy"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolDestroy * is in runtime version of libvirt. @@ -1786,7 +1771,7 @@ ocaml_libvirt_storage_pool_destroy (value poolv) } /* Automatically generated binding for virStoragePoolLookupByName. - * Function signature in generator.pl is "conn, string : pool" + * In generator.pl this function has signature "conn, string : pool". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1802,8 +1787,7 @@ ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv) #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME /* Symbol virStoragePoolLookupByName not found at compile time. */ not_supported ("virStoragePoolLookupByName"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolLookupByName * is in runtime version of libvirt. @@ -1825,7 +1809,7 @@ ocaml_libvirt_storage_pool_lookup_by_name (value connv, value strv) } /* Automatically generated binding for virStoragePoolLookupByUUID. - * Function signature in generator.pl is "conn, uuid : pool" + * In generator.pl this function has signature "conn, uuid : pool". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1841,8 +1825,7 @@ ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv) #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID /* Symbol virStoragePoolLookupByUUID not found at compile time. */ not_supported ("virStoragePoolLookupByUUID"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolLookupByUUID * is in runtime version of libvirt. @@ -1864,7 +1847,7 @@ ocaml_libvirt_storage_pool_lookup_by_uuid (value connv, value uuidv) } /* Automatically generated binding for virStoragePoolLookupByUUIDString. - * Function signature in generator.pl is "conn, string : pool" + * In generator.pl this function has signature "conn, string : pool". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1880,8 +1863,7 @@ ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv) #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING /* Symbol virStoragePoolLookupByUUIDString not found at compile time. */ not_supported ("virStoragePoolLookupByUUIDString"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolLookupByUUIDString * is in runtime version of libvirt. @@ -1903,7 +1885,7 @@ ocaml_libvirt_storage_pool_lookup_by_uuid_string (value connv, value strv) } /* Automatically generated binding for virStoragePoolGetName. - * Function signature in generator.pl is "pool : static string" + * In generator.pl this function has signature "pool : static string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1919,8 +1901,7 @@ ocaml_libvirt_storage_pool_get_name (value poolv) #ifndef HAVE_VIRSTORAGEPOOLGETNAME /* Symbol virStoragePoolGetName not found at compile time. */ not_supported ("virStoragePoolGetName"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolGetName * is in runtime version of libvirt. @@ -1941,12 +1922,12 @@ ocaml_libvirt_storage_pool_get_name (value poolv) } /* Automatically generated binding for virStoragePoolGetXMLDesc. - * Function signature in generator.pl is "pool, 0 : string" + * In generator.pl this function has signature "pool, 0U : string". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRSTORAGEPOOLGETXMLDESC -extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, int flags) __attribute__((weak)); +extern char *virStoragePoolGetXMLDesc (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak)); #endif #endif @@ -1957,8 +1938,7 @@ ocaml_libvirt_storage_pool_get_xml_desc (value poolv) #ifndef HAVE_VIRSTORAGEPOOLGETXMLDESC /* Symbol virStoragePoolGetXMLDesc not found at compile time. */ not_supported ("virStoragePoolGetXMLDesc"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolGetXMLDesc * is in runtime version of libvirt. @@ -1980,7 +1960,7 @@ ocaml_libvirt_storage_pool_get_xml_desc (value poolv) } /* Automatically generated binding for virStoragePoolGetUUID. - * Function signature in generator.pl is "pool : uuid" + * In generator.pl this function has signature "pool : uuid". */ #ifdef HAVE_WEAK_SYMBOLS @@ -1996,8 +1976,7 @@ ocaml_libvirt_storage_pool_get_uuid (value poolv) #ifndef HAVE_VIRSTORAGEPOOLGETUUID /* Symbol virStoragePoolGetUUID not found at compile time. */ not_supported ("virStoragePoolGetUUID"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolGetUUID * is in runtime version of libvirt. @@ -2013,13 +1992,15 @@ ocaml_libvirt_storage_pool_get_uuid (value poolv) NONBLOCKING (r = virStoragePoolGetUUID (pool, uuid)); CHECK_ERROR (r == -1, conn, "virStoragePoolGetUUID"); - rv = caml_copy_string ((char *) uuid); + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); CAMLreturn (rv); #endif } /* Automatically generated binding for virStoragePoolGetUUIDString. - * Function signature in generator.pl is "pool : uuid string" + * In generator.pl this function has signature "pool : uuid string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2035,8 +2016,7 @@ ocaml_libvirt_storage_pool_get_uuid_string (value poolv) #ifndef HAVE_VIRSTORAGEPOOLGETUUIDSTRING /* Symbol virStoragePoolGetUUIDString not found at compile time. */ not_supported ("virStoragePoolGetUUIDString"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolGetUUIDString * is in runtime version of libvirt. @@ -2058,12 +2038,12 @@ ocaml_libvirt_storage_pool_get_uuid_string (value poolv) } /* Automatically generated binding for virStoragePoolCreateXML. - * Function signature in generator.pl is "conn, string : pool" + * In generator.pl this function has signature "conn, string, 0U : pool". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRSTORAGEPOOLCREATEXML -extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str) __attribute__((weak)); +extern virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak)); #endif #endif @@ -2074,8 +2054,7 @@ ocaml_libvirt_storage_pool_create_xml (value connv, value strv) #ifndef HAVE_VIRSTORAGEPOOLCREATEXML /* Symbol virStoragePoolCreateXML not found at compile time. */ not_supported ("virStoragePoolCreateXML"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolCreateXML * is in runtime version of libvirt. @@ -2087,7 +2066,7 @@ ocaml_libvirt_storage_pool_create_xml (value connv, value strv) char *str = String_val (strv); virStoragePoolPtr r; - NONBLOCKING (r = virStoragePoolCreateXML (conn, str)); + NONBLOCKING (r = virStoragePoolCreateXML (conn, str, 0)); CHECK_ERROR (!r, conn, "virStoragePoolCreateXML"); rv = Val_pool (r, connv); @@ -2097,12 +2076,12 @@ ocaml_libvirt_storage_pool_create_xml (value connv, value strv) } /* Automatically generated binding for virStoragePoolDefineXML. - * Function signature in generator.pl is "conn, string : pool" + * In generator.pl this function has signature "conn, string, 0U : pool". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRSTORAGEPOOLDEFINEXML -extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str) __attribute__((weak)); +extern virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak)); #endif #endif @@ -2113,8 +2092,7 @@ ocaml_libvirt_storage_pool_define_xml (value connv, value strv) #ifndef HAVE_VIRSTORAGEPOOLDEFINEXML /* Symbol virStoragePoolDefineXML not found at compile time. */ not_supported ("virStoragePoolDefineXML"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolDefineXML * is in runtime version of libvirt. @@ -2126,7 +2104,7 @@ ocaml_libvirt_storage_pool_define_xml (value connv, value strv) char *str = String_val (strv); virStoragePoolPtr r; - NONBLOCKING (r = virStoragePoolDefineXML (conn, str)); + NONBLOCKING (r = virStoragePoolDefineXML (conn, str, 0)); CHECK_ERROR (!r, conn, "virStoragePoolDefineXML"); rv = Val_pool (r, connv); @@ -2135,8 +2113,44 @@ ocaml_libvirt_storage_pool_define_xml (value connv, value strv) #endif } +/* Automatically generated binding for virStoragePoolBuild. + * In generator.pl this function has signature "pool, uint : unit". + */ + +#ifdef HAVE_WEAK_SYMBOLS +#ifdef HAVE_VIRSTORAGEPOOLBUILD +extern int virStoragePoolBuild (virStoragePoolPtr pool, unsigned int i) __attribute__((weak)); +#endif +#endif + +CAMLprim value +ocaml_libvirt_storage_pool_build (value poolv, value iv) +{ + CAMLparam2 (poolv, iv); +#ifndef HAVE_VIRSTORAGEPOOLBUILD + /* Symbol virStoragePoolBuild not found at compile time. */ + not_supported ("virStoragePoolBuild"); + CAMLnoreturn; +#else + /* Check that the symbol virStoragePoolBuild + * is in runtime version of libvirt. + */ + WEAK_SYMBOL_CHECK (virStoragePoolBuild); + + virStoragePoolPtr pool = Pool_val (poolv); + virConnectPtr conn = Connect_polv (poolv); + unsigned int i = Int_val (iv); + int r; + + NONBLOCKING (r = virStoragePoolBuild (pool, i)); + CHECK_ERROR (!r, conn, "virStoragePoolBuild"); + + CAMLreturn (Val_unit); +#endif +} + /* Automatically generated binding for virStoragePoolUndefine. - * Function signature in generator.pl is "pool : unit" + * In generator.pl this function has signature "pool : unit". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2152,8 +2166,7 @@ ocaml_libvirt_storage_pool_undefine (value poolv) #ifndef HAVE_VIRSTORAGEPOOLUNDEFINE /* Symbol virStoragePoolUndefine not found at compile time. */ not_supported ("virStoragePoolUndefine"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolUndefine * is in runtime version of libvirt. @@ -2172,12 +2185,12 @@ ocaml_libvirt_storage_pool_undefine (value poolv) } /* Automatically generated binding for virStoragePoolCreate. - * Function signature in generator.pl is "pool : unit" + * In generator.pl this function has signature "pool, 0U : unit". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRSTORAGEPOOLCREATE -extern int virStoragePoolCreate (virStoragePoolPtr pool) __attribute__((weak)); +extern int virStoragePoolCreate (virStoragePoolPtr pool, unsigned int flags) __attribute__((weak)); #endif #endif @@ -2188,8 +2201,7 @@ ocaml_libvirt_storage_pool_create (value poolv) #ifndef HAVE_VIRSTORAGEPOOLCREATE /* Symbol virStoragePoolCreate not found at compile time. */ not_supported ("virStoragePoolCreate"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolCreate * is in runtime version of libvirt. @@ -2200,51 +2212,51 @@ ocaml_libvirt_storage_pool_create (value poolv) virConnectPtr conn = Connect_polv (poolv); int r; - NONBLOCKING (r = virStoragePoolCreate (pool)); + NONBLOCKING (r = virStoragePoolCreate (pool, 0)); CHECK_ERROR (r == -1, conn, "virStoragePoolCreate"); CAMLreturn (Val_unit); #endif } -/* Automatically generated binding for virStoragePoolShutdown. - * Function signature in generator.pl is "pool : unit" +/* Automatically generated binding for virStoragePoolDelete. + * In generator.pl this function has signature "pool, uint : unit". */ #ifdef HAVE_WEAK_SYMBOLS -#ifdef HAVE_VIRSTORAGEPOOLSHUTDOWN -extern int virStoragePoolShutdown (virStoragePoolPtr pool) __attribute__((weak)); +#ifdef HAVE_VIRSTORAGEPOOLDELETE +extern int virStoragePoolDelete (virStoragePoolPtr pool, unsigned int i) __attribute__((weak)); #endif #endif CAMLprim value -ocaml_libvirt_storage_pool_shutdown (value poolv) +ocaml_libvirt_storage_pool_delete (value poolv, value iv) { - CAMLparam1 (poolv); -#ifndef HAVE_VIRSTORAGEPOOLSHUTDOWN - /* Symbol virStoragePoolShutdown not found at compile time. */ - not_supported ("virStoragePoolShutdown"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLparam2 (poolv, iv); +#ifndef HAVE_VIRSTORAGEPOOLDELETE + /* Symbol virStoragePoolDelete not found at compile time. */ + not_supported ("virStoragePoolDelete"); + CAMLnoreturn; #else - /* Check that the symbol virStoragePoolShutdown + /* Check that the symbol virStoragePoolDelete * is in runtime version of libvirt. */ - WEAK_SYMBOL_CHECK (virStoragePoolShutdown); + WEAK_SYMBOL_CHECK (virStoragePoolDelete); virStoragePoolPtr pool = Pool_val (poolv); virConnectPtr conn = Connect_polv (poolv); + unsigned int i = Int_val (iv); int r; - NONBLOCKING (r = virStoragePoolShutdown (pool)); - CHECK_ERROR (r == -1, conn, "virStoragePoolShutdown"); + NONBLOCKING (r = virStoragePoolDelete (pool, i)); + CHECK_ERROR (!r, conn, "virStoragePoolDelete"); CAMLreturn (Val_unit); #endif } /* Automatically generated binding for virStoragePoolRefresh. - * Function signature in generator.pl is "pool, 0U : unit" + * In generator.pl this function has signature "pool, 0U : unit". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2260,8 +2272,7 @@ ocaml_libvirt_storage_pool_refresh (value poolv) #ifndef HAVE_VIRSTORAGEPOOLREFRESH /* Symbol virStoragePoolRefresh not found at compile time. */ not_supported ("virStoragePoolRefresh"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolRefresh * is in runtime version of libvirt. @@ -2280,7 +2291,7 @@ ocaml_libvirt_storage_pool_refresh (value poolv) } /* Automatically generated binding for virStoragePoolGetAutostart. - * Function signature in generator.pl is "pool : bool" + * In generator.pl this function has signature "pool : bool". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2296,8 +2307,7 @@ ocaml_libvirt_storage_pool_get_autostart (value poolv) #ifndef HAVE_VIRSTORAGEPOOLGETAUTOSTART /* Symbol virStoragePoolGetAutostart not found at compile time. */ not_supported ("virStoragePoolGetAutostart"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolGetAutostart * is in runtime version of libvirt. @@ -2316,7 +2326,7 @@ ocaml_libvirt_storage_pool_get_autostart (value poolv) } /* Automatically generated binding for virStoragePoolSetAutostart. - * Function signature in generator.pl is "pool, bool : unit" + * In generator.pl this function has signature "pool, bool : unit". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2332,8 +2342,7 @@ ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv) #ifndef HAVE_VIRSTORAGEPOOLSETAUTOSTART /* Symbol virStoragePoolSetAutostart not found at compile time. */ not_supported ("virStoragePoolSetAutostart"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolSetAutostart * is in runtime version of libvirt. @@ -2353,8 +2362,88 @@ ocaml_libvirt_storage_pool_set_autostart (value poolv, value bv) #endif } +/* Automatically generated binding for virStoragePoolNumOfVolumes. + * In generator.pl this function has signature "pool : int". + */ + +#ifdef HAVE_WEAK_SYMBOLS +#ifdef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES +extern int virStoragePoolNumOfVolumes (virStoragePoolPtr pool) __attribute__((weak)); +#endif +#endif + +CAMLprim value +ocaml_libvirt_storage_pool_num_of_volumes (value poolv) +{ + CAMLparam1 (poolv); +#ifndef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES + /* Symbol virStoragePoolNumOfVolumes not found at compile time. */ + not_supported ("virStoragePoolNumOfVolumes"); + CAMLnoreturn; +#else + /* Check that the symbol virStoragePoolNumOfVolumes + * is in runtime version of libvirt. + */ + WEAK_SYMBOL_CHECK (virStoragePoolNumOfVolumes); + + virStoragePoolPtr pool = Pool_val (poolv); + virConnectPtr conn = Connect_polv (poolv); + int r; + + NONBLOCKING (r = virStoragePoolNumOfVolumes (pool)); + CHECK_ERROR (r == -1, conn, "virStoragePoolNumOfVolumes"); + + CAMLreturn (Val_int (r)); +#endif +} + +/* Automatically generated binding for virStoragePoolListVolumes. + * In generator.pl this function has signature "pool, int : string array". + */ + +#ifdef HAVE_WEAK_SYMBOLS +#ifdef HAVE_VIRSTORAGEPOOLLISTVOLUMES +extern int virStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames) __attribute__((weak)); +#endif +#endif + +CAMLprim value +ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv) +{ + CAMLparam2 (poolv, iv); +#ifndef HAVE_VIRSTORAGEPOOLLISTVOLUMES + /* Symbol virStoragePoolListVolumes not found at compile time. */ + not_supported ("virStoragePoolListVolumes"); + CAMLnoreturn; +#else + /* Check that the symbol virStoragePoolListVolumes + * is in runtime version of libvirt. + */ + WEAK_SYMBOL_CHECK (virStoragePoolListVolumes); + + CAMLlocal2 (rv, strv); + virStoragePoolPtr pool = Pool_val (poolv); + virConnectPtr conn = Connect_polv (poolv); + int i = Int_val (iv); + char *names[i]; + int r; + + NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i)); + CHECK_ERROR (r == -1, conn, "virStoragePoolListVolumes"); + + rv = caml_alloc (r, 0); + for (i = 0; i < r; ++i) { + strv = caml_copy_string (names[i]); + Store_field (rv, i, strv); + free (names[i]); + } + + CAMLreturn (rv); +#endif +} + /* Automatically generated binding for virStorageVolFree. - * Function signature in generator.pl is "vol : free" + * In generator.pl this function has signature "vol : free". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2370,8 +2459,7 @@ ocaml_libvirt_storage_vol_free (value volv) #ifndef HAVE_VIRSTORAGEVOLFREE /* Symbol virStorageVolFree not found at compile time. */ not_supported ("virStorageVolFree"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolFree * is in runtime version of libvirt. @@ -2392,47 +2480,84 @@ ocaml_libvirt_storage_vol_free (value volv) #endif } -/* Automatically generated binding for virStorageVolDestroy. - * Function signature in generator.pl is "vol : free" +/* Automatically generated binding for virStorageVolDelete. + * In generator.pl this function has signature "vol, uint : unit". */ #ifdef HAVE_WEAK_SYMBOLS -#ifdef HAVE_VIRSTORAGEVOLDESTROY -extern int virStorageVolDestroy (virStorageVolPtr vol) __attribute__((weak)); +#ifdef HAVE_VIRSTORAGEVOLDELETE +extern int virStorageVolDelete (virStorageVolPtr vol, unsigned int i) __attribute__((weak)); #endif #endif CAMLprim value -ocaml_libvirt_storage_vol_destroy (value volv) +ocaml_libvirt_storage_vol_delete (value volv, value iv) { - CAMLparam1 (volv); -#ifndef HAVE_VIRSTORAGEVOLDESTROY - /* Symbol virStorageVolDestroy not found at compile time. */ - not_supported ("virStorageVolDestroy"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLparam2 (volv, iv); +#ifndef HAVE_VIRSTORAGEVOLDELETE + /* Symbol virStorageVolDelete not found at compile time. */ + not_supported ("virStorageVolDelete"); + CAMLnoreturn; #else - /* Check that the symbol virStorageVolDestroy + /* Check that the symbol virStorageVolDelete * is in runtime version of libvirt. */ - WEAK_SYMBOL_CHECK (virStorageVolDestroy); + WEAK_SYMBOL_CHECK (virStorageVolDelete); virStorageVolPtr vol = Volume_val (volv); virConnectPtr conn = Connect_volv (volv); + unsigned int i = Int_val (iv); 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; + NONBLOCKING (r = virStorageVolDelete (vol, i)); + CHECK_ERROR (!r, conn, "virStorageVolDelete"); 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"); + CAMLnoreturn; +#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. - * Function signature in generator.pl is "conn, string : vol" + * In generator.pl this function has signature "conn, string : vol". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2448,8 +2573,7 @@ ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv) #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYKEY /* Symbol virStorageVolLookupByKey not found at compile time. */ not_supported ("virStorageVolLookupByKey"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolLookupByKey * is in runtime version of libvirt. @@ -2471,7 +2595,7 @@ ocaml_libvirt_storage_vol_lookup_by_key (value connv, value strv) } /* Automatically generated binding for virStorageVolLookupByPath. - * Function signature in generator.pl is "conn, string : vol" + * In generator.pl this function has signature "conn, string : vol". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2487,8 +2611,7 @@ ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv) #ifndef HAVE_VIRSTORAGEVOLLOOKUPBYPATH /* Symbol virStorageVolLookupByPath not found at compile time. */ not_supported ("virStorageVolLookupByPath"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolLookupByPath * is in runtime version of libvirt. @@ -2509,13 +2632,53 @@ ocaml_libvirt_storage_vol_lookup_by_path (value connv, value strv) #endif } +/* Automatically generated binding for virStorageVolCreateXML. + * In generator.pl this function has signature "pool, string, 0U : vol from pool". + */ + +#ifdef HAVE_WEAK_SYMBOLS +#ifdef HAVE_VIRSTORAGEVOLCREATEXML +extern virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, const char *str, unsigned 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"); + CAMLnoreturn; +#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. - * Function signature in generator.pl is "vol, 0 : string" + * In generator.pl this function has signature "vol, 0U : string". */ #ifdef HAVE_WEAK_SYMBOLS #ifdef HAVE_VIRSTORAGEVOLGETXMLDESC -extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, int flags) __attribute__((weak)); +extern char *virStorageVolGetXMLDesc (virStorageVolPtr vol, unsigned int flags) __attribute__((weak)); #endif #endif @@ -2526,8 +2689,7 @@ ocaml_libvirt_storage_vol_get_xml_desc (value volv) #ifndef HAVE_VIRSTORAGEVOLGETXMLDESC /* Symbol virStorageVolGetXMLDesc not found at compile time. */ not_supported ("virStorageVolGetXMLDesc"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolGetXMLDesc * is in runtime version of libvirt. @@ -2549,7 +2711,7 @@ ocaml_libvirt_storage_vol_get_xml_desc (value volv) } /* Automatically generated binding for virStorageVolGetPath. - * Function signature in generator.pl is "vol : string" + * In generator.pl this function has signature "vol : string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2565,8 +2727,7 @@ ocaml_libvirt_storage_vol_get_path (value volv) #ifndef HAVE_VIRSTORAGEVOLGETPATH /* Symbol virStorageVolGetPath not found at compile time. */ not_supported ("virStorageVolGetPath"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolGetPath * is in runtime version of libvirt. @@ -2588,7 +2749,7 @@ ocaml_libvirt_storage_vol_get_path (value volv) } /* Automatically generated binding for virStorageVolGetKey. - * Function signature in generator.pl is "vol : static string" + * In generator.pl this function has signature "vol : static string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2604,8 +2765,7 @@ ocaml_libvirt_storage_vol_get_key (value volv) #ifndef HAVE_VIRSTORAGEVOLGETKEY /* Symbol virStorageVolGetKey not found at compile time. */ not_supported ("virStorageVolGetKey"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolGetKey * is in runtime version of libvirt. @@ -2626,7 +2786,7 @@ ocaml_libvirt_storage_vol_get_key (value volv) } /* Automatically generated binding for virStorageVolGetName. - * Function signature in generator.pl is "vol : static string" + * In generator.pl this function has signature "vol : static string". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2642,8 +2802,7 @@ ocaml_libvirt_storage_vol_get_name (value volv) #ifndef HAVE_VIRSTORAGEVOLGETNAME /* Symbol virStorageVolGetName not found at compile time. */ not_supported ("virStorageVolGetName"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStorageVolGetName * is in runtime version of libvirt. @@ -2664,7 +2823,7 @@ ocaml_libvirt_storage_vol_get_name (value volv) } /* Automatically generated binding for virStoragePoolLookupByVolume. - * Function signature in generator.pl is "vol : pool from vol" + * In generator.pl this function has signature "vol : pool from vol". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2680,8 +2839,7 @@ ocaml_libvirt_storage_pool_lookup_by_volume (value volv) #ifndef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME /* Symbol virStoragePoolLookupByVolume not found at compile time. */ not_supported ("virStoragePoolLookupByVolume"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virStoragePoolLookupByVolume * is in runtime version of libvirt. @@ -2704,7 +2862,7 @@ ocaml_libvirt_storage_pool_lookup_by_volume (value volv) } /* Automatically generated binding for virJobFree. - * Function signature in generator.pl is "job : free" + * In generator.pl this function has signature "job : free". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2720,8 +2878,7 @@ ocaml_libvirt_job_free (value jobv) #ifndef HAVE_VIRJOBFREE /* Symbol virJobFree not found at compile time. */ not_supported ("virJobFree"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virJobFree * is in runtime version of libvirt. @@ -2743,7 +2900,7 @@ ocaml_libvirt_job_free (value jobv) } /* Automatically generated binding for virJobCancel. - * Function signature in generator.pl is "job : unit" + * In generator.pl this function has signature "job : unit". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2759,8 +2916,7 @@ ocaml_libvirt_job_cancel (value jobv) #ifndef HAVE_VIRJOBCANCEL /* Symbol virJobCancel not found at compile time. */ not_supported ("virJobCancel"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virJobCancel * is in runtime version of libvirt. @@ -2779,7 +2935,7 @@ ocaml_libvirt_job_cancel (value jobv) } /* Automatically generated binding for virJobGetNetwork. - * Function signature in generator.pl is "job : net from job" + * In generator.pl this function has signature "job : net from job". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2795,8 +2951,7 @@ ocaml_libvirt_job_get_network (value jobv) #ifndef HAVE_VIRJOBGETNETWORK /* Symbol virJobGetNetwork not found at compile time. */ not_supported ("virJobGetNetwork"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virJobGetNetwork * is in runtime version of libvirt. @@ -2819,7 +2974,7 @@ ocaml_libvirt_job_get_network (value jobv) } /* Automatically generated binding for virJobGetDomain. - * Function signature in generator.pl is "job : dom from job" + * In generator.pl this function has signature "job : dom from job". */ #ifdef HAVE_WEAK_SYMBOLS @@ -2835,8 +2990,7 @@ ocaml_libvirt_job_get_domain (value jobv) #ifndef HAVE_VIRJOBGETDOMAIN /* Symbol virJobGetDomain not found at compile time. */ not_supported ("virJobGetDomain"); - /* Suppresses a compiler warning. */ - (void) caml__frame; + CAMLnoreturn; #else /* Check that the symbol virJobGetDomain * is in runtime version of libvirt. @@ -2858,22 +3012,6 @@ ocaml_libvirt_job_get_domain (value jobv) #endif } -/* The following functions are unimplemented and always fail. - * See generator.pl '@unimplemented' - */ - -CAMLprim value -ocaml_libvirt_storage_vol_lookup_by_name () -{ - failwith ("ocaml_libvirt_storage_vol_lookup_by_name is unimplemented"); -} - -CAMLprim value -ocaml_libvirt_storage_vol_create_xml () -{ - failwith ("ocaml_libvirt_storage_vol_create_xml is unimplemented"); -} - #include "libvirt_c_epilogue.c" /* EOF */