[Devel] [PATCH 2/6] use ckpt_err in ckpt_obj_fetch()
serue at us.ibm.com
serue at us.ibm.com
Tue Nov 17 17:53:29 PST 2009
From: Serge E. Hallyn <serue at us.ibm.com>
Changelog:
Nov 17: print requested obj type
Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
---
checkpoint/objhash.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
index 9b1b2f4..2e50025 100644
--- a/checkpoint/objhash.c
+++ b/checkpoint/objhash.c
@@ -1004,8 +1004,15 @@ 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 (type %d)\n",
+ objref, type);
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);
}
--
1.6.1
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list