just try to make older util-vserver-pl compile.
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Tue, 31 Aug 2010 16:39:11 +0000 (18:39 +0200)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Tue, 31 Aug 2010 16:39:11 +0000 (18:39 +0200)
src/planetlab.c

index 73ccfc3..efbb306 100644 (file)
@@ -99,10 +99,17 @@ tag:
   if (vc_ctx_create(ctx, 0) == VC_NOCTX)
     return -1;
 
-    if (unshare_flags != 0) {
+  if (unshare_flags != 0) {
       unshare(unshare_flags);
       unshare_flags |= vc_get_space_mask();
+#ifdef VC_VXC_NAMESPACE
+      /* this is a hack to make util-vserver-pl compile with
+         util-vserver-0.30.216, which changes the signature for
+         vc_{set,enter}_namespace functions. */
+      vc_set_namespace(ctx, unshare_flags, NULL);
+#else
       vc_set_namespace(ctx, unshare_flags);
+#endif
   }
 
   /* Set capabilities - these don't take effect until SETUP flag is unset */
@@ -199,7 +206,14 @@ pl_chcontext(xid_t ctx, uint64_t bcaps, const struct sliver_resources *slr)
       unshare_flags = get_space_flag(ctx);
       if (unshare_flags != 0) {
           unshare_flags |=vc_get_space_mask();
+#ifdef VC_VXC_NAMESPACE
+          /* this is a hack to make util-vserver-pl compile with
+             util-vserver-0.30.216, which changes the signature for
+             vc_{set,enter}_namespace functions. */
+          vc_enter_namespace(ctx, unshare_flags, NULL);
+#else
           vc_enter_namespace(ctx, unshare_flags);
+#endif
       }
 
          if (!vc_tag_migrate(ctx) && !vc_ctx_migrate(ctx, 0))