From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwWP-0005r6-9s for qemu-devel@nongnu.org; Thu, 01 May 2014 15:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfwWJ-0006sq-RD for qemu-devel@nongnu.org; Thu, 01 May 2014 15:19:53 -0400 Received: from mail-yh0-f46.google.com ([209.85.213.46]:61765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfwWJ-0006si-MU for qemu-devel@nongnu.org; Thu, 01 May 2014 15:19:47 -0400 Received: by mail-yh0-f46.google.com with SMTP id 29so926025yhl.33 for ; Thu, 01 May 2014 12:19:47 -0700 (PDT) Date: Thu, 1 May 2014 16:19:51 -0300 From: Leandro Dorileo Message-ID: <20140501191951.GH29944@dorilex-lnv.MultilaserAP> References: <1398762521-25733-1-git-send-email-cyliu@suse.com> <1398762521-25733-9-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1398762521-25733-9-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH V26 08/32] QemuOpts: add qemu_opts_print_help to replace print_option_help List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Apr 29, 2014 at 05:08:17PM +0800, Chunyan Liu wrote: > 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 > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu Reviewed-by: Leandro Dorileo > --- > 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 32e1d50..adb7c3c 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.8.4.5 > > -- Leandro Dorileo