QemuOpts: add qemu_opts_print_help to replace print_option_help

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 <eblake@redhat.com>
Reviewed-by: Leandro Dorileo <l@dorileo.org>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Chunyan Liu 2014-06-05 17:20:47 +08:00 committed by Stefan Hajnoczi
parent 782730b0bc
commit 504189a96f
2 changed files with 14 additions and 0 deletions

View file

@ -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)