Skip to content

Commit

Permalink
QemuOpts: add qemu_opts_print_help to replace print_option_help
Browse files Browse the repository at this point in the history
print_option_help takes QEMUOptionParameter as parameter, add
qemu_opts_print_help to take QemuOptsList as parameter for later
replace work.

Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Leandro Dorileo <[email protected]>
Signed-off-by: Dong Xu Wang <[email protected]>
Signed-off-by: Chunyan Liu <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Chunyan Liu authored and stefanhaRH committed Jun 16, 2014
1 parent 782730b commit 504189a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/qemu/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,6 @@ typedef int (*qemu_opts_loopfunc)(QemuOpts *opts, void *opaque);
void qemu_opts_print(QemuOpts *opts);
int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque,
int abort_on_failure);
void qemu_opts_print_help(QemuOptsList *list);

#endif
13 changes: 13 additions & 0 deletions util/qemu-option.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,19 @@ void print_option_help(QEMUOptionParameter *list)
}
}

void qemu_opts_print_help(QemuOptsList *list)
{
QemuOptDesc *desc;

assert(list);
desc = list->desc;
printf("Supported options:\n");
while (desc && desc->name) {
printf("%-16s %s\n", desc->name,
desc->help ? desc->help : "No description available");
desc++;
}
}
/* ------------------------------------------------------------------ */

static QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name)
Expand Down

0 comments on commit 504189a

Please sign in to comment.