chiark / gitweb /
Revert "machined: don't force terminate registered machines"
authorLennart Poettering <lennart@poettering.net>
Mon, 29 Dec 2014 19:00:01 +0000 (20:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 29 Dec 2014 19:13:58 +0000 (20:13 +0100)
This reverts commit 206e7a5f7b55ac61188efd895e65ab26e478cbb2.

We actually want to allow shutting down containers that use
RegisterMachine() rather than CreateMachine() to register their own
unit. It should be safe to do so, since the primary usecase for
RegisterMachine() are container managers that run only a single
container within their own unit, such as systemd-nspawn.

src/machine/machine.c
src/machine/machine.h
src/machine/machined-dbus.c

index 8dec716..b283118 100644 (file)
@@ -406,12 +406,10 @@ static int machine_stop_scope(Machine *m) {
         if (!m->unit)
                 return 0;
 
-        if (!m->registered) {
-                r = manager_stop_unit(m->manager, m->unit, &error, &job);
-                if (r < 0) {
-                        log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
-                        return r;
-                }
+        r = manager_stop_unit(m->manager, m->unit, &error, &job);
+        if (r < 0) {
+                log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
+                return r;
         }
 
         free(m->scope_job);
index 64accda..4827ba3 100644 (file)
@@ -72,7 +72,6 @@ struct Machine {
 
         bool in_gc_queue:1;
         bool started:1;
-        bool registered:1;
 
         sd_bus_message *create_message;
 
index b894e0b..233c6e8 100644 (file)
@@ -354,8 +354,6 @@ static int method_register_machine_internal(sd_bus *bus, sd_bus_message *message
                 goto fail;
         }
 
-        m->registered = true;
-
         r = machine_start(m, NULL, error);
         if (r < 0)
                 goto fail;