From 322d0b4dbdc5b5621e2deb7e4188a64fce95e5aa Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Mon, 14 Apr 2008 21:12:33 +0000 Subject: [PATCH] Use an unused field. SYSNAME defaults to Linux which probably means this value may change over time. Context is empty and seems safer. --- python/vserverimpl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/vserverimpl.c b/python/vserverimpl.c index 409899e..931357b 100644 --- a/python/vserverimpl.c +++ b/python/vserverimpl.c @@ -678,7 +678,7 @@ vserver_set_name(PyObject *self, PyObject *args) snprintf(buf, sizeof(buf), "%d", slice_id); - if (vc_set_vhi_name(ctx, vcVHI_SYSNAME, buf, sizeof(buf)) != 0) { + if (vc_set_vhi_name(ctx, vcVHI_CONTEXT, buf, sizeof(buf)) != 0) { return PyErr_SetFromErrno(PyExc_OSError); } else { return NONE; @@ -695,7 +695,7 @@ vserver_get_name(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "I", &ctx)) return NULL; - if (vc_get_vhi_name(ctx, vcVHI_SYSNAME, buf, sizeof(buf)) !=0 ) { + if (vc_get_vhi_name(ctx, vcVHI_CONTEXT, buf, sizeof(buf)) !=0 ) { ret = PyErr_SetFromErrno(PyExc_OSError); } else { ret = Py_BuildValue("i", atoi(buf)); @@ -743,9 +743,9 @@ static PyMethodDef methods[] = { { "setrunlevel", vserver_set_runlevel, METH_VARARGS, "Set the runlevel in utmp" }, { "setname", vserver_set_name, METH_VARARGS, - "Set the vcVHI_SYSNAME for a xid." }, + "Set the vcVHI_CONTEXT for a xid." }, { "getname", vserver_get_name, METH_VARARGS, - "Get the vcVHI_SYSNAME for a xid." }, + "Get the vcVHI_CONTEXT for a xid." }, { NULL, NULL, 0, NULL } }; -- 2.43.0