6 #include "talloc/talloc.h"
8 #include "parser-utils.h"
11 * parse_user_event - Parse a user event.
13 * Understands params: name, image, args.
16 struct boot_option *parse_user_event(struct device *device, struct event *event)
18 struct boot_option *opt;
21 opt = talloc_zero(device, struct boot_option);
26 p = event_get_param(event, "name");
29 pb_log("%s: no name found\n", __func__);
33 opt->id = talloc_asprintf(opt, "%s#%s", device->id, p);
34 opt->device_id = talloc_strdup(opt, device->id);
35 opt->name = talloc_strdup(opt, p);
37 p = event_get_param(event, "image");
41 pb_log("%s: no image found\n", __func__);
45 opt->boot_image_file = talloc_strdup(opt, p);
47 p = event_get_param(event, "args");
50 opt->boot_args = talloc_strdup(opt, p);
52 opt->description = talloc_asprintf(opt, "%s %s", opt->boot_image_file,
55 device_add_boot_option(device, opt);