]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit: drop support for pre-v44 job serialization
authorLennart Poettering <lennart@poettering.net>
Tue, 19 May 2015 14:41:14 +0000 (16:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 May 2015 14:41:14 +0000 (16:41 +0200)
No distro ships that old systemd versions anyway, hence let's drop
support for live-upgrades for them. Offline updates are still supported.
And live-upgrades will only lose the job queue, hence basically still
work...

src/core/unit.c
src/core/unit.h

index 2da2565503811773424bb3ddeb6bbc223c2fa666..e380276d4922046393f0d7b4aa3af20b00589aad 100644 (file)
@@ -85,7 +85,6 @@ Unit *unit_new(Manager *m, size_t size) {
 
         u->manager = m;
         u->type = _UNIT_TYPE_INVALID;
-        u->deserialized_job = _JOB_TYPE_INVALID;
         u->default_dependencies = true;
         u->unit_file_state = _UNIT_FILE_STATE_INVALID;
         u->unit_file_preset = -1;
@@ -2741,16 +2740,8 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
                                         job_free(j);
                                         return r;
                                 }
-                        } else {
-                                /* legacy */
-                                JobType type;
-
-                                type = job_type_from_string(v);
-                                if (type < 0)
-                                        log_unit_debug(u, "Failed to parse job type value: %s", v);
-                                else
-                                        u->deserialized_job = type;
-                        }
+                        } else  /* legacy for pre-44 */
+                                log_unit_warning(u, "Update from too old systemd versions are unsupported, cannot deserialize job: %s", v);
                         continue;
                 } else if (streq(l, "inactive-exit-timestamp")) {
                         dual_timestamp_deserialize(v, &u->inactive_exit_timestamp);
@@ -2899,13 +2890,6 @@ int unit_coldplug(Unit *u) {
                 r = job_coldplug(u->job);
                 if (r < 0)
                         return r;
-        } else if (u->deserialized_job >= 0) {
-                /* legacy */
-                r = manager_add_job(u->manager, u->deserialized_job, u, JOB_IGNORE_REQUIREMENTS, false, NULL, NULL);
-                if (r < 0)
-                        return r;
-
-                u->deserialized_job = _JOB_TYPE_INVALID;
         }
 
         return 0;
index 7ef970e9b84d6d57b6e92e0ffd0794752f1f1fda..9491ef64f9c36367c303d26d3b0c08eebf585a3c 100644 (file)
@@ -166,12 +166,6 @@ struct Unit {
         /* Used during GC sweeps */
         unsigned gc_marker;
 
-        /* When deserializing, temporarily store the job type for this
-         * unit here, if there was a job scheduled.
-         * Only for deserializing from a legacy version. New style uses full
-         * serialized jobs. */
-        int deserialized_job; /* This is actually of type JobType */
-
         /* Error code when we didn't manage to load the unit (negative) */
         int load_error;