diff options
Diffstat (limited to 'ui/twin')
-rw-r--r-- | ui/twin/main-generic.c | 15 | ||||
-rw-r--r-- | ui/twin/pbt-client.c | 17 | ||||
-rw-r--r-- | ui/twin/pbt-client.h | 3 |
3 files changed, 7 insertions, 28 deletions
diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c index 517422e..cc5140e 100644 --- a/ui/twin/main-generic.c +++ b/ui/twin/main-generic.c @@ -199,19 +199,6 @@ fail_menu: return NULL; } -static int boot_cb(struct pbt_client *client, struct pb_opt_data *opt_data) -{ - int result; - - assert(opt_data); - - pb_log("%s: %s\n", __func__, opt_data->name); - - result = pb_boot(opt_data->bd, client->dry_run); - - return result; -} - static int run(struct pbt_client *client) { while (1) { @@ -330,7 +317,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - client = pbt_client_init(opts.backend, 1024, 640, boot_cb, + client = pbt_client_init(opts.backend, 1024, 640, opts.start_daemon, opts.dry_run); if (!client) { diff --git a/ui/twin/pbt-client.c b/ui/twin/pbt-client.c index dfbe955..c664740 100644 --- a/ui/twin/pbt-client.c +++ b/ui/twin/pbt-client.c @@ -62,18 +62,15 @@ static int pbt_client_boot(struct pbt_item *item) pbt_frame_status_printf(&item->pbt_client->frame, "Booting %s...", pbt_item_name(item)); - assert(item->pbt_client->boot_cb); - result = item->pbt_client->boot_cb(item->pbt_client, opt_data); + result = discover_client_boot(item->pbt_client->discover_client, + opt_data->dev, opt_data->opt, opt_data->bd); - if (!result) { - sleep(item->pbt_client->dry_run ? 1 : 60); + if (result) { + pb_log("%s: failed: %s\n", __func__, opt_data->bd->image); + pbt_frame_status_printf(&item->pbt_client->frame, + "Failed: kexec %s", opt_data->bd->image); } - pb_log("%s: failed: %s\n", __func__, opt_data->bd->image); - - pbt_frame_status_printf(&item->pbt_client->frame, "Failed: kexec %s", - opt_data->bd->image); - return 0; } @@ -265,7 +262,6 @@ static void pbt_client_destructor(struct pbt_client *client) struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, unsigned int width, unsigned int height, - int (*boot_cb)(struct pbt_client *, struct pb_opt_data *), int start_deamon, int dry_run) { struct pbt_client *pbt_client; @@ -284,7 +280,6 @@ struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, pbt_client->waitset = waitset_create(pbt_client); pbt_client->sig = "pbt_client"; - pbt_client->boot_cb = boot_cb; pbt_client->dry_run = dry_run; pbt_client->frame.scr = pbt_scr_init(pbt_client, pbt_client->waitset, backend, width, height, NULL, NULL); diff --git a/ui/twin/pbt-client.h b/ui/twin/pbt-client.h index 7e74e4e..2c96d48 100644 --- a/ui/twin/pbt-client.h +++ b/ui/twin/pbt-client.h @@ -45,8 +45,6 @@ struct pbt_client { int dry_run; struct pb_signal_data signal_data; void *client_data; - int (*boot_cb)(struct pbt_client *pbt_client, struct pb_opt_data *pod); - struct pbt_frame frame; struct discover_client *discover_client; struct waitset *waitset; @@ -54,7 +52,6 @@ struct pbt_client { struct pbt_client *pbt_client_init(enum pbt_twin_backend backend, unsigned int width, unsigned int height, - int (*boot_cb)(struct pbt_client *, struct pb_opt_data *), int start_deamon, int dry_run); void pbt_client_destroy(struct pbt_client *client); void pbt_client_resize(struct pbt_client *client); |