#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"
assert(m);
+ log_debug("Stopping machine '%s'.", m->name);
+
if (!IN_SET(m->class, MACHINE_CONTAINER, MACHINE_VM))
return -EOPNOTSUPP;
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;
/* 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);
}