[CRIU] [PATCH 7/8] rlimits: Move entries from top-core into task-core

Pavel Emelyanov xemul at parallels.com
Tue Apr 15 11:00:11 PDT 2014


This appeared after latest 1.2, so it's still possible
to do this move.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-dump.c           | 2 +-
 cr-restore.c        | 4 ++--
 protobuf/core.proto | 3 +--
 pstree.c            | 3 +--
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 0f4e983..de2f0cb 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -671,7 +671,7 @@ static int dump_task_core_all(struct pstree_item *item,
 	if (ret)
 		goto err;
 
-	ret = dump_task_rlimits(pid, core->rlimits);
+	ret = dump_task_rlimits(pid, core->tc->rlimits);
 	if (ret)
 		goto err;
 
diff --git a/cr-restore.c b/cr-restore.c
index c6fa804..6bd763f 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -2110,8 +2110,8 @@ static int prepare_rlimits(int pid, CoreEntry *core)
 	/*
 	 * New image format: rlimits are bound to the core entry.
 	 */
-	if (core->rlimits) {
-		TaskRlimitsEntry *rls = core->rlimits;
+	if (core->tc->rlimits) {
+		TaskRlimitsEntry *rls = core->tc->rlimits;
 		int i;
 
 		for (i = 0; i < rls->n_rlimits; i++) {
diff --git a/protobuf/core.proto b/protobuf/core.proto
index 18ac8d4..fea7621 100644
--- a/protobuf/core.proto
+++ b/protobuf/core.proto
@@ -16,6 +16,7 @@ message task_core_entry {
 	required string			comm		= 6;
 
 	optional task_timers_entry	timers		= 7;
+	optional task_rlimits_entry	rlimits		= 8;
 }
 
 message task_kobj_ids_entry {
@@ -67,6 +68,4 @@ message core_entry {
 	optional task_core_entry	tc		= 3;
 	optional task_kobj_ids_entry	ids		= 4;
 	optional thread_core_entry	thread_core	= 5;
-
-	optional task_rlimits_entry	rlimits		= 7;
 }
diff --git a/pstree.c b/pstree.c
index bdbcb63..efbd3bc 100644
--- a/pstree.c
+++ b/pstree.c
@@ -65,9 +65,8 @@ CoreEntry *core_entry_alloc(int th, int tsk)
 				TaskTimersEntry *tte;
 				int i;
 
-				rls = xptr_pull(&m, TaskRlimitsEntry);
+				rls = core->tc->rlimits = xptr_pull(&m, TaskRlimitsEntry);
 				task_rlimits_entry__init(rls);
-				core->rlimits = rls;
 
 				rls->n_rlimits = RLIM_NLIMITS;
 				rls->rlimits = xptr_pull_s(&m, sizeof(RlimitEntry *) * RLIM_NLIMITS);
-- 
1.8.4.2


More information about the CRIU mailing list