[Devel] Re: [PATCH] user-c/r: get rid of ckpt_hdr_vpids - can be inferred at restart

Serge E. Hallyn serue at us.ibm.com
Tue Mar 30 12:39:36 PDT 2010


Quoting Oren Laadan (orenl at cs.columbia.edu):
> And some cleanup of recent nested-pids work, and re-generate
> user headers.
> 
> Signed-off-by: Oren Laadan <orenl at cs.columbia.edu>

...

> @@ -2721,26 +2716,28 @@ static int assign_vpids(struct ckpt_ctx *ctx)
> 
>  static int ckpt_read_vpids(struct ckpt_ctx *ctx)
>  {
> -	struct ckpt_hdr_vpids *h;
> -	int len, ret;
> +	int i, len, ret;
> 
> -	h = (struct ckpt_hdr_vpids *) ctx->vpids;
> -	ret = ckpt_read_obj_type(ctx, h, sizeof(*h), CKPT_HDR_VPIDS);
> -	if (ret < 0)
> -		return ret;
> +	for (i = 0; i < ctx->tasks_nr; i++)

s/tasks_nr/pids_nr/

With that applied,

Acked-by: Serge Hallyn <serue at us.ibm.com>
Tested-by: Serge Hallyn <serue at us.ibm.com>

Or:

>From 13053aac0bfdd88ea10ffd601bbf43452bf0226e Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serue at us.ibm.com>
Date: Tue, 30 Mar 2010 15:37:47 -0400
Subject: [PATCH user-cr] fix ckpt_read_vpids

tasks_nr is still 0 at this point.

Signed-off-by: Serge Hallyn <serue at us.ibm.com>
---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/restart.c b/restart.c
index e7c874b..b26d79a 100644
--- a/restart.c
+++ b/restart.c
@@ -2373,7 +2373,7 @@ static int ckpt_read_vpids(struct ckpt_ctx *ctx)
 {
 	int i, len, ret;
 
-	for (i = 0; i < ctx->tasks_nr; i++)
+	for (i = 0; i < ctx->pids_nr; i++)
 		ctx->vpids_nr += ctx->pids_arr[i].depth;
 
 	ckpt_dbg("number of vpids: %d\n", ctx->vpids_nr);
-- 
1.7.0

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list