From: Lennart Poettering Date: Wed, 17 Jan 2024 15:31:16 +0000 (+0100) Subject: vmspawn: include qemu cmdline in debug output X-Git-Tag: v256-rc1~1117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9e2d83b75d078143c7ccac3b3070f420b342315;p=thirdparty%2Fsystemd.git vmspawn: include qemu cmdline in debug output It's just so useful for debugging to know what is going to be executed. --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index e2d45d514aa..e6ab63a6cdd 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -647,6 +647,14 @@ static int run_virtual_machine(void) { return log_error_errno(r, "Failed to call getsockname on vsock: %m"); } + if (DEBUG_LOGGING) { + _cleanup_free_ char *joined = quote_command_line(cmdline, SHELL_ESCAPE_EMPTY); + if (!joined) + return log_oom(); + + log_debug("Executing: %s", joined); + } + _cleanup_(sd_event_source_unrefp) sd_event_source *notify_event_source = NULL; _cleanup_(sd_event_unrefp) sd_event *event = NULL; r = sd_event_new(&event);