From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwV35-0003cB-2b for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:26:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwV30-0001qD-Fr for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:26:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwV30-0001q3-7J for qemu-devel@nongnu.org; Mon, 16 Jun 2014 07:25:58 -0400 From: Stefan Hajnoczi Date: Mon, 16 Jun 2014 19:23:38 +0800 Message-Id: <1402917843-6459-15-git-send-email-stefanha@redhat.com> In-Reply-To: <1402917843-6459-1-git-send-email-stefanha@redhat.com> References: <1402917843-6459-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 14/39] QemuOpts: add qemu_opts_print_help to replace print_option_help List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Dong Xu Wang , Chunyan Liu , Stefan Hajnoczi From: Chunyan Liu 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 Reviewed-by: Leandro Dorileo Signed-off-by: Dong Xu Wang Signed-off-by: Chunyan Liu Signed-off-by: Stefan Hajnoczi --- include/qemu/option.h | 1 + util/qemu-option.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/qemu/option.h b/include/qemu/option.h index 6653e43..fbf5dc2 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -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 diff --git a/util/qemu-option.c b/util/qemu-option.c index a7330c6..cd03eb4 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -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) -- 1.9.3