Skip to content

Commit

Permalink
check: add a feature check for external network namespaces
Browse files Browse the repository at this point in the history
This is obviously not a real check. This only exists, so that CRIU
clients/users can check if this CRIU version supports the external
network namespace feature. Theoretically the CRIU client or user could
also parse the version, but especially for CLI users version comparison
in the shell is not easy.

This feature check does not exist for RPC as RPC has a special version
call which does not require string parsing and the external network
namespace feature is available for all CRIU versions newer than 3.9.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  • Loading branch information
adrianreber authored and avagin committed Oct 30, 2018
1 parent 6823900 commit e8a1dfe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions criu/cr-check.c
Expand Up @@ -1250,6 +1250,22 @@ static int check_link_nsid(void)
return 0;
}

static int check_external_net_ns(void)
{
/*
* This is obviously not a real check. This only exists, so that
* CRIU clients/users can check if this CRIU version supports the
* external network namespace feature. Theoretically the CRIU client
* or user could also parse the version, but especially for CLI users
* version comparison in the shell is not easy.
* This feature check does not exist for RPC as RPC has a special
* version call which does not require string parsing and the external
* network namespace feature is available for all CRIU versions newer
* than 3.9.
*/
return 0;
}

struct feature_list {
char *name;
int (*func)();
Expand Down Expand Up @@ -1279,6 +1295,7 @@ static struct feature_list feature_list[] = {
{ "nsid", check_nsid },
{ "link_nsid", check_link_nsid},
{ "kcmp_epoll", check_kcmp_epoll},
{ "external_net_ns", check_external_net_ns},
{ NULL, NULL },
};

Expand Down

0 comments on commit e8a1dfe

Please sign in to comment.