libxc: rump kernels: Use standard xc_osdep_get_info
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 28 May 2014 16:06:21 +0000 (17:06 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 14 Jul 2014 15:07:50 +0000 (16:07 +0100)
Do not try to support the dlopen-based xc indirection.

Introduce a local #define DO_DYNAMIC_OSDEP to centralise the condition.

Add comments to the #endifs.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
v2: Remove duplication by introducing DO_DYNAMIC_OSDEP.
    Add comments to the #endifs.

tools/libxc/xc_private.c

index a3da6141816e2635113ed0a050d102fe56d76e72..1c214ddc8f22feba458fd7e54211bbdb711cb700 100644 (file)
 
 #define XENCTRL_OSDEP "XENCTRL_OSDEP"
 
+#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__)
+#define DO_DYNAMIC_OSDEP
+#endif
+
 /*
  * Returns a (shallow) copy of the xc_osdep_info_t for the
  * active OS interface.
@@ -50,7 +54,7 @@
 static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
 {
     int rc = -1;
-#ifndef __MINIOS__
+#ifdef DO_DYNAMIC_OSDEP
     const char *lib = getenv(XENCTRL_OSDEP);
     xc_osdep_info_t *pinfo;
     void *dl_handle = NULL;
@@ -86,7 +90,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
         info->dl_handle = dl_handle;
     }
     else
-#endif
+#endif /*DO_DYNAMIC_OSDEP*/
     {
         *info = xc_osdep_info;
         info->dl_handle = NULL;
@@ -94,21 +98,21 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
 
     rc = 0;
 
-#ifndef __MINIOS__
+#ifdef DO_DYNAMIC_OSDEP
 out:
     if ( dl_handle && rc == -1 )
         dlclose(dl_handle);
-#endif
+#endif /*DO_DYNAMIC_OSDEP*/
 
     return rc;
 }
 
 static void xc_osdep_put(xc_osdep_info_t *info)
 {
-#ifndef __MINIOS__
+#ifdef DO_DYNAMIC_OSDEP
     if ( info->dl_handle )
         dlclose(info->dl_handle);
-#endif
+#endif /*DO_DYNAMIC_OSDEP*/
 }
 
 static const char *xc_osdep_type_name(enum xc_osdep_type type)