[Devel] [PATCH 1/6] Don't try to initialize vz-kernel if it is not available.

Glauber Costa glommer at parallels.com
Mon Nov 26 06:35:29 PST 2012


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 <glommer at parallels.com>
---
 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




More information about the Devel mailing list