chiark / gitweb /
remove "ignore_device"
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 16 Nov 2009 14:22:17 +0000 (15:22 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 16 Nov 2009 14:22:17 +0000 (15:22 +0100)
There is no way to ignore an event these days. Libudev events can
not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.

NEWS
configure.ac
udev/udev-event.c
udev/udev-rules.c
udev/udev.h
udev/udev.xml
udev/udevadm-test.c
udev/udevd.c

diff --git a/NEWS b/NEWS
index c0196a18ab56e90702f87f7d95e95e816c76579e..66a71e050504dc37bbcef7cf8bfef67b666f330d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+udev 148
+========
+Bugfixes.
+
+The option "ignore_device" does no longer exist. There is no way to
+ignore an event, as libudev events can not be suppressed by rules.
+It only prevented RUN keys from being executed, which results in an
+inconsistent behavior in current setups.
+
 udev 147
 ========
 Bugfixes.
 udev 147
 ========
 Bugfixes.
index 3cb2299ce16ed107551b4b03a408910582aea38d..12271f1461e7122d155fac262de785145cba0855 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT([udev], [147], [linux-hotplug@vger.kernel.org])
+AC_INIT([udev], [148], [linux-hotplug@vger.kernel.org])
 AC_PREREQ(2.60)
 AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_PREREQ(2.60)
 AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
index d5b4d0941e295f1d1a18fb97a879a7b04a00edc2..4e1773ffeaf156807385d625f7499d62da12da0d 100644 (file)
@@ -568,12 +568,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
                        event->tmp_node = NULL;
                }
 
                        event->tmp_node = NULL;
                }
 
-               if (event->ignore_device) {
-                       info(event->udev, "device event will be ignored\n");
-                       delete_kdevnode = 1;
-                       goto exit_add;
-               }
-
                if (event->name != NULL && event->name[0] == '\0') {
                        info(event->udev, "device node creation suppressed\n");
                        delete_kdevnode = 1;
                if (event->name != NULL && event->name[0] == '\0') {
                        info(event->udev, "device node creation suppressed\n");
                        delete_kdevnode = 1;
@@ -638,10 +632,6 @@ exit_add:
                udev_device_delete_db(dev);
 
                udev_rules_apply_to_event(rules, event);
                udev_device_delete_db(dev);
 
                udev_rules_apply_to_event(rules, event);
-               if (event->ignore_device) {
-                       info(event->udev, "device event will be ignored\n");
-                       goto exit;
-               }
                if (event->name == NULL)
                        goto exit;
 
                if (event->name == NULL)
                        goto exit;
 
@@ -694,10 +684,6 @@ exit_add:
                }
 
                udev_rules_apply_to_event(rules, event);
                }
 
                udev_rules_apply_to_event(rules, event);
-               if (event->ignore_device) {
-                       info(event->udev, "device event will be ignored\n");
-                       goto exit;
-               }
 
                if (udev_device_get_ignore_remove(dev)) {
                        info(event->udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev));
 
                if (udev_device_get_ignore_remove(dev)) {
                        info(event->udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev));
@@ -710,8 +696,6 @@ exit_add:
 
        /* default devices */
        udev_rules_apply_to_event(rules, event);
 
        /* default devices */
        udev_rules_apply_to_event(rules, event);
-       if (event->ignore_device)
-               info(event->udev, "device event will be ignored\n");
 
        if (strcmp(udev_device_get_action(dev), "remove") != 0)
                udev_device_update_db(dev);
 
        if (strcmp(udev_device_get_action(dev), "remove") != 0)
                udev_device_update_db(dev);
index 092ddcdc25360cf30f2d591715736748ebec3533..07cb4a7fbf8f58d18330232f6b4080e66d1a1160 100644 (file)
@@ -144,7 +144,6 @@ enum token_type {
        TK_M_RESULT,                    /* val */
        TK_M_MAX,
 
        TK_M_RESULT,                    /* val */
        TK_M_MAX,
 
-       TK_A_IGNORE_DEVICE,
        TK_A_STRING_ESCAPE_NONE,
        TK_A_STRING_ESCAPE_REPLACE,
        TK_A_INOTIFY_WATCH,             /* int */
        TK_A_STRING_ESCAPE_NONE,
        TK_A_STRING_ESCAPE_REPLACE,
        TK_A_INOTIFY_WATCH,             /* int */
@@ -275,7 +274,6 @@ static const char *token_str(enum token_type type)
                [TK_M_RESULT] =                 "M RESULT",
                [TK_M_MAX] =                    "M MAX",
 
                [TK_M_RESULT] =                 "M RESULT",
                [TK_M_MAX] =                    "M MAX",
 
-               [TK_A_IGNORE_DEVICE] =          "A IGNORE_DEVICE",
                [TK_A_STRING_ESCAPE_NONE] =     "A STRING_ESCAPE_NONE",
                [TK_A_STRING_ESCAPE_REPLACE] =  "A STRING_ESCAPE_REPLACE",
                [TK_A_INOTIFY_WATCH] =          "A INOTIFY_WATCH",
                [TK_A_STRING_ESCAPE_NONE] =     "A STRING_ESCAPE_NONE",
                [TK_A_STRING_ESCAPE_REPLACE] =  "A STRING_ESCAPE_REPLACE",
                [TK_A_INOTIFY_WATCH] =          "A INOTIFY_WATCH",
@@ -357,7 +355,6 @@ static void dump_token(struct udev_rules *rules, struct token *token)
                dbg(rules->udev, "%s %s '%s' '%s'(%s)\n",
                    token_str(type), operation_str(op), attr, value, string_glob_str(glob));
                break;
                dbg(rules->udev, "%s %s '%s' '%s'(%s)\n",
                    token_str(type), operation_str(op), attr, value, string_glob_str(glob));
                break;
-       case TK_A_IGNORE_DEVICE:
        case TK_A_STRING_ESCAPE_NONE:
        case TK_A_STRING_ESCAPE_REPLACE:
        case TK_A_IGNORE_REMOVE:
        case TK_A_STRING_ESCAPE_NONE:
        case TK_A_STRING_ESCAPE_REPLACE:
        case TK_A_IGNORE_REMOVE:
@@ -1030,7 +1027,6 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type,
                if (data != NULL)
                        token->key.mode = *(mode_t *)data;
                break;
                if (data != NULL)
                        token->key.mode = *(mode_t *)data;
                break;
-       case TK_A_IGNORE_DEVICE:
        case TK_A_STRING_ESCAPE_NONE:
        case TK_A_STRING_ESCAPE_REPLACE:
        case TK_A_IGNORE_REMOVE:
        case TK_A_STRING_ESCAPE_NONE:
        case TK_A_STRING_ESCAPE_REPLACE:
        case TK_A_IGNORE_REMOVE:
@@ -1496,10 +1492,6 @@ static int add_rule(struct udev_rules *rules, char *line,
                if (strcmp(key, "OPTIONS") == 0) {
                        const char *pos;
 
                if (strcmp(key, "OPTIONS") == 0) {
                        const char *pos;
 
-                       if (strstr(value, "ignore_device") != NULL) {
-                               dbg(rules->udev, "device should be ignored\n");
-                               rule_add_key(&rule_tmp, TK_A_IGNORE_DEVICE, 0, NULL, NULL);
-                       }
                        if (strstr(value, "ignore_remove") != NULL) {
                                dbg(rules->udev, "remove event should be ignored\n");
                                rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL);
                        if (strstr(value, "ignore_remove") != NULL) {
                                dbg(rules->udev, "remove event should be ignored\n");
                                rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL);
@@ -2259,11 +2251,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                        if (match_key(rules, cur, event->program_result) != 0)
                                goto nomatch;
                        break;
                        if (match_key(rules, cur, event->program_result) != 0)
                                goto nomatch;
                        break;
-
-               case TK_A_IGNORE_DEVICE:
-                       event->ignore_device = 1;
-                       return 0;
-                       break;
                case TK_A_STRING_ESCAPE_NONE:
                        esc = ESCAPE_NONE;
                        break;
                case TK_A_STRING_ESCAPE_NONE:
                        esc = ESCAPE_NONE;
                        break;
index 8f0a3014b647f8eb946073c7127d7bf72e279663..555eae6311d7baa7b538cc0349261bcfcaf1f7c8 100644 (file)
@@ -48,7 +48,6 @@ struct udev_event {
        unsigned int name_final:1;
        unsigned int devlink_final:1;
        unsigned int run_final:1;
        unsigned int name_final:1;
        unsigned int devlink_final:1;
        unsigned int run_final:1;
-       unsigned int ignore_device:1;
        unsigned int inotify_watch:1;
 };
 
        unsigned int inotify_watch:1;
 };
 
index 41941c820f5e2ed326964e5a1b28da17adfa2fc9..ff01fefe58a6b36eca6ff5621139db1bbe43a1f2 100644 (file)
               <listitem>
                 <para>Rule and device options:</para>
                 <variablelist>
               <listitem>
                 <para>Rule and device options:</para>
                 <variablelist>
-                  <varlistentry>
-                    <term><option>ignore_device</option></term>
-                    <listitem>
-                      <para>Ignore this event completely.</para>
-                    </listitem>
-                  </varlistentry>
                   <varlistentry>
                     <term><option>ignore_remove</option></term>
                     <listitem>
                   <varlistentry>
                     <term><option>ignore_remove</option></term>
                     <listitem>
index 6c5710380ef06be216fc6c544a6b6e75a0f56b2d..5dd515bcdc897b4ea8272a91d039ea45b9972ad9 100644 (file)
@@ -119,7 +119,7 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
        udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
                info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
 
        udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
                info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
 
-       if (err == 0 && !event->ignore_device && udev_get_run(udev)) {
+       if (err == 0 && udev_get_run(udev)) {
                udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
                        char program[UTIL_PATH_SIZE];
 
                udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
                        char program[UTIL_PATH_SIZE];
 
index 72f9b180d398d37294a8511ad6c9bd72ee045cd3..300d6035191a8e55e7c09d2d85e6d0272f53c147 100644 (file)
@@ -293,7 +293,7 @@ static void worker_new(struct event *event)
                                alarm(udev_device_get_event_timeout(dev));
 
                        /* execute RUN= */
                                alarm(udev_device_get_event_timeout(dev));
 
                        /* execute RUN= */
-                       if (err == 0 && !udev_event->ignore_device && udev_get_run(udev_event->udev))
+                       if (err == 0 && udev_get_run(udev_event->udev))
                                failed = udev_event_execute_run(udev_event,
                                                                &orig_sigmask);
 
                                failed = udev_event_execute_run(udev_event,
                                                                &orig_sigmask);