mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 01:22:37 +03:00
[job] Allow job_progress() to return an ongoing job status code, if known
Some background jobs have a meaningful ongoing status code (e.g. the current link status for a job waiting for a network link to come up). Allow this to be exposed via the job_progress() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -131,9 +131,10 @@ static int downloader_ensure_size ( struct downloader *downloader,
|
||||
*
|
||||
* @v downloader Downloader
|
||||
* @v progress Progress report to fill in
|
||||
* @ret ongoing_rc Ongoing job status code (if known)
|
||||
*/
|
||||
static void downloader_progress ( struct downloader *downloader,
|
||||
struct job_progress *progress ) {
|
||||
static int downloader_progress ( struct downloader *downloader,
|
||||
struct job_progress *progress ) {
|
||||
|
||||
/* This is not entirely accurate, since downloaded data may
|
||||
* arrive out of order (e.g. with multicast protocols), but
|
||||
@@ -141,6 +142,8 @@ static void downloader_progress ( struct downloader *downloader,
|
||||
*/
|
||||
progress->completed = downloader->pos;
|
||||
progress->total = downloader->image->len;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user