[CRIU] [PATCH 3/5] unix: add ability to set callbacks for external sockets (v2)
Pavel Emelyanov
xemul at parallels.com
Thu Dec 5 10:29:36 PST 2013
> @@ -469,6 +471,30 @@ int unix_receive_one(struct nlmsghdr *h, void *arg)
> return unix_collect_one(m, tb);
> }
>
> +static int try_to_dump_with_callback(struct unix_sk_desc *peer, bool *need_callback)
> +{
> + struct unix_sk_desc *sk;
> + int ret = -1;
> +
> + *need_callback = false;
> + list_for_each_entry(sk, &peer->peer_list, peer_node) {
> + ret = cr_plugin_dump_unix_sk(sk->fd, sk->sd.ino, sk->peer_ino);
> + if (ret == CRIU_CB_SKIP) {
> + if (!*need_callback)
> + return 0;
If the very first library says "don't know this socket" we get out of this fn? Why?
> +
> + pr_err("The callback is not suitable for all peer sockets\n");
> + return -1;
> + }
> + if (ret < 0)
> + return -1;
> +
> + *need_callback = true;
> + }
> +
> + return ret;
> +}
> +
More information about the CRIU
mailing list