diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-10-06 00:45:06 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-10-06 00:45:06 +0200 |
commit | 289a1821a4a7636ce42a6c7adc3a9bb49421a5ea (patch) | |
tree | b4499dad1a81ed60a1cb5cb74c2714cf0b759f37 /udev | |
parent | a13d90aec63db6b3d3b90da41b5274fd81ab790e (diff) |
remove 'udevadm trigger --type=failed' and SYSFS, ID, BUS keys
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-rules.c | 70 | ||||
-rw-r--r-- | udev/udevadm-trigger.c | 24 | ||||
-rw-r--r-- | udev/udevd.c | 11 |
3 files changed, 5 insertions, 100 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 6bf2726e1e..84033243c2 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -198,7 +198,6 @@ struct token { union { unsigned int attr_off; int devlink_unique; - int fail_on_error; unsigned int rule_goto; mode_t mode; uid_t uid; @@ -1066,7 +1065,6 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, break; case TK_A_RUN: token->key.value_off = add_string(rule_tmp->rules, value); - token->key.fail_on_error = *(int *)data; break; case TK_A_INOTIFY_WATCH: case TK_A_DEVLINK_PRIO: @@ -1191,9 +1189,6 @@ static int add_rule(struct udev_rules *rules, char *line, char *linepos; char *attr; struct rule_tmp rule_tmp; - bool bus_warn = false; - bool sysfs_warn = false; - bool id_warn = false; memset(&rule_tmp, 0x00, sizeof(struct rule_tmp)); rule_tmp.rules = rules; @@ -1287,21 +1282,6 @@ static int add_rule(struct udev_rules *rules, char *line, continue; } - if (strcmp(key, "ID") == 0) { - if (!id_warn) { - id_warn = true; - err(rules->udev, "ID= will be removed in a future udev version, " - "please use KERNEL= to match the event device, or KERNELS= " - "to match a parent device, in %s:%u\n", filename, lineno); - } - if (op > OP_MATCH_MAX) { - err(rules->udev, "invalid KERNELS operation\n"); - goto invalid; - } - rule_add_key(&rule_tmp, TK_M_KERNELS, op, value, NULL); - continue; - } - if (strcmp(key, "SUBSYSTEMS") == 0) { if (op > OP_MATCH_MAX) { err(rules->udev, "invalid SUBSYSTEMS operation\n"); @@ -1311,21 +1291,6 @@ static int add_rule(struct udev_rules *rules, char *line, continue; } - if (strcmp(key, "BUS") == 0) { - if (!bus_warn) { - bus_warn = true; - err(rules->udev, "BUS= will be removed in a future udev version, " - "please use SUBSYSTEM= to match the event device, or SUBSYSTEMS= " - "to match a parent device, in %s:%u\n", filename, lineno); - } - if (op > OP_MATCH_MAX) { - err(rules->udev, "invalid SUBSYSTEMS operation\n"); - goto invalid; - } - rule_add_key(&rule_tmp, TK_M_SUBSYSTEMS, op, value, NULL); - continue; - } - if (strcmp(key, "DRIVERS") == 0) { if (op > OP_MATCH_MAX) { err(rules->udev, "invalid DRIVERS operation\n"); @@ -1364,26 +1329,6 @@ static int add_rule(struct udev_rules *rules, char *line, continue; } - if (strncmp(key, "SYSFS{", sizeof("SYSFS{")-1) == 0) { - if (!sysfs_warn) { - sysfs_warn = true; - err(rules->udev, "SYSFS{}= will be removed in a future udev version, " - "please use ATTR{}= to match the event device, or ATTRS{}= " - "to match a parent device, in %s:%u\n", filename, lineno); - } - if (op > OP_MATCH_MAX) { - err(rules->udev, "invalid ATTRS operation\n"); - goto invalid; - } - attr = get_key_attribute(rules->udev, key + sizeof("ATTRS")-1); - if (attr == NULL) { - err(rules->udev, "error parsing ATTRS attribute\n"); - goto invalid; - } - rule_add_key(&rule_tmp, TK_M_ATTRS, op, value, attr); - continue; - } - if (strncmp(key, "ENV{", sizeof("ENV{")-1) == 0) { attr = get_key_attribute(rules->udev, key + sizeof("ENV")-1); if (attr == NULL) { @@ -1509,13 +1454,8 @@ static int add_rule(struct udev_rules *rules, char *line, continue; } - if (strncmp(key, "RUN", sizeof("RUN")-1) == 0) { - int flag = 0; - - attr = get_key_attribute(rules->udev, key + sizeof("RUN")-1); - if (attr != NULL && strstr(attr, "fail_event_on_error")) - flag = 1; - rule_add_key(&rule_tmp, TK_A_RUN, op, value, &flag); + if (strcmp(key, "RUN") == 0) { + rule_add_key(&rule_tmp, TK_A_RUN, op, value, NULL); continue; } @@ -2706,17 +2646,13 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event break; } case TK_A_RUN: { - struct udev_list_entry *list_entry; - if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL) udev_list_cleanup(&event->run_list); info(event->udev, "RUN '%s' %s:%u\n", &rules->buf[cur->key.value_off], &rules->buf[rule->rule.filename_off], rule->rule.filename_line); - list_entry = udev_list_entry_add(&event->run_list, &rules->buf[cur->key.value_off], NULL); - if (cur->key.fail_on_error) - udev_list_entry_set_num(list_entry, true); + udev_list_entry_add(&event->run_list, &rules->buf[cur->key.value_off], NULL); break; } case TK_A_GOTO: diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c index d94c9568d1..2cee2297d4 100644 --- a/udev/udevadm-trigger.c +++ b/udev/udevadm-trigger.c @@ -61,20 +61,6 @@ static void exec_list(struct udev_enumerate *udev_enumerate, const char *action) } } -static int scan_failed(struct udev_enumerate *udev_enumerate) -{ - struct udev *udev = udev_enumerate_get_udev(udev_enumerate); - struct udev_queue *udev_queue; - struct udev_list_entry *list_entry; - - udev_queue = udev_queue_new(udev); - if (udev_queue == NULL) - return -1; - udev_list_entry_foreach(list_entry, udev_queue_get_failed_list_entry(udev_queue)) - udev_enumerate_add_syspath(udev_enumerate, udev_list_entry_get_name(list_entry)); - return 0; -} - static const char *keyval(const char *str, const char **val, char *buf, size_t size) { char *pos; @@ -110,7 +96,6 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) enum { TYPE_DEVICES, TYPE_SUBSYSTEMS, - TYPE_FAILED, } device_type = TYPE_DEVICES; const char *action = "change"; struct udev_enumerate *udev_enumerate; @@ -145,8 +130,6 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) device_type = TYPE_DEVICES; } else if (strcmp(optarg, "subsystems") == 0) { device_type = TYPE_SUBSYSTEMS; - } else if (strcmp(optarg, "failed") == 0) { - device_type = TYPE_FAILED; } else { err(udev, "unknown type --type=%s\n", optarg); rc = 2; @@ -208,8 +191,6 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) " --type= type of events to trigger\n" " devices sys devices (default)\n" " subsystems sys subsystems and drivers\n" - " failed trigger only the events which have been\n" - " marked as failed during a previous run\n" " --action=<action> event action value, default is \"change\"\n" " --subsystem-match=<subsystem> trigger devices from a matching subsystem\n" " --subsystem-nomatch=<subsystem> exclude devices from a matching subsystem\n" @@ -228,11 +209,6 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) } switch (device_type) { - case TYPE_FAILED: - err(udev, "--type=failed is deprecated and will be removed from a future udev release.\n"); - scan_failed(udev_enumerate); - exec_list(udev_enumerate, action); - goto exit; case TYPE_SUBSYSTEMS: udev_enumerate_scan_subsystems(udev_enumerate); exec_list(udev_enumerate, action); diff --git a/udev/udevd.c b/udev/udevd.c index 325ad034c2..77aec9d2ae 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -155,11 +155,7 @@ static void event_queue_delete(struct event *event, bool export) udev_list_node_remove(&event->node); if (export) { - /* mark as failed, if "add" event returns non-zero */ - if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0) - udev_queue_export_device_failed(udev_queue_export, event->dev); - else - udev_queue_export_device_finished(udev_queue_export, event->dev); + udev_queue_export_device_finished(udev_queue_export, event->dev); info(event->udev, "seq %llu done with %i\n", udev_device_get_seqnum(event->dev), event->exitcode); } udev_device_unref(event->dev); @@ -284,7 +280,6 @@ static void worker_new(struct event *event) for (;;) { struct udev_event *udev_event; struct worker_message msg; - int failed = 0; int err; info(udev, "seq %llu running\n", udev_device_get_seqnum(dev)); @@ -304,7 +299,7 @@ static void worker_new(struct event *event) err = udev_event_execute_rules(udev_event, rules, &sigmask_orig); if (err == 0) - failed = udev_event_execute_run(udev_event, &sigmask_orig); + udev_event_execute_run(udev_event, &sigmask_orig); /* apply/restore inotify watch */ if (err == 0 && udev_event->inotify_watch) { @@ -319,8 +314,6 @@ static void worker_new(struct event *event) memset(&msg, 0, sizeof(struct worker_message)); if (err != 0) msg.exitcode = err; - else if (failed != 0) - msg.exitcode = failed; msg.pid = getpid(); send(worker_watch[WRITE_END], &msg, sizeof(struct worker_message), 0); |