Skip to content

Commit

Permalink
xen-shell-cmd: Add command to list available domain configurations
Browse files Browse the repository at this point in the history
Add a new command to list available domain configurations.

Signed-off-by: Mykyta Poturai <[email protected]>
  • Loading branch information
Deedone committed Apr 17, 2024
1 parent fded070 commit d3f02da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions xen-shell-cmd/src/xen_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,20 @@ int domu_unpause(const struct shell *shell, size_t argc, char **argv)
return domain_unpause(domid);
}

int xen_config_list(const struct shell *shell, size_t argc, char **argv)
{
struct xen_domain_cfg *cfg;

ARG_UNUSED(argc);
ARG_UNUSED(argv);

for (cfg = _domain_configs_start; cfg < _domain_configs_end; cfg++) {
shell_print(shell, "%s\n", cfg->name);
}

return 0;
}

SHELL_STATIC_SUBCMD_SET_CREATE(
subcmd_xu,
SHELL_CMD_ARG(create, NULL,
Expand All @@ -176,6 +190,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
" Unpause Xen domain\n"
" Usage: unpause -d <domid>\n",
domu_unpause, 3, 0),
SHELL_CMD_ARG(config_list, NULL,
" List available domain configurations\n",
xen_config_list, 1, 0),
#ifdef CONFIG_XEN_CONSOLE_SRV
SHELL_CMD_ARG(console_attach, NULL,
" Attach to a domain console.\n"
Expand Down

0 comments on commit d3f02da

Please sign in to comment.