[CRIU] [PATCH] unix: Test the --external instead of --ext-unix-sk

Pavel Emelyanov xemul at virtuozzo.com
Thu Oct 6 03:06:45 PDT 2016


The latter option should hide, the official API is the --external.
This patch tests the option, thus completing the deprecation.

The legacy -x|--ext-unix-sk test is still in zdtm/static/socket-ext.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>

---

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index f9f529b..39cc6c0 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -695,16 +695,17 @@ static int dump_external_sockets(struct unix_sk_desc *peer)
 
 		ret = run_plugins(DUMP_UNIX_SK, sk->fd, sk->sd.ino);
 		if (ret == -ENOTSUP) {
-			if (!opts.ext_unix_sk) {
-				show_one_unix("Runaway socket", peer);
-				pr_err("External socket is used. "
-						"Consider using --" USK_EXT_PARAM " option.\n");
-				return -1;
-			}
-
 			if (unix_sk_exception_lookup_id(sk->sd.ino)) {
 				pr_debug("found exception for unix name-less external socket.\n");
 			} else {
+				/* Legacy -x|--ext-unix-sk option handling */
+				if (!opts.ext_unix_sk) {
+					show_one_unix("Runaway socket", peer);
+					pr_err("External socket is used. "
+							"Consider using --" USK_EXT_PARAM " option.\n");
+					return -1;
+				}
+
 				if (peer->type != SOCK_DGRAM) {
 					show_one_unix("Ext stream not supported", peer);
 					pr_err("Can't dump half of stream unix connection.\n");
diff --git a/test/inhfd/socket.py b/test/inhfd/socket.py
index 9b88da0..0ac4790 100755
--- a/test/inhfd/socket.py
+++ b/test/inhfd/socket.py
@@ -12,4 +12,4 @@ def filename(sockf):
 	return 'socket:[%d]' % __sock_ino(sockf)
 
 def dump_opts(sockf):
-	return ['--ext-unix-sk=%d' % __sock_ino(sockf)]
+	return ['--external', 'unix[%d]' % __sock_ino(sockf)]


More information about the CRIU mailing list