[CRIU] [PATCH 01/14] namespace: don't fail if a namespace isn't supported by kernel

Pavel Emelyanov xemul at parallels.com
Thu Oct 30 04:30:58 PDT 2014


On 10/15/2014 12:01 AM, Andrew Vagin wrote:
> On Tue, Oct 14, 2014 at 07:18:36PM +0400, Pavel Emelyanov wrote:
>> On 10/14/2014 03:38 PM, Andrey Vagin wrote:
>>> CRIU reads /proc/pid/ns/[NS] and fails of a link is not exist.
>>>
>>> Signed-off-by: Andrey Vagin <avagin at openvz.org>
>>> ---
>>>  namespaces.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/namespaces.c b/namespaces.c
>>> index 1feb165..bd7d86e 100644
>>> --- a/namespaces.c
>>> +++ b/namespaces.c
>>> @@ -230,6 +230,11 @@ static unsigned int __get_ns_id(int pid, struct ns_desc *nd, struct ns_id **ns)
>>>  	sprintf(ns_path, "ns/%s", nd->str);
>>>  	ret = readlinkat(proc_dir, ns_path, ns_id, sizeof(ns_id));
>>>  	if (ret < 0) {
>>> +		if (errno == ENOENT) {
>>> +			/* The namespace is unsupported */
>>> +			kid = 0;
>>
>> Then it should "live" in CRIU's namespace.
> 
> Yes. It lives. This code returns the same kid = 0 for all processes.

OK, applied



More information about the CRIU mailing list