diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2018-07-03 16:24:58 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-07-30 11:36:30 +1000 |
commit | 06c4975bcdc8b17495160d493846d1c6f2097d85 (patch) | |
tree | 6af9e1df51354ece285c8a9f5cf525e83106e611 /discover/device-handler.h | |
parent | c208aa42024fddc74682742bec12735e432a5510 (diff) | |
download | talos-petitboot-06c4975bcdc8b17495160d493846d1c6f2097d85.tar.gz talos-petitboot-06c4975bcdc8b17495160d493846d1c6f2097d85.zip |
discover: implement a periodic requery for network devices
If we boot a machine before external (network) dependencies are properly
configured, it will have tried once to download configuration, and
possibly failed due to that configuration not being present.
This change introduces a periodic requery of network resources. After a
timeout, petitboot will either re-acquire its DHCP lease (causing any
downloads to be re-processed, possibly with different parameters from
the new lease), or re-download a statically defined URL.
This timeout defaults to five minutes (similar to pxelinux), and is
configurable by DHCP option 211, "reboot time".
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
[added test stub]
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
(cherry picked from commit 6fa0edfb029726968cbacad9d4e193a345956ff3)
Diffstat (limited to 'discover/device-handler.h')
-rw-r--r-- | discover/device-handler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discover/device-handler.h b/discover/device-handler.h index 771cd06..427a94a 100644 --- a/discover/device-handler.h +++ b/discover/device-handler.h @@ -38,6 +38,8 @@ struct discover_device { struct list boot_options; struct list params; + + struct waiter *requery_waiter; }; struct discover_boot_option { @@ -102,6 +104,8 @@ int device_handler_dhcp(struct device_handler *handler, struct discover_device *dev, struct event *event); void device_handler_remove(struct device_handler *handler, struct discover_device *device); +void device_handler_start_requery_timeout( struct device_handler *handler, + struct discover_device *dev, int timeout); void device_handler_status(struct device_handler *handler, struct status *status); |