diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-12-09 11:38:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-12-20 18:04:01 +0100 |
commit | 1c0ade2e1f76b50431f941980b76e8ec5cdf3b12 (patch) | |
tree | 80712c9107ab7c761a4d82c74c84b309ef4ab045 /src/vmspawn/vmspawn.c | |
parent | po: Translated using Weblate (Finnish) (diff) | |
download | systemd-1c0ade2e1f76b50431f941980b76e8ec5cdf3b12.tar.xz systemd-1c0ade2e1f76b50431f941980b76e8ec5cdf3b12.zip |
discover-image: introduce per-user image directories
We nowadays support unprivileged invocation of systemd-nspawn +
systemd-vmspawn, but there was no support for discovering suitable disk
images (i.e. no per-user counterpart of /var/lib/machines). Add this
now, and hook it up everywhere.
Instead of hardcoding machined's, importd's, portabled's, sysupdated's
image discovery to RUNTIME_SCOPE_SYSTEM I introduced a field that make
the scope variable, even if this field is always initialized to
RUNTIME_SCOPE_SYSTEM for now. I think these four services should
eventually be updated to support a per-user concept too, this is
preparation for that, even though it doesn't outright add support for
this.
This is for the largest part not user visible, except for in nspawn,
vmspawn and the dissect tool. For the latter I added a pair of
--user/--system switches to select the discovery scope.
Diffstat (limited to 'src/vmspawn/vmspawn.c')
-rw-r--r-- | src/vmspawn/vmspawn.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 1c49aff4a3..d2a9a6ee01 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -2236,7 +2236,8 @@ static int determine_names(void) { if (arg_machine) { _cleanup_(image_unrefp) Image *i = NULL; - r = image_find(IMAGE_MACHINE, arg_machine, NULL, &i); + r = image_find(arg_privileged ? RUNTIME_SCOPE_SYSTEM : RUNTIME_SCOPE_USER, + IMAGE_MACHINE, arg_machine, NULL, &i); if (r == -ENOENT) return log_error_errno(r, "No image for machine '%s'.", arg_machine); if (r < 0) |