mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
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: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
17a1548a5b
commit
e0be540401
@@ -221,12 +221,6 @@ struct rst_info {
|
|||||||
struct list_head tty_slaves;
|
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)
|
static inline int in_vma_area(struct vma_area *vma, unsigned long addr)
|
||||||
{
|
{
|
||||||
return addr >= (unsigned long)vma->vma.start &&
|
return addr >= (unsigned long)vma->vma.start &&
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#define __CR_NS_H__
|
#define __CR_NS_H__
|
||||||
|
|
||||||
#include "crtools.h"
|
#include "crtools.h"
|
||||||
|
#include "pstree.h"
|
||||||
|
|
||||||
int dump_namespaces(struct pid *pid, unsigned int ns_flags);
|
int dump_namespaces(struct pid *pid, unsigned int ns_flags);
|
||||||
int prepare_namespace(int pid, unsigned long clone_flags);
|
int prepare_namespace(int pid, unsigned long clone_flags);
|
||||||
|
@@ -3,6 +3,22 @@
|
|||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "crtools.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 {
|
||||||
struct pstree_item *parent;
|
struct pstree_item *parent;
|
||||||
struct list_head children; /* list of my children */
|
struct list_head children; /* list of my children */
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include "parasite.h"
|
#include "parasite.h"
|
||||||
#include "crtools.h"
|
#include "crtools.h"
|
||||||
#include "namespaces.h"
|
#include "namespaces.h"
|
||||||
|
#include "pstree.h"
|
||||||
|
|
||||||
#include "protobuf.h"
|
#include "protobuf.h"
|
||||||
#include "protobuf/sa.pb-c.h"
|
#include "protobuf/sa.pb-c.h"
|
||||||
|
Reference in New Issue
Block a user