mirror of
https://github.com/ipxe/ipxe
synced 2025-12-24 15:23:42 +03:00
[image] Simplify image management commands and internal API
Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -114,28 +114,6 @@ int parse_netdev ( const char *text, struct net_device **netdev ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse image name
|
||||
*
|
||||
* @v text Text
|
||||
* @ret image Image
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int parse_image ( const char *text, struct image **image ) {
|
||||
|
||||
/* Sanity check */
|
||||
assert ( text != NULL );
|
||||
|
||||
/* Find network device */
|
||||
*image = find_image ( text );
|
||||
if ( ! *image ) {
|
||||
printf ( "\"%s\": no such image\n", text );
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse flag
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user