From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH VZ10 v4 0/3] Improvements for ve selftests
Date: Fri, 25 Sep 2026 14:47:01 +0200 [thread overview]
Message-ID: <20260925-ve-selftest-improv-v4-0-1f505bd0eca6@virtuozzo.com> (raw)
This change adds helpers for creating and preserving various
namespaces and running functions inside them.
This appeared useful while implementing ve mount accounting
selftests - it required keeping mount namespace alive and
doing different things at different moments of time.
To make setns work with CLONE_NEWVE without starting VE,
the first patch changes the -EINVAL return to a warning message.
https://virtuozzo.atlassian.net/browse/VSTOR-144504
Feature: ve selftests
Changes in v4:
- Moved the ve_namespace patch to the front, before the selftest
helpers that rely on it.
- ve_namespace: the warning follows the "CT: %s:" format of other
ve.c messages and prints the VE state and the offender's comm/pid;
the commit message now explains why the warning is kept.
- namespace management helpers: prepare_namespaces() leaves ctx
empty on any failure (mask zeroed on entry, saved fds closed on
error), so unconditional cleanup in callers is safe; fixed a
comment typo.
- more helpers: dropped a stray blank line in run_in_ve().
- Collected Reviewed-by tags.
- Link to v3: http://lore.virtuozzo.com/20260909-ve-selftest-improv-v3-0-4b41980d9a45@virtuozzo.com
Changes in v3:
- Patch 1: wrap flag -> (flag) in macros, undef them after use.
- Patch 2: Fix comments in run_in_ve function.
- Link to v2: http://lore.virtuozzo.com/20260909-ve-selftest-improv-v2-0-aad0a25d6569@virtuozzo.com
Changes in v2:
- Patch 1: fixed JOIN_NS order in enter_namespaces, added proper
cleanup in prepare_namespaces.
- Patch 2: increased buf size in write_u64_at, added range check in
read_s32_at, separated setup failures in run_in_ve from fn setup
failures.
- Patch 3: Removed kselftests mention.
- Link to v1: http://lore.virtuozzo.com/20260907-ve-selftest-improv-v1-0-a17847abbd48@virtuozzo.com
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Vladimir Riabchun (3):
ve_namespace: Allow entering non-running VE namespace
selftests/ve: Add namespace management helpers
selftests/ve: Add more helpers
kernel/ve/ve_namespace.c | 4 +-
tools/testing/selftests/ve/ve_selftest.h | 214 ++++++++++++++++++++++++++++++-
2 files changed, 210 insertions(+), 8 deletions(-)
---
base-commit: f7ba712715849bef1a54e1f13fab79b094ccc0df
change-id: 20260907-ve-selftest-improv-2d043d021cae
Best regards,
--
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next reply other threads:[~2026-09-25 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 12:47 Konstantin Khorenko [this message]
2026-09-25 12:47 ` [Devel] [PATCH VZ10 v4 1/3] ve_namespace: Allow entering non-running VE namespace Konstantin Khorenko
2026-09-25 12:47 ` [Devel] [PATCH VZ10 v4 2/3] selftests/ve: Add namespace management helpers Konstantin Khorenko
2026-09-25 12:47 ` [Devel] [PATCH VZ10 v4 3/3] selftests/ve: Add more helpers Konstantin Khorenko
2026-09-25 13:37 ` [Devel] [PATCH VZ10 v4 0/3] Improvements for ve selftests Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260925-ve-selftest-improv-v4-0-1f505bd0eca6@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=vasileios.almpanis@virtuozzo.com \
--cc=vladimir.riabchun@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox