+ struct boot_option *opt;
+ struct device *device;
+
+ assert(event->device);
+
+ device = device_handler_find(handler, event->device);
+
+ if (!device) {
+ device = talloc_zero(handler, struct device);
+
+ if (!device)
+ goto fail;
+
+ device->id = talloc_strdup(device, event->device);
+ list_init(&device->boot_options);
+
+ /* add device to handler device array */
+ device_handler_add(handler, device);
+
+ discover_server_notify_device_add(handler->server, device);
+ }
+
+ opt = parse_user_event(device, event);
+ discover_server_notify_boot_option_add(handler->server, opt);
+
+ return 0;
+
+fail:
+ talloc_free(device);
+ return 0;
+}
+
+static int handle_remove_user_event(struct device_handler *handler,
+ struct event *event)
+{
+ struct device *device = device_handler_find(handler, event->device);
+
+ if (!device)
+ return 0;
+
+ discover_server_notify_device_remove(handler->server, device);