Commit 9a6bc0fd authored by Pavel Emelyanov's avatar Pavel Emelyanov

unix: Add comments about icons and external sockets

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b4c09afd
...@@ -17,6 +17,19 @@ ...@@ -17,6 +17,19 @@
*/ */
#define REMAP_GHOST (1 << 31) #define REMAP_GHOST (1 << 31)
/*
* By-default, when dumping a unix socket, we should dump its peer
* as well. Which in turn means, we should dump the task(s) that have
* this peer opened.
*
* Sometimes, we can break this rule and dump only one end of the
* unix sockets pair, and on restore time connect() this end back to
* its peer.
*
* So, to resolve this situation we mark the peers we don't dump
* as "external" and require the --ext-unix-sk option.
*/
#define USK_EXTERN (1 << 0) #define USK_EXTERN (1 << 0)
#define VMA_AREA_NONE (0 << 0) #define VMA_AREA_NONE (0 << 0)
......
...@@ -242,6 +242,12 @@ dump: ...@@ -242,6 +242,12 @@ dump:
if (pb_write_one(fdset_fd(glob_fdset, CR_FD_UNIXSK), &ue, PB_UNIX_SK)) if (pb_write_one(fdset_fd(glob_fdset, CR_FD_UNIXSK), &ue, PB_UNIX_SK))
goto err; goto err;
/*
* If a stream listening socket has non-zero rqueue, this
* means there are in-flight connections waiting to get
* accept()-ed. We handle them separately with the "icons"
* (i stands for in-flight, cons -- for connections) things.
*/
if (sk->rqlen != 0 && !(sk->type == SOCK_STREAM && if (sk->rqlen != 0 && !(sk->type == SOCK_STREAM &&
sk->state == TCP_LISTEN)) sk->state == TCP_LISTEN))
if (dump_sk_queue(lfd, ue.id)) if (dump_sk_queue(lfd, ue.id))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment