]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: output context OSC
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Nov 2024 11:33:13 +0000 (12:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Feb 2025 14:09:25 +0000 (15:09 +0100)
src/nspawn/nspawn.c

index 066156a5ca0b54ca43fa6cda6f030dc7f8a27068..a504279fa52a2ee5fdfa08ca523077c65e811c17 100644 (file)
@@ -85,6 +85,7 @@
 #include "nsresource.h"
 #include "nulstr-util.h"
 #include "os-util.h"
+#include "osc-context.h"
 #include "pager.h"
 #include "parse-argument.h"
 #include "parse-util.h"
@@ -5645,6 +5646,13 @@ static int run_container(
                 (void) expose_port_execute(rtnl, &expose_args->fw_ctx, arg_expose_ports, AF_INET6, &expose_args->address6);
         }
 
+        _cleanup_(osc_context_closep) sd_id128_t osc_context_id = SD_ID128_NULL;
+        if (IN_SET(arg_console_mode, CONSOLE_INTERACTIVE, CONSOLE_READ_ONLY) && !terminal_is_dumb()) {
+                r = osc_context_open_container(arg_machine, /* ret_seq= */ NULL, &osc_context_id);
+                if (r < 0)
+                        return r;
+        }
+
         if (arg_console_mode != CONSOLE_PIPE) {
                 _cleanup_close_ int fd = -EBADF;
                 PTYForwardFlags flags = 0;