-/*
- * context create
- */
-static PyObject *
-vserver_chcontext(PyObject *self, PyObject *args)
-{
- int ctx_is_new;
- xid_t ctx;
- uint_least64_t bcaps = 0;
-
- if (!PyArg_ParseTuple(args, "I|K", &ctx, &bcaps))
- return NULL;
- bcaps |= ~PL_INSECURE_BCAPS;
-
- if ((ctx_is_new = pl_chcontext(ctx, bcaps, 0)) < 0)
- return PyErr_SetFromErrno(PyExc_OSError);
-
- return PyBool_FromLong(ctx_is_new);
-}
-
-static PyObject *
-vserver_setup_done(PyObject *self, PyObject *args)
-{
- xid_t ctx;
-
- if (!PyArg_ParseTuple(args, "I", &ctx))
- return NULL;
-
- if (pl_setup_done(ctx) < 0)
- return PyErr_SetFromErrno(PyExc_OSError);
-
- return NONE;
-}
-
-static PyObject *
-vserver_isrunning(PyObject *self, PyObject *args)
-{
- xid_t ctx;
- PyObject *ret;
- struct stat statbuf;
- char fname[64];
-
- if (!PyArg_ParseTuple(args, "I", &ctx))
- return NULL;
-
- sprintf(fname,"/proc/virtual/%d", ctx);
-
- if(stat(&fname[0],&statbuf)==0)
- ret = PyBool_FromLong(1);
- else
- ret = PyBool_FromLong(0);
-
- return ret;
-}