summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorMichael Brown2011-10-25 02:41:41 +0200
committerMichael Brown2011-10-25 02:41:41 +0200
commit790035f78d6a3b11e049c9df3df41155fd3a12ef (patch)
treee1f81cbf2fbe1fdd5a12062b88b10fd55ca7a668 /src/core/image.c
parent[cmdline] Allow "sleep" command to be interrupted (diff)
downloadipxe-790035f78d6a3b11e049c9df3df41155fd3a12ef.tar.gz
ipxe-790035f78d6a3b11e049c9df3df41155fd3a12ef.tar.xz
ipxe-790035f78d6a3b11e049c9df3df41155fd3a12ef.zip
[image] Eliminate the register_and_xxx_image() functions
All users of imgdownload() require registration of the image, so make registration an integral part of imgdownload() itself and simplify the "action" parameter to be one of image_select(), image_exec() et al. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/image.c b/src/core/image.c
index 86c264c2..b1eba4ad 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -224,8 +224,8 @@ int image_exec ( struct image *image ) {
/* Sanity check */
assert ( image->flags & IMAGE_REGISTERED );
- /* Check that this image can be executed */
- if ( ( rc = image_probe ( image ) ) != 0 )
+ /* Check that this image can be selected for execution */
+ if ( ( rc = image_select ( image ) ) != 0 )
return rc;
/* Switch current working directory to be that of the image itself */
@@ -302,6 +302,10 @@ int image_replace ( struct image *replacement ) {
return rc;
}
+ /* Check that the replacement image can be executed */
+ if ( ( rc = image_probe ( replacement ) ) != 0 )
+ return rc;
+
/* Clear any existing replacement */
image_put ( image->replacement );