summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.h
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-12-16 16:03:48 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-12-20 16:40:21 +1100
commit78819395e5aa0dbd0c484f7a2512fcf04b87bbf2 (patch)
tree30997019249050238e726935b62cd53fd347c6f7 /discover/device-handler.h
parentca11198f4034266b0f48b37e5871c44d1399aba6 (diff)
downloadtalos-petitboot-78819395e5aa0dbd0c484f7a2512fcf04b87bbf2.tar.gz
talos-petitboot-78819395e5aa0dbd0c484f7a2512fcf04b87bbf2.zip
discover/device-handler: Add aggregated download progress updates
Several processes run by Petitboot output progress information while running. Add device_handler_status_download() which process callers can call to register and update progress information (percentage and current size). A list of 'progress_info' structs holds this progress information, and on each call to device_handler_status_download() the information is combined and displayed as a single status update for readability. On completion device_handler_status_download_remove() is called to remove old progress information from the list. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/device-handler.h')
-rw-r--r--discover/device-handler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/discover/device-handler.h b/discover/device-handler.h
index 874133d..133eff3 100644
--- a/discover/device-handler.h
+++ b/discover/device-handler.h
@@ -11,6 +11,7 @@ struct discover_device;
struct discover_server;
struct boot_option;
struct boot_command;
+struct process_info;
struct event;
struct device;
struct waitset;
@@ -108,6 +109,11 @@ void device_handler_status_dev_info(struct device_handler *handler,
struct discover_device *dev, const char *fmt, ...);
void device_handler_status_dev_err(struct device_handler *handler,
struct discover_device *dev, const char *fmt, ...);
+void device_handler_status_download(struct device_handler *handler,
+ const struct process_info *procinfo,
+ unsigned int percentage, unsigned int size, char suffix);
+void device_handler_status_download_remove(struct device_handler *handler,
+ struct process_info *procinfo);
struct discover_context *device_handler_discover_context_create(
struct device_handler *handler,
OpenPOWER on IntegriCloud