4 #include "ui/common/discover-client.h"
6 static int print_device_add(struct device *device,
7 void __attribute__((unused)) *arg)
9 struct boot_option *opt;
11 printf("new device:\n");
12 printf("\tid: %s\n", device->id);
13 printf("\tname: %s\n", device->name);
14 printf("\tdesc: %s\n", device->description);
15 printf("\ticon: %s\n", device->icon_file);
17 printf("\tboot options:\n");
18 list_for_each_entry(&device->boot_options, opt, list) {
19 printf("\t\tid: %s\n", opt->id);
20 printf("\t\tname: %s\n", opt->name);
21 printf("\t\tdesc: %s\n", opt->description);
22 printf("\t\ticon: %s\n", opt->icon_file);
23 printf("\t\tboot: %s\n", opt->boot_image_file);
24 printf("\t\tinit: %s\n", opt->initrd_file);
25 printf("\t\targs: %s\n", opt->boot_args);
31 static void print_device_remove(struct device *device,
32 void __attribute__((unused)) *arg)
34 printf("removed device:\n");
35 printf("\tid: %s\n", device->id);
36 printf("\tname: %s\n", device->name);
39 static struct discover_client_ops client_ops = {
40 .device_add = print_device_add,
41 .device_remove = print_device_remove,
46 struct discover_client *client;
48 client = discover_client_init(&client_ops, NULL);
55 rc = discover_client_process(client);