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 May 7, 2024
1 parent 431066c commit 02fe427
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions xen-shell-cmd/src/xen_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,28 @@ 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)
{
__maybe_unused struct xen_domain_cfg *cfg;
int i;

ARG_UNUSED(argc);
ARG_UNUSED(argv);

for (i = 0; i < domain_get_user_cfg_count(); i++) {
cfg = domain_get_user_cfg(i);
shell_print(shell, "%s", cfg->name);
}

#ifdef CONFIG_XEN_DOMCFG_SECTION
for (cfg = _domain_configs_start; cfg < _domain_configs_end; cfg++) {
shell_print(shell, "%s", cfg->name);
}
#endif

return 0;
}

SHELL_STATIC_SUBCMD_SET_CREATE(
subcmd_xu,
SHELL_CMD_ARG(create, NULL,
Expand All @@ -157,6 +179,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
" Unpause Xen domain\n"
" Usage: unpause <domid>\n",
domu_unpause, 2, 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, NULL,
" Attach to a domain console.\n"
Expand Down

0 comments on commit 02fe427

Please sign in to comment.