diff mbox

[v3,03/15] monitor: register gen:false commands manually

Message ID 20160808141439.16908-4-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau Aug. 8, 2016, 2:14 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since a few commands are using 'gen': false, they are not registered
automatically by the generator. Register manually instead.

This is in preparation for removal of qapi 'middle' mode generation.

Note that this function isn't run yet, until
module_call_init(MODULE_INIT_QAPI) is added in a later patch.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 monitor.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Markus Armbruster Aug. 9, 2016, 7:52 a.m. UTC | #1
marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Since a few commands are using 'gen': false, they are not registered
> automatically by the generator. Register manually instead.
>
> This is in preparation for removal of qapi 'middle' mode generation.
>
> Note that this function isn't run yet, until

"these functions aren't"

Can touch up on commit.

> module_call_init(MODULE_INIT_QAPI) is added in a later patch.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  monitor.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/monitor.c b/monitor.c
> index cb1a0c7..c9191e5 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -79,6 +79,7 @@
>  #include "sysemu/block-backend.h"
>  #include "sysemu/qtest.h"
>  #include "qemu/cutils.h"
> +#include "qapi/qmp/dispatch.h"
>  
>  /* for hmp_info_irq/pic */
>  #if defined(TARGET_SPARC)
> @@ -1000,6 +1001,18 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
>      *ret_data = qobject_from_json(qmp_schema_json);
>  }
>  
> +static void qmp_init_marshal(void)
> +{
> +    qmp_register_command("query-qmp-schema", qmp_query_qmp_schema,
> +                         QCO_NO_OPTIONS);
> +    qmp_register_command("device_add", qmp_device_add,
> +                         QCO_NO_OPTIONS);
> +    qmp_register_command("netdev_add", qmp_netdev_add,
> +                         QCO_NO_OPTIONS);
> +}
> +
> +qapi_init(qmp_init_marshal);
> +
>  /* set the current CPU defined by the user */
>  int monitor_set_cpu(int cpu_index)
>  {
Marc-André Lureau Aug. 9, 2016, 5:16 p.m. UTC | #2
On Tue, Aug 9, 2016 at 11:54 AM Markus Armbruster <armbru@redhat.com> wrote:

> marcandre.lureau@redhat.com writes:
>
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Since a few commands are using 'gen': false, they are not registered
> > automatically by the generator. Register manually instead.
> >
> > This is in preparation for removal of qapi 'middle' mode generation.
> >
> > Note that this function isn't run yet, until
>
> "these functions aren't"
>
> Can touch up on commit.
>

I meant the qmp_init_marshal(), I'll correct the comment.


>
> > module_call_init(MODULE_INIT_QAPI) is added in a later patch.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> > ---
> >  monitor.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/monitor.c b/monitor.c
> > index cb1a0c7..c9191e5 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -79,6 +79,7 @@
> >  #include "sysemu/block-backend.h"
> >  #include "sysemu/qtest.h"
> >  #include "qemu/cutils.h"
> > +#include "qapi/qmp/dispatch.h"
> >
> >  /* for hmp_info_irq/pic */
> >  #if defined(TARGET_SPARC)
> > @@ -1000,6 +1001,18 @@ static void qmp_query_qmp_schema(QDict *qdict,
> QObject **ret_data,
> >      *ret_data = qobject_from_json(qmp_schema_json);
> >  }
> >
> > +static void qmp_init_marshal(void)
> > +{
> > +    qmp_register_command("query-qmp-schema", qmp_query_qmp_schema,
> > +                         QCO_NO_OPTIONS);
> > +    qmp_register_command("device_add", qmp_device_add,
> > +                         QCO_NO_OPTIONS);
> > +    qmp_register_command("netdev_add", qmp_netdev_add,
> > +                         QCO_NO_OPTIONS);
> > +}
> > +
> > +qapi_init(qmp_init_marshal);
> > +
> >  /* set the current CPU defined by the user */
> >  int monitor_set_cpu(int cpu_index)
> >  {
>
> --
Marc-André Lureau
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index cb1a0c7..c9191e5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -79,6 +79,7 @@ 
 #include "sysemu/block-backend.h"
 #include "sysemu/qtest.h"
 #include "qemu/cutils.h"
+#include "qapi/qmp/dispatch.h"
 
 /* for hmp_info_irq/pic */
 #if defined(TARGET_SPARC)
@@ -1000,6 +1001,18 @@  static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
     *ret_data = qobject_from_json(qmp_schema_json);
 }
 
+static void qmp_init_marshal(void)
+{
+    qmp_register_command("query-qmp-schema", qmp_query_qmp_schema,
+                         QCO_NO_OPTIONS);
+    qmp_register_command("device_add", qmp_device_add,
+                         QCO_NO_OPTIONS);
+    qmp_register_command("netdev_add", qmp_netdev_add,
+                         QCO_NO_OPTIONS);
+}
+
+qapi_init(qmp_init_marshal);
+
 /* set the current CPU defined by the user */
 int monitor_set_cpu(int cpu_index)
 {