Commit 8e90a9e6 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

crtools: Tossing CR_FD_ bits around

Split the CR_FD_ bits into per-task and global ones and replace
of CR_FD_DESC_NOPSTREE with CR_FD_DESC_TASK, which is explicit
set of per-task bits.

The CR_FD_DESC_NS will appear soon.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 993f07ba
......@@ -1170,7 +1170,7 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
goto err;
};
cr_fdset = cr_fdset_open(item->pid, CR_FD_DESC_NOPSTREE, cr_fdset);
cr_fdset = cr_fdset_open(item->pid, CR_FD_DESC_TASK, cr_fdset);
if (!cr_fdset)
goto err;
......
......@@ -492,7 +492,7 @@ static int cr_show_all(unsigned long pid, struct cr_options *opts)
LIST_HEAD(pstree_list);
int i, ret = -1;
cr_fdset = prep_cr_fdset_for_restore(pid, CR_FD_DESC_USE(CR_FD_PSTREE));
cr_fdset = prep_cr_fdset_for_restore(pid, CR_FD_DESC_PSTREE);
if (!cr_fdset)
goto out;
......@@ -504,7 +504,7 @@ static int cr_show_all(unsigned long pid, struct cr_options *opts)
list_for_each_entry(item, &pstree_list, list) {
cr_fdset = prep_cr_fdset_for_restore(item->pid, CR_FD_DESC_NOPSTREE);
cr_fdset = prep_cr_fdset_for_restore(item->pid, CR_FD_DESC_TASK);
if (!cr_fdset)
goto out;
......
......@@ -15,18 +15,27 @@ extern void free_pstree(struct list_head *pstree_list);
#define CR_FD_PERM_DUMP (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
enum {
/*
* Task entries
*/
CR_FD_FDINFO,
CR_FD_PAGES,
CR_FD_PAGES_SHMEM,
CR_FD_CORE,
CR_FD_PIPES,
CR_FD_PSTREE,
CR_FD_SHMEM,
CR_FD_SIGACT,
CR_FD_UNIXSK,
CR_FD_INETSK,
CR_FD_ITIMERS,
/*
* Global entries
*/
CR_FD_PSTREE,
CR_FD_MAX
};
......@@ -80,9 +89,19 @@ struct cr_fdset {
};
#define CR_FD_DESC_USE(type) ((1 << (type)))
#define CR_FD_DESC_ALL (CR_FD_DESC_USE(CR_FD_MAX) - 1)
#define CR_FD_DESC_CORE CR_FD_DESC_USE(CR_FD_CORE)
#define CR_FD_DESC_NOPSTREE (CR_FD_DESC_ALL & ~(CR_FD_DESC_USE(CR_FD_PSTREE)))
#define CR_FD_DESC_PSTREE CR_FD_DESC_USE(CR_FD_PSTREE)
#define CR_FD_DESC_TASK (\
CR_FD_DESC_USE(CR_FD_FDINFO) |\
CR_FD_DESC_USE(CR_FD_PAGES) |\
CR_FD_DESC_USE(CR_FD_PAGES_SHMEM) |\
CR_FD_DESC_USE(CR_FD_CORE) |\
CR_FD_DESC_USE(CR_FD_PIPES) |\
CR_FD_DESC_USE(CR_FD_SHMEM) |\
CR_FD_DESC_USE(CR_FD_SIGACT) |\
CR_FD_DESC_USE(CR_FD_UNIXSK) |\
CR_FD_DESC_USE(CR_FD_INETSK) |\
CR_FD_DESC_USE(CR_FD_ITIMERS) )
#define CR_FD_DESC_NONE (0)
int cr_dump_tasks(pid_t pid, struct cr_options *opts);
......
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