Skip to contentSkip to conversation

add image offset to ckpt_err output

PATCH New Serge Hallyn 1 participant 3 messages Nov 16, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 add image offset to ckpt_err output

From: Serge E. Hallyn <serue-r/[email protected]>

---
 checkpoint/sys.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
checkpoint/sys.c +2 -0
index c1c4e99..d64f5a7 100644
@@ -471,6 +471,8 @@ static void _ckpt_msg_appendv(struct ckpt_ctx *ctx, int err, char *fmt,
 			goto full;
 	}
 
+	len += snprintf(&ctx->msg[len], CKPT_MSG_LEN-len, "[offset %lld]",
+			ctx->total);
 	len += vsnprintf(&ctx->msg[len], CKPT_MSG_LEN-len, fmt, ap);
 	if (len > CKPT_MSG_LEN) {
 full:
Signature · 1 line
1.6.1

A message that is not in the archive (sent off-list or not yet received): 1258405231-13784-1-git-send-email-serge-r/[email protected]

#2 lore raw

PATCH 2/3 use ckpt_err in ckpt_obj_fetch()

From: Serge E. Hallyn <serue-r/[email protected]>

---
 checkpoint/objhash.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
checkpoint/objhash.c +8 -2
index 9b1b2f4..1f7ce0e 100644
@@ -1004,8 +1004,14 @@ void *ckpt_obj_fetch(struct ckpt_ctx *ctx, int objref, enum obj_type type)
 	struct ckpt_obj *obj;
 
 	obj = obj_find_by_objref(ctx, objref);
-	if (!obj)
+	if (!obj) {
+		ckpt_err(ctx, -EINVAL, "%(O)No such object\n", objref);
 		return ERR_PTR(-EINVAL);
+	}
 	ckpt_debug("%s ref %d\n", obj->ops->obj_name, obj->objref);
-	return (obj->ops->obj_type == type ? obj->ptr : ERR_PTR(-ENOMSG));
+	if (obj->ops->obj_type == type)
+		return obj->ptr;
+	ckpt_err(ctx, -ENOMSG, "%(O)Hashed objed was type %d, not %d\n",
+		 objref, obj->ops->obj_type, type);
+	return ERR_PTR(-ENOMSG);
 }
Signature · 1 line
1.6.1
#3 lore raw

PATCH 3/3 use ckpt_err in ckpt_read_obj_type()

In reply to a message not in the archive

From: Serge E. Hallyn <serue-r/[email protected]>

---
 checkpoint/restart.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
checkpoint/restart.c +6 -1
index 4af4647..b684d7a 100644
@@ -416,11 +416,16 @@ void *ckpt_read_obj_type(struct ckpt_ctx *ctx, int len, int type)
 	BUG_ON(!len);
 
 	h = ckpt_read_obj(ctx, len, len);
-	if (IS_ERR(h))
+	if (IS_ERR(h)) {
+		ckpt_err(ctx, PTR_ERR(h), "Looking for type %d in ckptfile\n",
+			 type);
 		return h;
+	}
 
 	if (h->type != type) {
 		ckpt_hdr_put(ctx, h);
+		ckpt_err(ctx, -EINVAL, "Next object was type %d, not %d\n",
+			h->type, type);
 		h = ERR_PTR(-EINVAL);
 	}
 
Signature · 1 line
1.6.1