[Devel] [PATCH VZ10 3/3] ve_namespace: Allow entering non-running VE namespace

Vladimir Riabchun vladimir.riabchun at virtuozzo.com
Mon Sep 7 22:14:46 MSK 2026


This doesn't bring a lot of value and makes tests more complex.
To enter VE namespace we need to actually start VE.

In vzctl we have locking to prevent parallel creations.
If someone decides to skip locks and start one CT
in parallel - big mistake, but not ours.

https://virtuozzo.atlassian.net/browse/VSTOR-144504

Feature: ve selftests
Signed-off-by: Vladimir Riabchun <vladimir.riabchun at virtuozzo.com>
---
 kernel/ve/ve_namespace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/ve/ve_namespace.c b/kernel/ve/ve_namespace.c
index 3dbe0dde2645..2ddec9ef312f 100644
--- a/kernel/ve/ve_namespace.c
+++ b/kernel/ve/ve_namespace.c
@@ -227,7 +227,9 @@ static int ve_ns_install(struct nsset *nsset, struct ns_common *new)
 		return -EPERM;
 
 	if (!VE_IS_RUNNING(ve_ns->ve))
-		return -EINVAL;
+		pr_warn_once("Switching to a non-running ve %s.\n"
+			"This should happen in kselftests only.\n",
+			ve_name(ve_ns->ve));
 
 	/*
 	 * Don't need to put_ve_ns(nsset->ve_ns) here,

-- 
2.47.1



More information about the Devel mailing list