[5/5] compel: Add nspid, nssid and nspgid fields to struct seize_task_status

Submitted by Kirill Tkhai on April 15, 2017, 5:16 p.m.

Details

Message ID 149227658081.1524.3661838796338579951.stgit@localhost.localdomain
State New
Series "compel, criu: Make struct seize_task_status extensible"
Headers show

Commit Message

Kirill Tkhai April 15, 2017, 5:16 p.m.
Some users want them, so add these fields to the structure.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 compel/include/uapi/infect.h |    4 ++++
 compel/src/lib/infect.c      |    6 ++++++
 2 files changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/compel/include/uapi/infect.h b/compel/include/uapi/infect.h
index e67952bdb..f02f49333 100644
--- a/compel/include/uapi/infect.h
+++ b/compel/include/uapi/infect.h
@@ -21,6 +21,10 @@  struct seize_task_status {
 	unsigned long long	sigpnd;
 	unsigned long long	shdpnd;
 	int			seccomp_mode;
+	size_t			ns_levels;
+	uint32_t		*nspid;
+	uint32_t		*nspgid;
+	uint32_t		*nssid;
 	/* Add new members to the bottom and do not change existing */
 };
 
diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index 9ade844cf..ab7558a81 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -190,11 +190,17 @@  static int skip_sigstop(int pid, int nr_signals)
 /* Init dynamically allocated fields in NULL and do not touch other */
 static void init_seize_task_status(struct seize_task_status *ss)
 {
+	ss->ns_levels = 0;
+	ss->nspid = ss->nspgid = ss->nssid = NULL;
 }
 
 /* Free dynamically allocated fields in compel_wait_task() and do not touch other */
 void compel_consume_seize_task_status(struct seize_task_status *ss)
 {
+	xfree(ss->nspid);
+	xfree(ss->nspgid);
+	xfree(ss->nssid);
+
 	init_seize_task_status(ss);
 }