[Devel] [PATCH hci-8.2 v2 2/2] selftests/ve: check a host task entering a pseudosuper VE reaches its init

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Fri Nov 20 16:21:52 MSK 2026


Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] selftests/ve: start_ve() failure paths can leave a stale errno
  for the setup diagnostic
- [Low] selftests/ve: cgv2_fd not closed when subtree_control write
  fails in FIXTURE_SETUP
--

commit 4c9fa60ac35eb44ea45b0c336380a4e3e3c6cbba
Author: Konstantin Khorenko <khorenko at virtuozzo.com>

selftests/ve: check a host task entering a pseudosuper VE reaches its init

This adds a selftest that starts a VE with ve.pseudosuper set, the way
libvzctl does. It checks that a host task entering the VE through the ve
namespace can reach the init, and that a binary exec'd inside the VE
cannot.

> diff --git a/tools/testing/selftests/ve/ve_setup_task_test.c b/tools/testing/selftests/ve/ve_setup_task_test.c
> new file mode 100644
> index 0000000000000..4d18ba3d57104
> --- /dev/null
> +++ b/tools/testing/selftests/ve/ve_setup_task_test.c

[ ... ]

> +	*what = "ve.state is not RUNNING";
> +	if (ve_read(self, "ve.state", state, sizeof(state)) <= 0 ||
> +	    strncmp(state, "RUNNING", 7))
> +		return -1;

[Severity: Low]
Can this report a misleading reason when the start fails? This branch
returns -1 without setting errno. The "ret != 1" branch after the read()
of the status pipe does the same.

FIXTURE_SETUP then prints strerror(err) from whatever errno an earlier
call left behind. A stale EACCES would look like the failure this test
is meant to detect. Would setting errno (or passing the error back
separately) in these branches fix the diagnostic?

[ ... ]

> +	if (write_file_at(self->cgv2_fd, "cgroup.subtree_control",
> +			  VE_CONTROLLERS) < 0)
> +		SKIP(return, "cannot enable the ve controller: %s",
> +		     strerror(errno));

[Severity: Low]
Is self->cgv2_fd leaked on this SKIP path? FIXTURE_TEARDOWN returns early
because self->ctid is still -1, so nothing closes the fd. The other
failure path in this function does close it. Closing it before SKIP()
would keep the lifetime consistent.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261120-b4-prep-khorenko-vstor-156164-ve-setup-task-pseudosuper-v2-0-c85e827c1dba@virtuozzo.com?part=2



More information about the Devel mailing list