|
| | FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
| |
| static int | imgsingle_exec (int argc, char **argv, struct imgsingle_descriptor *desc) |
| | The "img{single}" family of commands. More...
|
| |
| static int | imgfetch_exec (int argc, char **argv) |
| | The "imgfetch" command. More...
|
| |
| static int | imgselect (struct image *image, struct imgsingle_options *opts __unused) |
| | "imgselect" command action More...
|
| |
| static int | imgselect_exec (int argc, char **argv) |
| | The "imgselect" command. More...
|
| |
| static int | imgexec (struct image *image, struct imgsingle_options *opts) |
| | "imgexec" command action More...
|
| |
| static int | imgexec_exec (int argc, char **argv) |
| | The "imgexec" command. More...
|
| |
| static int | imgargs_exec (int argc, char **argv) |
| | The "imgargs" command body. More...
|
| |
| static int | imgmulti_exec (int argc, char **argv, void(*payload)(struct image *image)) |
| | The "img{multi}" family of commands. More...
|
| |
| static int | imgstat_exec (int argc, char **argv) |
| | The "imgstat" command. More...
|
| |
| static int | imgfree_exec (int argc, char **argv) |
| | The "imgfree" command. More...
|
| |
| | COMMAND (imgfetch, imgfetch_exec) |
| |
| | COMMAND (module, imgfetch_exec) |
| |
| | COMMAND (initrd, imgfetch_exec) |
| |
| | COMMAND (imgselect, imgselect_exec) |
| |
| | COMMAND (imgload, imgselect_exec) |
| |
| | COMMAND (kernel, imgselect_exec) |
| |
| | COMMAND (imgexec, imgexec_exec) |
| |
| | COMMAND (chain, imgexec_exec) |
| |
| | COMMAND (boot, imgexec_exec) |
| |
| | COMMAND (imgargs, imgargs_exec) |
| |
| | COMMAND (imgstat, imgstat_exec) |
| |
| | COMMAND (imgfree, imgfree_exec) |
| |
Image management commands.
Definition in file image_cmd.c.
The "img{single}" family of commands.
- Parameters
-
| argc | Argument count |
| argv | Argument list |
| desc | "img{single}" command descriptor |
| action_name | Action name (for error messages) |
| action | Action to take upon image |
- Return values
-
Definition at line 103 of file image_cmd.c.
106 char *name_uri =
NULL;
113 goto err_parse_options;
122 goto err_parse_cmdline;
129 if ( (
rc =
desc->acquire ( name_uri,
opts.timeout,
135 printf (
"No image selected\n" );
141 if (
desc->preaction )
147 printf (
"Could not name image: %s\n",
156 printf (
"Could not set arguments: %s\n",
158 goto err_set_cmdline;
167 if (
desc->action ) {
169 printf (
"Could not %s: %s\n",
struct image_tag selected_image
struct arbelprm_rc_send_wqe rc
int printf(const char *fmt,...)
Write a formatted string to the console.
int optind
Current option index.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
#define IMAGE_AUTO_UNREGISTER
Image will be automatically unregistered after execution.
struct image * find_image_tag(struct image_tag *tag)
Find image by tag.
struct ena_llq_option desc
Descriptor counts.
#define ENOMEM
Not enough space.
char * concat_args(char **args)
Concatenate arguments.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
int image_set_name(struct image *image, const char *name)
Set image name.
int image_set_cmdline(struct image *image, const char *cmdline)
Set image command line.
#define NULL
NULL pointer (VOID *)
static union @448 opts
"img{single}" option list
References cmdline, concat_args(), desc, ENOMEM, find_image_tag(), image::flags, free, IMAGE_AUTO_UNREGISTER, image_set_cmdline(), image_set_name(), NULL, optind, opts, parse_options(), printf(), rc, selected_image, and strerror().
Referenced by imgargs_exec(), imgexec_exec(), imgfetch_exec(), and imgselect_exec().
| static int imgmulti_exec |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
void(*)(struct image *image) |
payload |
|
) |
| |
|
static |
The "img{multi}" family of commands.
- Parameters
-
| argc | Argument count |
| argv | Argument list |
| payload | Function to execute on each image |
- Return values
-
Definition at line 342 of file image_cmd.c.
362 for ( i =
optind ; i < argc ; i++ ) {
365 printf (
"\"%s\": no such image\n", argv[i] );
struct arbelprm_rc_send_wqe rc
int printf(const char *fmt,...)
Write a formatted string to the console.
int optind
Current option index.
struct image * find_image(const char *name)
Find image by name.
#define ENOENT
No such file or directory.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
#define for_each_image_safe(image, tmp)
Iterate over all registered images, safe against deletion.
static struct command_descriptor imgmulti_cmd
"img{multi}" command descriptor
static union @448 opts
"img{single}" option list
References ENOENT, find_image(), for_each_image_safe, imgmulti_cmd, optind, opts, parse_options(), printf(), rc, and tmp.
Referenced by imgfree_exec(), and imgstat_exec().