chiark / gitweb /
core: warn when unit files with unsupported options are parsed
[elogind.git] / src / core / device.c
index 19fc7451d8b7108d8e069f74cadeca84e4f40896..c7bc1e25e7bd5225a9ce089f79fb3244baf19be1 100644 (file)
@@ -264,12 +264,11 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
                         FOREACH_WORD_QUOTED(w, l, wants, state) {
                                 _cleanup_free_ char *n = NULL;
                                 char e[l+1];
-                                Unit *other;
 
                                 memcpy(e, w, l);
                                 e[l] = 0;
 
-                                n = unit_name_mangle(e);
+                                n = unit_name_mangle(e, MANGLE_NOGLOB);
                                 if (!n) {
                                         r = -ENOMEM;
                                         goto fail;
@@ -278,15 +277,6 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
                                 r = unit_add_dependency_by_name(u, UNIT_WANTS, n, NULL, true);
                                 if (r < 0)
                                         goto fail;
-
-                                other = manager_get_unit(u->manager, n);
-                                if (!other || !unit_can_start(other))
-                                        continue;
-
-                                r = manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
-                                if (r < 0)
-                                        log_warning("Failed to add job %s/%s, ignoring: %s.",
-                                                    other->id, job_type_to_string(JOB_START), strerror(-r));
                         }
                 }
         }
@@ -559,6 +549,10 @@ static int device_enumerate(Manager *m) {
         if (r < 0)
                 goto fail;
 
+        r = udev_enumerate_add_match_is_initialized(e);
+        if (r < 0)
+                goto fail;
+
         r = udev_enumerate_scan_devices(e);
         if (r < 0)
                 goto fail;
@@ -659,7 +653,6 @@ const UnitVTable device_vtable = {
         .sub_state_to_string = device_sub_state_to_string,
 
         .bus_interface = "org.freedesktop.systemd1.Device",
-        .bus_changing_properties = bus_device_changing_properties,
         .bus_vtable = bus_device_vtable,
 
         .following = device_following,