From: Serge E. Hallyn <[email protected]>

Signed-off-by: Serge E. Hallyn <[email protected]>
---
 checkpoint/objhash.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
index 9b1b2f4..1f7ce0e 100644
--- a/checkpoint/objhash.c
+++ b/checkpoint/objhash.c
@@ -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);
 }
-- 
1.6.1

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to