[Devel] [VZ10 01/21] ve/net: Have net->owner_ve when !CONFIG_VE

Vasileios Almpanis vasileios.almpanis at virtuozzo.com
Fri May 15 13:16:47 MSK 2026


On 5/7/26 9:10 PM, Vladimir Riabchun wrote:
> There is a big number of net->owner_ve, that are not covered by
> ifdef guard, so it is actually easier to have this field
> when !CONFIG_VE and store NULL there.
>
> Also, fix unused variable in copy_net_ns while there.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-130116
>
> Feature: !CONFIG_VE build
> Signed-off-by: Vladimir Riabchun<vladimir.riabchun at virtuozzo.com>
> ---
>   include/net/net_namespace.h | 2 --
>   net/core/net_namespace.c    | 4 ++--
>   2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index ed077747f710..11cad056f176 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -120,9 +120,7 @@ struct net {
>   
>   	struct net_device       *loopback_dev;          /* The loopback */
>   
> -#ifdef CONFIG_VE
>   	struct ve_struct	*owner_ve;
> -#endif
>   
>   	/* core fib_rules */
>   	struct list_head	rules_ops;
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index 40e74d956bc2..bab48f8759f7 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -352,9 +352,7 @@ static __net_init int setup_net(struct net *net)
>   	LIST_HEAD(dev_kill_list);
>   	int error = 0;
>   
You need to rebase your changes for this patch because [PATCH VZ10 0/8] 
ve: fix owner_ve of net/mnt namespaces created together with 
CLONE_NEWVE has moved these assignments. Now it doesn't apply.
> -#ifdef CONFIG_VE
>   	net->owner_ve = get_ve(get_exec_env());
> -#endif
>   
>   	preempt_disable();
>   	net->net_cookie = gen_cookie_next(&net_cookie);
> @@ -507,7 +505,9 @@ static void inc_netns_avail(struct ve_struct *ve)
>   struct net *copy_net_ns(unsigned long flags,
>   			struct user_namespace *user_ns, struct net *old_net)
>   {
> +#ifdef CONFIG_VE
>   	struct ve_struct *ve = get_exec_env();
> +#endif
>   	struct ucounts *ucounts;
>   	struct net *net;
>   	int rv;

-- 
Best regards, Vasileios Almpanis
Software Developer, Virtuozzo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/devel/attachments/20260515/a14e26e2/attachment.html>


More information about the Devel mailing list