diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-04-30 14:38:43 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-05-05 15:34:42 +1000 |
commit | 120855d64d783aa3b3b0af23923da0169319c338 (patch) | |
tree | 53fa6677aefce534d01189c7ed204dbb2a01d61a /discover/device-handler.c | |
parent | 7946d9b12cec7b49334fc0db6bc23087f2cea8ad (diff) | |
download | talos-petitboot-120855d64d783aa3b3b0af23923da0169319c338.tar.gz talos-petitboot-120855d64d783aa3b3b0af23923da0169319c338.zip |
discover: Display devices currently being parsed
Send a short message to the UI to inform the user a device is being
parsed for boot options. This helps slightly in environments when the UI
appears well before devices are available for parsing, giving the user
an indication that work is still being done.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'discover/device-handler.c')
-rw-r--r-- | discover/device-handler.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c index 487f2e7..d95a37c 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -755,8 +755,16 @@ int device_handler_discover(struct device_handler *handler, struct discover_device *dev) { struct discover_context *ctx; + struct boot_status *status; int rc; + status = talloc_zero(handler, struct boot_status); + status->type = BOOT_STATUS_INFO; + status->message = talloc_asprintf(status, "Processing %s device %s", + device_type_display_name(dev->device->type), + dev->device->id); + boot_status(handler, status); + process_boot_option_queue(handler); /* create our context */ @@ -777,6 +785,11 @@ int device_handler_discover(struct device_handler *handler, device_handler_discover_context_commit(handler, ctx); out: + status->message = talloc_asprintf(status,"Processing %s complete\n", + dev->device->id); + boot_status(handler, status); + + talloc_free(status); talloc_free(ctx); return 0; @@ -787,6 +800,13 @@ int device_handler_dhcp(struct device_handler *handler, struct discover_device *dev, struct event *event) { struct discover_context *ctx; + struct boot_status *status; + + status = talloc_zero(handler, struct boot_status); + status->type = BOOT_STATUS_INFO; + status->message = talloc_asprintf(status, "Processing dhcp event on %s", + dev->device->id); + boot_status(handler, status); /* create our context */ ctx = device_handler_discover_context_create(handler, dev); @@ -796,6 +816,11 @@ int device_handler_dhcp(struct device_handler *handler, device_handler_discover_context_commit(handler, ctx); + status->message = talloc_asprintf(status,"Processing %s complete\n", + dev->device->id); + boot_status(handler, status); + + talloc_free(status); talloc_free(ctx); return 0; @@ -806,6 +831,12 @@ int device_handler_conf(struct device_handler *handler, struct discover_device *dev, struct pb_url *url) { struct discover_context *ctx; + struct boot_status *status; + + status = talloc_zero(handler, struct boot_status); + status->type = BOOT_STATUS_INFO; + status->message = talloc_asprintf(status, "Processing user config"); + boot_status(handler, status); /* create our context */ ctx = device_handler_discover_context_create(handler, dev); @@ -815,6 +846,11 @@ int device_handler_conf(struct device_handler *handler, device_handler_discover_context_commit(handler, ctx); + status->message = talloc_asprintf(status, + "Processing user config complete"); + boot_status(handler, status); + + talloc_free(status); talloc_free(ctx); return 0; |