[Top][All Lists]

[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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout
Date: Fri, 7 Sep 2018 08:46:16 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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>

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]