Commit e0be5404 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pstree: Move struct pid to pstree.h

I believe this make sense to keep this structure
in pstree.h where pstree related data lives.

Also I've added some comments on struct pid members.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 17a1548a
......@@ -221,12 +221,6 @@ struct rst_info {
struct list_head tty_slaves;
};
struct pid
{
pid_t real; /* used to peek/poke tasks during dump stage */
pid_t virt; /* used all over in the images and saved after restore */
};
static inline int in_vma_area(struct vma_area *vma, unsigned long addr)
{
return addr >= (unsigned long)vma->vma.start &&
......
......@@ -2,6 +2,7 @@
#define __CR_NS_H__
#include "crtools.h"
#include "pstree.h"
int dump_namespaces(struct pid *pid, unsigned int ns_flags);
int prepare_namespace(int pid, unsigned long clone_flags);
......
......@@ -3,6 +3,22 @@
#include "list.h"
#include "crtools.h"
struct pid {
/*
* The @real pid is used to fetch tasks during dumping stage,
* This is a global pid seen from the context where the dumping
* is running.
*/
pid_t real;
/*
* The @virt pid is one which used in the image itself and keeps
* the pid value to be restored. This pid fetched from the
* dumpee context, because the dumpee might have own pid namespace.
*/
pid_t virt;
};
struct pstree_item {
struct pstree_item *parent;
struct list_head children; /* list of my children */
......
......@@ -12,6 +12,7 @@
#include "parasite.h"
#include "crtools.h"
#include "namespaces.h"
#include "pstree.h"
#include "protobuf.h"
#include "protobuf/sa.pb-c.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment