qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02
@ 2019-07-02 11:43 Markus Armbruster
  2019-07-02 11:43 ` [Qemu-devel] [PULL v2 07/18] qom: Move HMP command handlers to qom/ Markus Armbruster
  2019-07-03 12:38 ` [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2019-07-02 11:43 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 7d0e02405fc02a181319b1ab8681d2f72246b7c6:

  Merge remote-tracking branch 'remotes/vivier2/tags/trivial-patches-pull-request' into staging (2019-07-01 17:40:32 +0100)

are available in the Git repository at:

  git://repo.or.cz/qemu/armbru.git tags/pull-monitor-2019-07-02-v2

for you to fetch changes up to 2608b3df8f9cd91baee9d04e246a0255dbb612db:

  dump: Move HMP command handlers to dump/ (2019-07-02 13:37:00 +0200)

----------------------------------------------------------------
Monitor patches for 2019-07-02

v2: Correct PATCH 7

----------------------------------------------------------------
Markus Armbruster (17):
      MAINTAINERS: Make section "QOM" cover qdev as well
      Makefile: Don't add monitor/ twice to common-obj-y
      hmp: Move hmp.h to include/monitor/
      qapi: Split qom.json and qdev.json off misc.json
      qom: Move QMP command handlers to qom/
      qom: Move HMP command handlers to qom/
      MAINTAINERS: Merge sections CPU, NUMA into Machine core
      qapi: Split machine.json off misc.json
      hw/core: Move numa.c to hw/core/
      hw/core: Collect QMP command handlers in hw/core/
      hw/core: Collect HMP command handlers in hw/core/
      qapi: Split machine-target.json off target.json and misc.json
      qapi: Rename target.json to misc-target.json
      qapi: Split dump.json off misc.json
      dump: Move the code to dump/
      MAINTAINERS: Add Windows dump to section "Dump"
      dump: Move HMP command handlers to dump/

Paolo Bonzini (1):
      MAINTAINERS: new maintainers for QOM

 MAINTAINERS                               |   36 +-
 Makefile.objs                             |    2 +-
 Makefile.target                           |    5 +-
 cpus.c                                    |  187 -----
 dump/Makefile.objs                        |    3 +
 dump/dump-hmp-cmds.c                      |   88 ++
 dump.c => dump/dump.c                     |    4 +-
 win_dump.c => dump/win_dump.c             |    0
 win_dump.h => dump/win_dump.h             |    0
 hw/block/xen-block.c                      |    2 +-
 hw/core/Makefile.objs                     |    4 +
 hw/core/machine-hmp-cmds.c                |  164 ++++
 hw/core/machine-qmp-cmds.c                |  328 ++++++++
 numa.c => hw/core/numa.c                  |   64 +-
 hw/core/qdev.c                            |    2 +-
 hw/ppc/spapr_rtc.c                        |    2 +-
 hw/s390x/s390-skeys.c                     |    2 +-
 hw/timer/mc146818rtc.c                    |    4 +-
 include/hw/boards.h                       |    1 +
 hmp.h => include/monitor/hmp.h            |    4 +
 include/monitor/qdev.h                    |    1 -
 include/sysemu/dump.h                     |    2 +-
 include/sysemu/hostmem.h                  |    2 +-
 include/sysemu/numa.h                     |    2 +
 monitor/hmp-cmds.c                        |  238 +-----
 monitor/misc.c                            |   47 +-
 monitor/qmp-cmds.c                        |  315 +------
 qapi/Makefile.objs                        |    7 +-
 qapi/dump.json                            |  200 +++++
 qapi/{target.json => machine-target.json} |  304 ++-----
 qapi/machine.json                         |  697 +++++++++++++++
 qapi/misc-target.json                     |  268 ++++++
 qapi/misc.json                            | 1304 -----------------------------
 qapi/qapi-schema.json                     |    7 +-
 qapi/qdev.json                            |  125 +++
 qapi/qom.json                             |  244 ++++++
 qdev-monitor.c                            |   59 +-
 qom/Makefile.objs                         |    1 +
 qom/qom-hmp-cmds.c                        |  120 +++
 qom/qom-qmp-cmds.c                        |  323 +++++++
 target/arm/helper.c                       |    2 +-
 target/arm/monitor.c                      |    2 +-
 target/i386/cpu.c                         |    4 +-
 target/i386/monitor.c                     |    2 +-
 target/i386/sev_i386.h                    |    2 +-
 target/mips/helper.c                      |    2 +-
 target/nios2/monitor.c                    |    2 +-
 target/ppc/monitor.c                      |    2 +-
 target/ppc/translate_init.inc.c           |    2 +-
 target/s390x/cpu.c                        |    2 +-
 target/s390x/cpu_models.c                 |    2 +-
 target/s390x/sigp.c                       |    2 +-
 target/sh4/monitor.c                      |    2 +-
 target/sparc/monitor.c                    |    2 +-
 target/xtensa/monitor.c                   |    2 +-
 vl.c                                      |   45 -
 56 files changed, 2695 insertions(+), 2550 deletions(-)
 create mode 100644 dump/Makefile.objs
 create mode 100644 dump/dump-hmp-cmds.c
 rename dump.c => dump/dump.c (99%)
 rename win_dump.c => dump/win_dump.c (100%)
 rename win_dump.h => dump/win_dump.h (100%)
 create mode 100644 hw/core/machine-hmp-cmds.c
 create mode 100644 hw/core/machine-qmp-cmds.c
 rename numa.c => hw/core/numa.c (90%)
 rename hmp.h => include/monitor/hmp.h (98%)
 create mode 100644 qapi/dump.json
 rename qapi/{target.json => machine-target.json} (61%)
 create mode 100644 qapi/machine.json
 create mode 100644 qapi/misc-target.json
 create mode 100644 qapi/qdev.json
 create mode 100644 qapi/qom.json
 create mode 100644 qom/qom-hmp-cmds.c
 create mode 100644 qom/qom-qmp-cmds.c

-- 
2.21.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL v2 07/18] qom: Move HMP command handlers to qom/
  2019-07-02 11:43 [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Markus Armbruster
@ 2019-07-02 11:43 ` Markus Armbruster
  2019-07-03 12:38 ` [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2019-07-02 11:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Daniel P. Berrange, Eduardo Habkost,
	Dr. David Alan Gilbert

Move the HMP command handlers related to QOM handlers from
monitor/hmp-cmds.c and qdev-monitor.c to new qom/qom-hmp-cmds.c, where
they are covered by MAINTAINERS section QOM.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190619201050.19040-7-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
[Also move hmp_info_qom_tree(), tweak commit message accordingly]
---
 include/monitor/hmp.h  |   3 ++
 include/monitor/qdev.h |   1 -
 monitor/hmp-cmds.c     |  50 +----------------
 qdev-monitor.c         |  57 --------------------
 qom/Makefile.objs      |   2 +-
 qom/qom-hmp-cmds.c     | 120 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 125 insertions(+), 108 deletions(-)
 create mode 100644 qom/qom-hmp-cmds.c

diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index 1d095d5837..b36ebccd29 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -16,6 +16,8 @@
 
 #include "qemu/readline.h"
 
+void hmp_handle_error(Monitor *mon, Error **errp);
+
 void hmp_info_name(Monitor *mon, const QDict *qdict);
 void hmp_info_version(Monitor *mon, const QDict *qdict);
 void hmp_info_kvm(Monitor *mon, const QDict *qdict);
@@ -118,6 +120,7 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_devices(Monitor *mon, const QDict *qdict);
 void hmp_qom_list(Monitor *mon, const QDict *qdict);
 void hmp_qom_set(Monitor *mon, const QDict *qdict);
+void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
 void object_add_completion(ReadLineState *rs, int nb_args, const char *str);
 void object_del_completion(ReadLineState *rs, int nb_args, const char *str);
 void device_add_completion(ReadLineState *rs, int nb_args, const char *str);
diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h
index 0ff3331284..084799e4d9 100644
--- a/include/monitor/qdev.h
+++ b/include/monitor/qdev.h
@@ -7,7 +7,6 @@
 
 void hmp_info_qtree(Monitor *mon, const QDict *qdict);
 void hmp_info_qdm(Monitor *mon, const QDict *qdict);
-void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
 void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp);
 
 int qdev_device_help(QemuOpts *opts);
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index d94ab7563e..5641036dc3 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -60,7 +60,7 @@
 #include <spice/enums.h>
 #endif
 
-static void hmp_handle_error(Monitor *mon, Error **errp)
+void hmp_handle_error(Monitor *mon, Error **errp)
 {
     assert(errp);
     if (*errp) {
@@ -2714,54 +2714,6 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
     qapi_free_IOThreadInfoList(info_list);
 }
 
-void hmp_qom_list(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_try_str(qdict, "path");
-    ObjectPropertyInfoList *list;
-    Error *err = NULL;
-
-    if (path == NULL) {
-        monitor_printf(mon, "/\n");
-        return;
-    }
-
-    list = qmp_qom_list(path, &err);
-    if (err == NULL) {
-        ObjectPropertyInfoList *start = list;
-        while (list != NULL) {
-            ObjectPropertyInfo *value = list->value;
-
-            monitor_printf(mon, "%s (%s)\n",
-                           value->name, value->type);
-            list = list->next;
-        }
-        qapi_free_ObjectPropertyInfoList(start);
-    }
-    hmp_handle_error(mon, &err);
-}
-
-void hmp_qom_set(Monitor *mon, const QDict *qdict)
-{
-    const char *path = qdict_get_str(qdict, "path");
-    const char *property = qdict_get_str(qdict, "property");
-    const char *value = qdict_get_str(qdict, "value");
-    Error *err = NULL;
-    bool ambiguous = false;
-    Object *obj;
-
-    obj = object_resolve_path(path, &ambiguous);
-    if (obj == NULL) {
-        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
-                  "Device '%s' not found", path);
-    } else {
-        if (ambiguous) {
-            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
-        }
-        object_property_parse(obj, value, property, &err);
-    }
-    hmp_handle_error(mon, &err);
-}
-
 void hmp_rocker(Monitor *mon, const QDict *qdict)
 {
     const char *name = qdict_get_str(qdict, "name");
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 63a87e9632..58222c2211 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -739,63 +739,6 @@ void hmp_info_qdm(Monitor *mon, const QDict *qdict)
     qdev_print_devinfos(true);
 }
 
-typedef struct QOMCompositionState {
-    Monitor *mon;
-    int indent;
-} QOMCompositionState;
-
-static void print_qom_composition(Monitor *mon, Object *obj, int indent);
-
-static int print_qom_composition_child(Object *obj, void *opaque)
-{
-    QOMCompositionState *s = opaque;
-
-    print_qom_composition(s->mon, obj, s->indent);
-
-    return 0;
-}
-
-static void print_qom_composition(Monitor *mon, Object *obj, int indent)
-{
-    QOMCompositionState s = {
-        .mon = mon,
-        .indent = indent + 2,
-    };
-    char *name;
-
-    if (obj == object_get_root()) {
-        name = g_strdup("");
-    } else {
-        name = object_get_canonical_path_component(obj);
-    }
-    monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
-                   object_get_typename(obj));
-    g_free(name);
-    object_child_foreach(obj, print_qom_composition_child, &s);
-}
-
-void hmp_info_qom_tree(Monitor *mon, const QDict *dict)
-{
-    const char *path = qdict_get_try_str(dict, "path");
-    Object *obj;
-    bool ambiguous = false;
-
-    if (path) {
-        obj = object_resolve_path(path, &ambiguous);
-        if (!obj) {
-            monitor_printf(mon, "Path '%s' could not be resolved.\n", path);
-            return;
-        }
-        if (ambiguous) {
-            monitor_printf(mon, "Warning: Path '%s' is ambiguous.\n", path);
-            return;
-        }
-    } else {
-        obj = qdev_get_machine();
-    }
-    print_qom_composition(mon, obj, 0);
-}
-
 void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp)
 {
     Error *local_err = NULL;
diff --git a/qom/Makefile.objs b/qom/Makefile.objs
index 5fb43b842c..aae478fc21 100644
--- a/qom/Makefile.objs
+++ b/qom/Makefile.objs
@@ -2,4 +2,4 @@ qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
 
 common-obj-y = cpu.o
-common-obj-$(CONFIG_SOFTMMU) += qom-qmp-cmds.o
+common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
new file mode 100644
index 0000000000..a268e01eb4
--- /dev/null
+++ b/qom/qom-hmp-cmds.c
@@ -0,0 +1,120 @@
+/*
+ * HMP commands related to QOM
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later.  See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/qdev-core.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-qom.h"
+#include "qapi/qmp/qdict.h"
+#include "qom/object.h"
+
+void hmp_qom_list(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_try_str(qdict, "path");
+    ObjectPropertyInfoList *list;
+    Error *err = NULL;
+
+    if (path == NULL) {
+        monitor_printf(mon, "/\n");
+        return;
+    }
+
+    list = qmp_qom_list(path, &err);
+    if (err == NULL) {
+        ObjectPropertyInfoList *start = list;
+        while (list != NULL) {
+            ObjectPropertyInfo *value = list->value;
+
+            monitor_printf(mon, "%s (%s)\n",
+                           value->name, value->type);
+            list = list->next;
+        }
+        qapi_free_ObjectPropertyInfoList(start);
+    }
+    hmp_handle_error(mon, &err);
+}
+
+void hmp_qom_set(Monitor *mon, const QDict *qdict)
+{
+    const char *path = qdict_get_str(qdict, "path");
+    const char *property = qdict_get_str(qdict, "property");
+    const char *value = qdict_get_str(qdict, "value");
+    Error *err = NULL;
+    bool ambiguous = false;
+    Object *obj;
+
+    obj = object_resolve_path(path, &ambiguous);
+    if (obj == NULL) {
+        error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
+                  "Device '%s' not found", path);
+    } else {
+        if (ambiguous) {
+            monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
+        }
+        object_property_parse(obj, value, property, &err);
+    }
+    hmp_handle_error(mon, &err);
+}
+
+typedef struct QOMCompositionState {
+    Monitor *mon;
+    int indent;
+} QOMCompositionState;
+
+static void print_qom_composition(Monitor *mon, Object *obj, int indent);
+
+static int print_qom_composition_child(Object *obj, void *opaque)
+{
+    QOMCompositionState *s = opaque;
+
+    print_qom_composition(s->mon, obj, s->indent);
+
+    return 0;
+}
+
+static void print_qom_composition(Monitor *mon, Object *obj, int indent)
+{
+    QOMCompositionState s = {
+        .mon = mon,
+        .indent = indent + 2,
+    };
+    char *name;
+
+    if (obj == object_get_root()) {
+        name = g_strdup("");
+    } else {
+        name = object_get_canonical_path_component(obj);
+    }
+    monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
+                   object_get_typename(obj));
+    g_free(name);
+    object_child_foreach(obj, print_qom_composition_child, &s);
+}
+
+void hmp_info_qom_tree(Monitor *mon, const QDict *dict)
+{
+    const char *path = qdict_get_try_str(dict, "path");
+    Object *obj;
+    bool ambiguous = false;
+
+    if (path) {
+        obj = object_resolve_path(path, &ambiguous);
+        if (!obj) {
+            monitor_printf(mon, "Path '%s' could not be resolved.\n", path);
+            return;
+        }
+        if (ambiguous) {
+            monitor_printf(mon, "Warning: Path '%s' is ambiguous.\n", path);
+            return;
+        }
+    } else {
+        obj = qdev_get_machine();
+    }
+    print_qom_composition(mon, obj, 0);
+}
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02
  2019-07-02 11:43 [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Markus Armbruster
  2019-07-02 11:43 ` [Qemu-devel] [PULL v2 07/18] qom: Move HMP command handlers to qom/ Markus Armbruster
@ 2019-07-03 12:38 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2019-07-03 12:38 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

On Tue, 2 Jul 2019 at 12:47, Markus Armbruster <armbru@redhat.com> wrote:
>
> The following changes since commit 7d0e02405fc02a181319b1ab8681d2f72246b7c6:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/trivial-patches-pull-request' into staging (2019-07-01 17:40:32 +0100)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-monitor-2019-07-02-v2
>
> for you to fetch changes up to 2608b3df8f9cd91baee9d04e246a0255dbb612db:
>
>   dump: Move HMP command handlers to dump/ (2019-07-02 13:37:00 +0200)
>
> ----------------------------------------------------------------
> Monitor patches for 2019-07-02
>
> v2: Correct PATCH 7


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-03 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 11:43 [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Markus Armbruster
2019-07-02 11:43 ` [Qemu-devel] [PULL v2 07/18] qom: Move HMP command handlers to qom/ Markus Armbruster
2019-07-03 12:38 ` [Qemu-devel] [PULL v2 00/18] Monitor patches for 2019-07-02 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).