[lxc-devel] Linux kernel with namespace patch -compilation problem

Daniel Lezcano daniel.lezcano at free.fr
Sun Mar 6 21:25:37 UTC 2011


On 03/05/2011 07:15 AM, Maheswara Reddy C - ERS, HCL Tech wrote:
> Hi,
>
> I am successfully upgraded the linux kernel 2.6.34.1 with namespace enable.
> I have add few socket options in setsockopt() fun in net/core/sock.c  and code is put under
>
> Ifdef  NAMESPACE_PATCH
>
>    ///modified code
>
> #endif
>
>   Where to define the NAMESPACE_PATCH ?
>
> I have seen in makefile and some other .h , but not clear, could someone help me out.

You should add a section where you enable your code in the proper 
Kconfig file (eg. net/Kconfig)

config NSPATCH
     ...
     ...
     ...


In net/core/sock.c use:

#if CONFIG_NSPATCH

#endif

By the way, patches with ifdef in the .c files are not accepted in 
mainline. You should create in the corresponding header file:

#ifdef CONFIG_NSPATCH
int nspatch_function(int dummy);
#else
static inline int nspatch_function(int dummy)
{
     return 0;
}
#endif

Please refer to the CodingStyle file in the Documentation directory for 
more informations.

Thanks
   -- Daniel




More information about the lxc-devel mailing list