X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=libvirt%2Flibvirt_c_epilogue.c;h=4972e50118eee09b3baf34550b451a8a6513d8fd;hb=68fae1ec3de46fd9eec88fb7c1894ea7ed85ccc9;hp=efabed052ae42c2e405d5a865868704b81b4affb;hpb=6de624657b83a1792cf21393cb71f61a446a9c52;p=ocaml-libvirt.git diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c index efabed0..4972e50 100644 --- a/libvirt/libvirt_c_epilogue.c +++ b/libvirt/libvirt_c_epilogue.c @@ -57,14 +57,14 @@ option_default (value option, value deflt) #endif static void -_raise_virterror (virConnectPtr conn, const char *fn) +_raise_virterror (const char *fn) { CAMLparam0 (); CAMLlocal1 (rv); virErrorPtr errp; struct _virError err; - errp = conn ? virConnGetLastError (conn) : virGetLastError (); + errp = virGetLastError (); if (!errp) { /* Fake a _virError structure. */ @@ -193,15 +193,8 @@ Val_virterror (virErrorPtr err) static void conn_finalize (value); static void dom_finalize (value); static void net_finalize (value); -#ifdef HAVE_VIRSTORAGEPOOLPTR static void pol_finalize (value); -#endif -#ifdef HAVE_VIRSTORAGEVOLPTR static void vol_finalize (value); -#endif -#ifdef HAVE_VIRJOBPTR -static void jb_finalize (value); -#endif static struct custom_operations conn_custom_operations = { "conn_custom_operations", @@ -231,7 +224,6 @@ static struct custom_operations net_custom_operations = { custom_deserialize_default }; -#ifdef HAVE_VIRSTORAGEPOOLPTR static struct custom_operations pol_custom_operations = { "pol_custom_operations", pol_finalize, @@ -240,9 +232,7 @@ static struct custom_operations pol_custom_operations = { custom_serialize_default, custom_deserialize_default }; -#endif -#ifdef HAVE_VIRSTORAGEVOLPTR static struct custom_operations vol_custom_operations = { "vol_custom_operations", vol_finalize, @@ -251,18 +241,6 @@ static struct custom_operations vol_custom_operations = { custom_serialize_default, custom_deserialize_default }; -#endif - -#ifdef HAVE_VIRJOBPTR -static struct custom_operations jb_custom_operations = { - "jb_custom_operations", - jb_finalize, - custom_compare_default, - custom_hash_default, - custom_serialize_default, - custom_deserialize_default -}; -#endif static value Val_connect (virConnectPtr conn) @@ -297,7 +275,6 @@ Val_net (virNetworkPtr net) CAMLreturn (rv); } -#ifdef HAVE_VIRSTORAGEPOOLPTR static value Val_pol (virStoragePoolPtr pol) { @@ -308,9 +285,7 @@ Val_pol (virStoragePoolPtr pol) Pol_val (rv) = pol; CAMLreturn (rv); } -#endif -#ifdef HAVE_VIRSTORAGEVOLPTR static value Val_vol (virStorageVolPtr vol) { @@ -321,20 +296,6 @@ Val_vol (virStorageVolPtr vol) Vol_val (rv) = vol; CAMLreturn (rv); } -#endif - -#ifdef HAVE_VIRJOBPTR -static value -Val_jb (virJobPtr jb) -{ - CAMLparam0 (); - CAMLlocal1 (rv); - rv = caml_alloc_custom (&jb_custom_operations, - sizeof (virJobPtr), 0, 1); - Jb_val (rv) = jb; - CAMLreturn (rv); -} -#endif /* This wraps up the (dom, conn) pair (Domain.t). */ static value @@ -364,7 +325,6 @@ Val_network (virNetworkPtr net, value connv) CAMLreturn (rv); } -#ifdef HAVE_VIRSTORAGEPOOLPTR /* This wraps up the (pol, conn) pair (Pool.t). */ static value Val_pool (virStoragePoolPtr pol, value connv) @@ -378,9 +338,7 @@ Val_pool (virStoragePoolPtr pol, value connv) Store_field (rv, 1, connv); CAMLreturn (rv); } -#endif -#ifdef HAVE_VIRSTORAGEVOLPTR /* This wraps up the (vol, conn) pair (Volume.t). */ static value Val_volume (virStorageVolPtr vol, value connv) @@ -394,23 +352,6 @@ Val_volume (virStorageVolPtr vol, value connv) Store_field (rv, 1, connv); CAMLreturn (rv); } -#endif - -#ifdef HAVE_VIRJOBPTR -/* This wraps up the (jb, conn) pair (Job.t). */ -static value -Val_job (virJobPtr jb, value connv) -{ - CAMLparam1 (connv); - CAMLlocal2 (rv, v); - - rv = caml_alloc_tuple (2); - v = Val_jb (jb); - Store_field (rv, 0, v); - Store_field (rv, 1, connv); - CAMLreturn (rv); -} -#endif static void conn_finalize (value connv) @@ -433,29 +374,16 @@ net_finalize (value netv) if (net) (void) virNetworkFree (net); } -#ifdef HAVE_VIRSTORAGEPOOLPTR static void pol_finalize (value polv) { virStoragePoolPtr pol = Pol_val (polv); if (pol) (void) virStoragePoolFree (pol); } -#endif -#ifdef HAVE_VIRSTORAGEVOLPTR static void vol_finalize (value volv) { virStorageVolPtr vol = Vol_val (volv); if (vol) (void) virStorageVolFree (vol); } -#endif - -#ifdef HAVE_VIRJOBPTR -static void -jb_finalize (value jbv) -{ - virJobPtr jb = Jb_val (jbv); - if (jb) (void) virJobFree (jb); -} -#endif