From: Lennart Poettering Date: Mon, 18 Nov 2024 11:35:00 +0000 (+0100) Subject: vmspawn: generate vm context OSC X-Git-Tag: v258-rc1~1227^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5eb39a385a4b216ef2a3a596da42cbb20fdc7fa6;p=thirdparty%2Fsystemd.git vmspawn: generate vm context OSC --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 8776614001e..e0f49bf0922 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -48,6 +48,7 @@ #include "mkdir.h" #include "namespace-util.h" #include "netif-util.h" +#include "osc-context.h" #include "pager.h" #include "parse-argument.h" #include "parse-util.h" @@ -2249,8 +2250,15 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { /* Exit when the child exits */ (void) event_add_child_pidref(event, NULL, &child_pidref, WEXITED, on_child_exit, NULL); + _cleanup_(osc_context_closep) sd_id128_t osc_context_id = SD_ID128_NULL; _cleanup_(pty_forward_freep) PTYForward *forward = NULL; if (master >= 0) { + if (!terminal_is_dumb()) { + r = osc_context_open_vm(arg_machine, /* ret_seq= */ NULL, &osc_context_id); + if (r < 0) + return r; + } + r = pty_forward_new(event, master, ptyfwd_flags, &forward); if (r < 0) return log_error_errno(r, "Failed to create PTY forwarder: %m");