Skip to content

user-cr: support for pids as shared objects

Oren Laadan containers 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 9 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 9 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] user-cr: support for pids as shared objects

[Hmm.. here too the cover was lost .. need to investigate]

Hi,

This patchset adds the necessary support in user-cr related to handling of pids as proper shared objets. You must use this if you use the corresponding kernel-cr patchset recetly posted.

Thanks,

Oren.

Quoted 61 lines · Oren Laadan

The initialization belongs to the caller of the cr-library - i.e. restart-main and checkpoint-main, and not in the cr-library.

---
 checkpoint-main.c |    4 ++--
 checkpoint.c      |    8 --------
 restart-main.c    |    4 ++--
 3 files changed, 4 insertions(+), 12 deletions(-)
checkpoint-main.c +2 -2
index a2a7d94..b2ec9c8 100644
@@ -70,8 +70,8 @@ static void parse_args(struct cr_checkpoint_args *args, int argc, char *argv[])
 	char *logfile;
 
 	/* defaults */
-	args->outfd = -1;
-	args->logfd = -1;
+	args->outfd = fileno(stdout);
+	args->logfd = CHECKPOINT_FD_NONE;
 	args->uerrfd = fileno(stderr);
 	output = NULL;
 	logfile = NULL;
checkpoint.c +0 -8
index cce3d9d..f9b0b3b 100644
@@ -37,14 +37,6 @@ int cr_checkpoint(int pid, struct cr_checkpoint_args *args)
 
 	global_uerrfd = args->uerrfd;
 
-	/* output file descriptor (default: stdout) */
-	if (args->outfd < 0)
-		args->outfd = STDOUT_FILENO;
-
-	/* output file descriptor (default: none) */
-	if (args->logfd < 0)
-		args->logfd = CHECKPOINT_FD_NONE;
-
 	if (!args->container)
 		args->flags |= CHECKPOINT_SUBTREE;
 
restart-main.c +2 -2
index 6eed101..efa6a8f 100644
@@ -146,10 +146,10 @@ static void parse_args(struct cr_restart_args *args, int argc, char *argv[])
 	/* defaults */
 	memset(args, 0, sizeof(*args));
 	args->wait = 1;
-	args->infd = -1;
-	args->klogfd = -1;
+	args->infd = fileno(stdin);
 	args->ulogfd = fileno(stdout);
 	args->uerrfd = fileno(stderr);
+	args->klogfd = CHECKPOINT_FD_NONE;
 	args->warn = CKPT_COND_WARN;
 	args->fail = CKPT_COND_FAIL;
 	no_pidns = 0;