mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 12:30:20 +03:00
[image] Move the register_and_{select|boot}_image() functions to imgmgmt.c
These functions are used only as the "action" parameters to imgdownload() or imgfetch(), and so belong in imgmgmt.c rather than image.c Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -286,42 +286,3 @@ struct image * image_find_selected ( void ) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register and select an image
|
||||
*
|
||||
* @v image Executable image
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int register_and_select_image ( struct image *image ) {
|
||||
int rc;
|
||||
|
||||
if ( ( rc = register_image ( image ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
if ( ( rc = image_probe ( image ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
if ( ( rc = image_select ( image ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register and boot an image
|
||||
*
|
||||
* @v image Image
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int register_and_boot_image ( struct image *image ) {
|
||||
int rc;
|
||||
|
||||
if ( ( rc = register_and_select_image ( image ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
if ( ( rc = image_exec ( image ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user