The vz-kernel is not available in all architectures where mainline
Linux can run. If we detect this to be the case, the code won't be
compiled.

Signed-off-by: Glauber Costa <[email protected]>
---
 src/lib/env.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/env.c b/src/lib/env.c
index 488ace0..f4b7238 100644
--- a/src/lib/env.c
+++ b/src/lib/env.c
@@ -85,17 +85,20 @@ vps_handler *vz_open(envid_t veid)
 
        h->stdfd = reset_std();
 
+#ifdef VZ_KERNEL_SUPPORTED
        /* Find out if we are under OpenVZ or upstream kernel */
        if (stat_file("/proc/vz"))
                ret = vz_do_open(h);
-       else {
+       else
+#endif
+       {
                logger(0, 0, "Directory /proc/vz not found, assuming "
                                "non-OpenVZ kernel");
                h->vzfd = -1;
 #ifdef HAVE_UPSTREAM
                ret = ct_do_open(h);
 #else
-               logger(-1, 0, "Support for non-OpenVZ kernel not compiled in");
+               logger(-1, 0, "No suitable kernel support compiled in");
 #endif
        }
 
-- 
1.7.11.7

_______________________________________________
Devel mailing list
[email protected]
http://lists.openvz.org/mailman/listinfo/devel

Reply via email to