unix: Test the --external instead of --ext-unix-sk

Submitted by Pavel Emelianov on Oct. 6, 2016, 10:06 a.m.

Details

Message ID 57F62235.80500@virtuozzo.com
State Accepted
Series "unix: Test the --external instead of --ext-unix-sk"
Commit 45171b5b3ce6fb4aab80cc0149b4e212bcec0c3a
Headers show

Commit Message

Pavel Emelianov Oct. 6, 2016, 10:06 a.m.
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@virtuozzo.com>

---

Patch hide | download patch | download mbox

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)]