Use CPULIMIT of 0 to indicate a suspended slice
authorSteve Muir <smuir@cs.princeton.edu>
Sat, 3 Dec 2005 00:23:08 +0000 (00:23 +0000)
committerSteve Muir <smuir@cs.princeton.edu>
Sat, 3 Dec 2005 00:23:08 +0000 (00:23 +0000)
src/vsh.c

index 435ea05..5908b20 100644 (file)
--- a/src/vsh.c
+++ b/src/vsh.c
@@ -294,6 +294,14 @@ static int sandbox_processes(xid_t ctx, char *context)
                 {0,0}};
 
        get_limits(context,list);
+
+       /* check whether the slice has been disabled */
+       if (!cpu)
+         {
+           fprintf(stderr, "*** this slice has been suspended ***\n");
+           exit(0);
+         }
+
        (void) (sandbox_chroot(ctx));
 
         rspec.cpu_share = cpu;