Skip to content

Commit

Permalink
lib/c: add empty_ns interfaces to libcriu
Browse files Browse the repository at this point in the history
crun wants to set empty_ns and this interface is missing from the
library. This adds it to libcriu.

Signed-off-by: Adrian Reber <[email protected]>
  • Loading branch information
adrianreber authored and avagin committed May 22, 2023
1 parent 0b49f26 commit fbe2692
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/c/criu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2030,3 +2030,14 @@ int criu_feature_check(struct criu_feature_check *features, size_t size)
{
return criu_local_feature_check(global_opts, features, size);
}

void criu_local_set_empty_ns(criu_opts *opts, int namespaces)
{
opts->rpc->has_empty_ns = true;
opts->rpc->empty_ns = namespaces;
}

void criu_set_empty_ns(int namespaces)
{
criu_local_set_empty_ns(global_opts, namespaces);
}
3 changes: 3 additions & 0 deletions lib/c/criu.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ struct criu_feature_check {
int criu_feature_check(struct criu_feature_check *features, size_t size);
int criu_local_feature_check(criu_opts *opts, struct criu_feature_check *features, size_t size);

void criu_local_set_empty_ns(criu_opts *opts, int namespaces);
void criu_set_empty_ns(int namespaces);

#ifdef __GNUG__
}
#endif
Expand Down

0 comments on commit fbe2692

Please sign in to comment.