[Users] reliably detect wether hardware_node, openvz_host or
mstanichenko at openvz.org
Wed Jul 30 04:58:20 EDT 2008
the patch was sent but the status of that bug didn't change. I've
attached the patch that you can use. It fixes the problem.
> Parsing the /proc/self/status does not work with 2.6.24-ovz005 kernel.
> In fact the openvz_host still shows the "EnvID: 0" but there is no
> more "EnvID" into the vz instances. I reported it as a bug here:
> http://bugzilla.openvz.org/show_bug.cgi?id=936 but with no more
> informations since.
> I'm using the following code to see if I am in an openvz instance:
> tail -n 1 /proc/vz/veinfo | grep -qs '^[[:space:]]*[1-9]'
> I use it because openvz instances can not acces hardware where openvz
> hosts and pure hardware nodes can.
-------------- next part --------------
Allow envID fields in /proc/self/status in VE. Also allow get VPid,
PNState, StopState, etc.
OpenVZ Bug #936
Signed-off-by: Vitaliy Gusev <vgusev at openvz.org>
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 871badb..25f2d73 100644
@@ -208,16 +208,15 @@ static inline char *task_state(struct task_struct *p, char *buffer)
buffer += sprintf(buffer, "\n");
- if (ve_is_super(get_exec_env()))
- buffer += sprintf(buffer,
+ buffer += sprintf(buffer,
More information about the Users