From: Lennart Poettering Date: Wed, 9 Jul 2025 07:35:25 +0000 (+0200) Subject: machined: add a bit more debug logging X-Git-Tag: v258-rc1~79^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=596c596d0926b4c3bc183335b3ce626cc1ac4840;p=thirdparty%2Fsystemd.git machined: add a bit more debug logging --- diff --git a/src/machine/machine.c b/src/machine/machine.c index 26252ff9cdd..e127ddcb0e9 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -33,6 +33,7 @@ #include "path-util.h" #include "process-util.h" #include "serialize.h" +#include "signal-util.h" #include "socket-util.h" #include "special.h" #include "stdio-util.h" @@ -680,6 +681,8 @@ int machine_stop(Machine *m) { assert(m); + log_debug("Stopping machine '%s'.", m->name); + if (!IN_SET(m->class, MACHINE_CONTAINER, MACHINE_VM)) return -EOPNOTSUPP; @@ -813,6 +816,8 @@ MachineState machine_get_state(Machine *s) { int machine_kill(Machine *m, KillWhom whom, int signo) { assert(m); + log_debug("Killing machine '%s' (%s) with signal %s.", m->name, kill_whom_to_string(whom), signal_to_string(signo)); + if (!IN_SET(m->class, MACHINE_VM, MACHINE_CONTAINER)) return -EOPNOTSUPP; diff --git a/src/machine/machined-core.c b/src/machine/machined-core.c index 075ea4a8031..61078d51ec3 100644 --- a/src/machine/machined-core.c +++ b/src/machine/machined-core.c @@ -162,13 +162,16 @@ void manager_gc(Manager *m, bool drop_not_started) { /* First, if we are not closing yet, initiate stopping */ if (machine_may_gc(machine, drop_not_started) && - machine_get_state(machine) != MACHINE_CLOSING) + machine_get_state(machine) != MACHINE_CLOSING) { + log_debug("Stopping machine '%s' due to GC.", machine->name); machine_stop(machine); + } /* Now, the stop probably made this referenced * again, but if it didn't, then it's time to let it * go entirely. */ if (machine_may_gc(machine, drop_not_started)) { + log_debug("Finalizing machine '%s' due to GC.", machine->name); machine_finalize(machine); machine_free(machine); }