mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
remove "ignore_device"
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.
This commit is contained in:
parent
5052297b6a
commit
cdae488a3f
9
NEWS
9
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.
|
||||
|
@ -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])])
|
||||
|
@ -568,12 +568,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
|
||||
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;
|
||||
@ -638,10 +632,6 @@ exit_add:
|
||||
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;
|
||||
|
||||
@ -694,10 +684,6 @@ exit_add:
|
||||
}
|
||||
|
||||
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));
|
||||
@ -710,8 +696,6 @@ exit_add:
|
||||
|
||||
/* 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);
|
||||
|
@ -144,7 +144,6 @@ enum token_type {
|
||||
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 */
|
||||
@ -275,7 +274,6 @@ static const char *token_str(enum token_type type)
|
||||
[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",
|
||||
@ -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;
|
||||
case TK_A_IGNORE_DEVICE:
|
||||
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;
|
||||
case TK_A_IGNORE_DEVICE:
|
||||
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 (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);
|
||||
@ -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;
|
||||
|
||||
case TK_A_IGNORE_DEVICE:
|
||||
event->ignore_device = 1;
|
||||
return 0;
|
||||
break;
|
||||
case TK_A_STRING_ESCAPE_NONE:
|
||||
esc = ESCAPE_NONE;
|
||||
break;
|
||||
|
@ -48,7 +48,6 @@ struct udev_event {
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -419,12 +419,6 @@
|
||||
<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>
|
||||
|
@ -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));
|
||||
|
||||
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];
|
||||
|
||||
|
@ -293,7 +293,7 @@ static void worker_new(struct event *event)
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user