[CRIU] [PATCH 2/6] ns: Add parse_ns_proc helper

Pavel Emelyanov xemul at parallels.com
Tue May 14 16:43:10 EDT 2013


On 05/13/2013 07:38 PM, Cyrill Gorcunov wrote:
> 
> This helper will allow us to parse procfs ns entries
> in flexible way.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  include/namespaces.h |  9 +++++++++
>  namespaces.c         | 25 +++++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
> 


> +		if (link[sz] == ':' && !memcmp(link, ns_desc_array[i].str, sz)) {
> +			found->d	= &ns_desc_array[i];
> +			found->i_ino	= strtoul(&link[sz + 2], &end, 10);
> +
> +			if (end && *end == ']')
> +				return 0;
> +			else
> +				return -EINVAL;

The get_ns_id already parses ns links. Plz, merge them together.


More information about the CRIU mailing list