]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: include qemu cmdline in debug output
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Jan 2024 15:31:16 +0000 (16:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Jan 2024 18:08:32 +0000 (19:08 +0100)
It's just so useful for debugging to know what is going to be executed.

src/vmspawn/vmspawn.c

index e2d45d514aaa170777654449bd87304883b77560..e6ab63a6cdded5de6fc7929d23e17669762e8e8b 100644 (file)
@@ -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);