[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout |
Date: |
Fri, 7 Sep 2018 22:53:56 +0400 |
Hi
On Fri, Sep 7, 2018 at 5:49 PM Eric Blake <address@hidden> wrote:
>
> On 09/07/2018 02:59 AM, Marc-André Lureau wrote:
> > qdev_device_help() is used from command line "-device help", or from
> > HMP "device_add". If used from command line, print help to stdout
> > (it is only printed on explicit demand).
> >
> > Signed-off-by: Marc-André Lureau <address@hidden>
> > ---
> > include/monitor/monitor.h | 2 ++
> > monitor.c | 16 +++++++++++++---
> > qdev-monitor.c | 32 +++++++++++++++++++-------------
> > 3 files changed, 34 insertions(+), 16 deletions(-)
> >
> > diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
> > index 2ef5e04b37..e7667fda35 100644
> > --- a/include/monitor/monitor.h
> > +++ b/include/monitor/monitor.h
> > @@ -47,4 +47,6 @@ int monitor_fdset_dup_fd_add(int64_t fdset_id, int
> > dup_fd);
> > void monitor_fdset_dup_fd_remove(int dup_fd);
> > int monitor_fdset_dup_fd_find(int dup_fd);
> >
> > +void out_vprintf(FILE *stream, const char *fmt, va_list ap)
> > GCC_FMT_ATTR(2, 0);
>
> Perhaps name this monitor_vfprintf()? (That would match the fact that
> you are using it like normal vfprintf).
>
> > +++ b/qdev-monitor.c
> > @@ -104,22 +104,31 @@ static bool qdev_class_has_alias(DeviceClass *dc)
> > return (qdev_class_get_alias(dc) != NULL);
> > }
> >
> > +static void out_printf(const char *fmt, ...)
> > +{
> > + va_list ap;
> > +
> > + va_start(ap, fmt);
> > + out_vprintf(stdout, fmt, ap);
> > + va_end(ap);
> > +}
>
> But this name seems reasonable.
>
> And I just now see that Thomas also complained about the monitor.h
> naming, but I like 'monitor_vfprintf' better than his 'mon_file_vprintf'.
>
> If an improved name is your only change,
> Reviewed-by: Eric Blake <address@hidden>
I'll change it to monitor_vfprintf,
thanks
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc. +1-919-301-3266
> Virtualization: qemu.org | libvirt.org
>
--
Marc-André Lureau
- [Qemu-devel] [PATCH v2 00/12] Various qemu command line options help improvements, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 03/12] qemu-option: add help fallback to print the list of options, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 04/12] qemu-option: improve qemu_opts_print_help() output, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 05/12] qom/object: fix iterating properties over a class, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 07/12] tests/qom-proplist: check duplicate "bv" property registration failed, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 06/12] qom/object: register 'type' property as class property, Marc-André Lureau, 2018/09/07