diff mbox

[v2,05/12] monitor: register the qapi generated commands

Message ID 20160721140030.28383-6-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

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

Stop using the so-called 'middle' mode. Instead, use qmp_find_command()
from generated qapi commands registry.

Note: this commit requires a 'make clean' prior to make, since the
generated files do not depend on Makefile (due to a cyclic rule
introduced in 4115852bb0).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 monitor.c       |  15 ++++--
 Makefile        |   2 +-
 qmp-commands.hx | 143 --------------------------------------------------------
 vl.c            |   1 +
 4 files changed, 13 insertions(+), 148 deletions(-)

Comments

Eric Blake July 21, 2016, 8:56 p.m. UTC | #1
On 07/21/2016 08:00 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Stop using the so-called 'middle' mode. Instead, use qmp_find_command()
> from generated qapi commands registry.
> 
> Note: this commit requires a 'make clean' prior to make, since the
> generated files do not depend on Makefile (due to a cyclic rule
> introduced in 4115852bb0).
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  monitor.c       |  15 ++++--
>  Makefile        |   2 +-
>  qmp-commands.hx | 143 --------------------------------------------------------
>  vl.c            |   1 +
>  4 files changed, 13 insertions(+), 148 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>
Markus Armbruster Aug. 5, 2016, 12:42 p.m. UTC | #2
marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Stop using the so-called 'middle' mode. Instead, use qmp_find_command()
> from generated qapi commands registry.
>
> Note: this commit requires a 'make clean' prior to make, since the
> generated files do not depend on Makefile (due to a cyclic rule
> introduced in 4115852bb0).

We generally say "commit 4115852bb0".

Sounds like we had a cyclic dependency.  Do you mean "they don't depend
on Makefile, because that would be a cyclic dependency"?

Paolo, any smart ideas on how to avoid "requires a 'make clean'"?

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  monitor.c       |  15 ++++--
>  Makefile        |   2 +-
>  qmp-commands.hx | 143 --------------------------------------------------------
>  vl.c            |   1 +
>  4 files changed, 13 insertions(+), 148 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index 3a28b43..5bbe4bb 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3934,6 +3934,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>      QObject *obj, *data;
>      QDict *input, *args;
>      const mon_cmd_t *cmd;
> +    QmpCommand *qcmd;
>      const char *cmd_name;
>      Monitor *mon = cur_mon;
>  
> @@ -3959,7 +3960,8 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>      cmd_name = qdict_get_str(input, "execute");
>      trace_handle_qmp_command(mon, cmd_name);
>      cmd = qmp_find_cmd(cmd_name);
> -    if (!cmd) {
> +    qcmd = qmp_find_command(cmd_name);
> +    if (!qcmd || !cmd) {

Looks awkward, but it's temporary.  Makes sense.

>          error_set(&local_err, ERROR_CLASS_COMMAND_NOT_FOUND,
>                    "The command %s has not been found", cmd_name);
>          goto err_out;
> @@ -3981,7 +3983,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>          goto err_out;
>      }
>  
> -    cmd->mhandler.cmd_new(args, &data, &local_err);
> +    qcmd->fn(args, &data, &local_err);
>  
>  err_out:
>      monitor_protocol_emitter(mon, data, local_err);
> @@ -4050,10 +4052,15 @@ void monitor_resume(Monitor *mon)
>  
>  static QObject *get_qmp_greeting(void)
>  {
> +    QmpCommand *cmd;
>      QObject *ver = NULL;
>  
> -    qmp_marshal_query_version(NULL, &ver, NULL);
> -    return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
> +    cmd = qmp_find_command("query-version");
> +    assert(cmd && cmd->fn);
> +    cmd->fn(NULL, &ver, NULL);
> +
> +    return qobject_from_jsonf("{'QMP':{'version': %p, 'capabilities': []}}",
> +                              ver);

Meh.

The generator makes the generated qmp_marshal_FOOs() static unless
middle mode.  Middle mode is going away (good riddance).  But replacing
the linker's work by qmp_find_command() just so we can keep the
qmp_marshal_FOOs() static isn't an improvement.  Especially since it
adds another run-time failure mode.  Let's change the generator instead.

>  }
>  
>  static void monitor_qmp_event(void *opaque, int event)
> diff --git a/Makefile b/Makefile
> index 0d7647f..fcdc192 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -311,7 +311,7 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
>  qmp-commands.h qmp-marshal.c :\
>  $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
> -		$(gen-out-type) -o "." -m $<, \
> +		$(gen-out-type) -o "." $<, \
>  		"  GEN   $@")
>  qmp-introspect.h qmp-introspect.c :\
>  $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 13707ac..1ad8dda 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -63,7 +63,6 @@ EQMP
>      {
>          .name       = "quit",
>          .args_type  = "",
> -        .mhandler.cmd_new = qmp_marshal_quit,
>      },
>  
>  SQMP
[More of the same snipped...]
> diff --git a/vl.c b/vl.c
> index a455947..a819e05 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2971,6 +2971,7 @@ int main(int argc, char **argv, char **envp)
>      qemu_init_exec_dir(argv[0]);
>  
>      module_call_init(MODULE_INIT_QOM);
> +    module_call_init(MODULE_INIT_QAPI);
>  
>      qemu_add_opts(&qemu_drive_opts);
>      qemu_add_drive_opts(&qemu_legacy_drive_opts);

So the code added by PATCH 03 doesn't actually run without this, right?
Okay with me, but let's mention it in the commit message of PATCH 03.
Paolo Bonzini Aug. 8, 2016, 10:10 a.m. UTC | #3
On 05/08/2016 14:42, Markus Armbruster wrote:
> marcandre.lureau@redhat.com writes:
> 
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Stop using the so-called 'middle' mode. Instead, use qmp_find_command()
>> from generated qapi commands registry.
>>
>> Note: this commit requires a 'make clean' prior to make, since the
>> generated files do not depend on Makefile (due to a cyclic rule
>> introduced in 4115852bb0).
> 
> We generally say "commit 4115852bb0".
> 
> Sounds like we had a cyclic dependency.  Do you mean "they don't depend
> on Makefile, because that would be a cyclic dependency"?
> 
> Paolo, any smart ideas on how to avoid "requires a 'make clean'"?

Nope, sorry. :(  But if you squash the generator patch that makes
qmp_marshal_* non-static, it should work.

The idea in that commit comes from autotools.  I'm not sure how they
deal with it.

Paolo

>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  monitor.c       |  15 ++++--
>>  Makefile        |   2 +-
>>  qmp-commands.hx | 143 --------------------------------------------------------
>>  vl.c            |   1 +
>>  4 files changed, 13 insertions(+), 148 deletions(-)
>>
>> diff --git a/monitor.c b/monitor.c
>> index 3a28b43..5bbe4bb 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -3934,6 +3934,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>>      QObject *obj, *data;
>>      QDict *input, *args;
>>      const mon_cmd_t *cmd;
>> +    QmpCommand *qcmd;
>>      const char *cmd_name;
>>      Monitor *mon = cur_mon;
>>  
>> @@ -3959,7 +3960,8 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>>      cmd_name = qdict_get_str(input, "execute");
>>      trace_handle_qmp_command(mon, cmd_name);
>>      cmd = qmp_find_cmd(cmd_name);
>> -    if (!cmd) {
>> +    qcmd = qmp_find_command(cmd_name);
>> +    if (!qcmd || !cmd) {
> 
> Looks awkward, but it's temporary.  Makes sense.
> 
>>          error_set(&local_err, ERROR_CLASS_COMMAND_NOT_FOUND,
>>                    "The command %s has not been found", cmd_name);
>>          goto err_out;
>> @@ -3981,7 +3983,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
>>          goto err_out;
>>      }
>>  
>> -    cmd->mhandler.cmd_new(args, &data, &local_err);
>> +    qcmd->fn(args, &data, &local_err);
>>  
>>  err_out:
>>      monitor_protocol_emitter(mon, data, local_err);
>> @@ -4050,10 +4052,15 @@ void monitor_resume(Monitor *mon)
>>  
>>  static QObject *get_qmp_greeting(void)
>>  {
>> +    QmpCommand *cmd;
>>      QObject *ver = NULL;
>>  
>> -    qmp_marshal_query_version(NULL, &ver, NULL);
>> -    return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
>> +    cmd = qmp_find_command("query-version");
>> +    assert(cmd && cmd->fn);
>> +    cmd->fn(NULL, &ver, NULL);
>> +
>> +    return qobject_from_jsonf("{'QMP':{'version': %p, 'capabilities': []}}",
>> +                              ver);
> 
> Meh.
> 
> The generator makes the generated qmp_marshal_FOOs() static unless
> middle mode.  Middle mode is going away (good riddance).  But replacing
> the linker's work by qmp_find_command() just so we can keep the
> qmp_marshal_FOOs() static isn't an improvement.  Especially since it
> adds another run-time failure mode.  Let's change the generator instead.
> 
>>  }
>>  
>>  static void monitor_qmp_event(void *opaque, int event)
>> diff --git a/Makefile b/Makefile
>> index 0d7647f..fcdc192 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -311,7 +311,7 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
>>  qmp-commands.h qmp-marshal.c :\
>>  $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>> -		$(gen-out-type) -o "." -m $<, \
>> +		$(gen-out-type) -o "." $<, \
>>  		"  GEN   $@")
>>  qmp-introspect.h qmp-introspect.c :\
>>  $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
>> diff --git a/qmp-commands.hx b/qmp-commands.hx
>> index 13707ac..1ad8dda 100644
>> --- a/qmp-commands.hx
>> +++ b/qmp-commands.hx
>> @@ -63,7 +63,6 @@ EQMP
>>      {
>>          .name       = "quit",
>>          .args_type  = "",
>> -        .mhandler.cmd_new = qmp_marshal_quit,
>>      },
>>  
>>  SQMP
> [More of the same snipped...]
>> diff --git a/vl.c b/vl.c
>> index a455947..a819e05 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -2971,6 +2971,7 @@ int main(int argc, char **argv, char **envp)
>>      qemu_init_exec_dir(argv[0]);
>>  
>>      module_call_init(MODULE_INIT_QOM);
>> +    module_call_init(MODULE_INIT_QAPI);
>>  
>>      qemu_add_opts(&qemu_drive_opts);
>>      qemu_add_drive_opts(&qemu_legacy_drive_opts);
> 
> So the code added by PATCH 03 doesn't actually run without this, right?
> Okay with me, but let's mention it in the commit message of PATCH 03.
>
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index 3a28b43..5bbe4bb 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3934,6 +3934,7 @@  static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
     QObject *obj, *data;
     QDict *input, *args;
     const mon_cmd_t *cmd;
+    QmpCommand *qcmd;
     const char *cmd_name;
     Monitor *mon = cur_mon;
 
@@ -3959,7 +3960,8 @@  static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
     cmd_name = qdict_get_str(input, "execute");
     trace_handle_qmp_command(mon, cmd_name);
     cmd = qmp_find_cmd(cmd_name);
-    if (!cmd) {
+    qcmd = qmp_find_command(cmd_name);
+    if (!qcmd || !cmd) {
         error_set(&local_err, ERROR_CLASS_COMMAND_NOT_FOUND,
                   "The command %s has not been found", cmd_name);
         goto err_out;
@@ -3981,7 +3983,7 @@  static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
         goto err_out;
     }
 
-    cmd->mhandler.cmd_new(args, &data, &local_err);
+    qcmd->fn(args, &data, &local_err);
 
 err_out:
     monitor_protocol_emitter(mon, data, local_err);
@@ -4050,10 +4052,15 @@  void monitor_resume(Monitor *mon)
 
 static QObject *get_qmp_greeting(void)
 {
+    QmpCommand *cmd;
     QObject *ver = NULL;
 
-    qmp_marshal_query_version(NULL, &ver, NULL);
-    return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
+    cmd = qmp_find_command("query-version");
+    assert(cmd && cmd->fn);
+    cmd->fn(NULL, &ver, NULL);
+
+    return qobject_from_jsonf("{'QMP':{'version': %p, 'capabilities': []}}",
+                              ver);
 }
 
 static void monitor_qmp_event(void *opaque, int event)
diff --git a/Makefile b/Makefile
index 0d7647f..fcdc192 100644
--- a/Makefile
+++ b/Makefile
@@ -311,7 +311,7 @@  $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
 qmp-commands.h qmp-marshal.c :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o "." -m $<, \
+		$(gen-out-type) -o "." $<, \
 		"  GEN   $@")
 qmp-introspect.h qmp-introspect.c :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 13707ac..1ad8dda 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -63,7 +63,6 @@  EQMP
     {
         .name       = "quit",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_quit,
     },
 
 SQMP
@@ -84,7 +83,6 @@  EQMP
     {
         .name       = "eject",
         .args_type  = "force:-f,device:B",
-        .mhandler.cmd_new = qmp_marshal_eject,
     },
 
 SQMP
@@ -110,7 +108,6 @@  EQMP
     {
         .name       = "change",
         .args_type  = "device:B,target:F,arg:s?",
-        .mhandler.cmd_new = qmp_marshal_change,
     },
 
 SQMP
@@ -146,7 +143,6 @@  EQMP
     {
         .name       = "screendump",
         .args_type  = "filename:F",
-        .mhandler.cmd_new = qmp_marshal_screendump,
     },
 
 SQMP
@@ -169,7 +165,6 @@  EQMP
     {
         .name       = "stop",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_stop,
     },
 
 SQMP
@@ -190,7 +185,6 @@  EQMP
     {
         .name       = "cont",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_cont,
     },
 
 SQMP
@@ -211,7 +205,6 @@  EQMP
     {
         .name       = "system_wakeup",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_system_wakeup,
     },
 
 SQMP
@@ -232,7 +225,6 @@  EQMP
     {
         .name       = "system_reset",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_system_reset,
     },
 
 SQMP
@@ -253,7 +245,6 @@  EQMP
     {
         .name       = "system_powerdown",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_system_powerdown,
     },
 
 SQMP
@@ -276,7 +267,6 @@  EQMP
         .args_type  = "device:O",
         .params     = "driver[,prop=value][,...]",
         .help       = "add device, like -device on the command line",
-        .mhandler.cmd_new = qmp_device_add,
     },
 
 SQMP
@@ -310,7 +300,6 @@  EQMP
     {
         .name       = "device_del",
         .args_type  = "id:s",
-        .mhandler.cmd_new = qmp_marshal_device_del,
     },
 
 SQMP
@@ -338,7 +327,6 @@  EQMP
     {
         .name       = "send-key",
         .args_type  = "keys:q,hold-time:i?",
-        .mhandler.cmd_new = qmp_marshal_send_key,
     },
 
 SQMP
@@ -369,7 +357,6 @@  EQMP
     {
         .name       = "cpu",
         .args_type  = "index:i",
-        .mhandler.cmd_new = qmp_marshal_cpu,
     },
 
 SQMP
@@ -394,7 +381,6 @@  EQMP
     {
         .name       = "cpu-add",
         .args_type  = "id:i",
-        .mhandler.cmd_new = qmp_marshal_cpu_add,
     },
 
 SQMP
@@ -417,7 +403,6 @@  EQMP
     {
         .name       = "memsave",
         .args_type  = "val:l,size:i,filename:s,cpu:i?",
-        .mhandler.cmd_new = qmp_marshal_memsave,
     },
 
 SQMP
@@ -446,7 +431,6 @@  EQMP
     {
         .name       = "pmemsave",
         .args_type  = "val:l,size:i,filename:s",
-        .mhandler.cmd_new = qmp_marshal_pmemsave,
     },
 
 SQMP
@@ -474,7 +458,6 @@  EQMP
     {
         .name       = "inject-nmi",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_inject_nmi,
     },
 
 SQMP
@@ -497,7 +480,6 @@  EQMP
     {
         .name       = "ringbuf-write",
         .args_type  = "device:s,data:s,format:s?",
-        .mhandler.cmd_new = qmp_marshal_ringbuf_write,
     },
 
 SQMP
@@ -526,7 +508,6 @@  EQMP
     {
         .name       = "ringbuf-read",
         .args_type  = "device:s,size:i,format:s?",
-        .mhandler.cmd_new = qmp_marshal_ringbuf_read,
     },
 
 SQMP
@@ -562,7 +543,6 @@  EQMP
     {
         .name       = "xen-save-devices-state",
         .args_type  = "filename:F",
-    .mhandler.cmd_new = qmp_marshal_xen_save_devices_state,
     },
 
 SQMP
@@ -589,7 +569,6 @@  EQMP
     {
         .name       = "xen-load-devices-state",
         .args_type  = "filename:F",
-        .mhandler.cmd_new = qmp_marshal_xen_load_devices_state,
     },
 
 SQMP
@@ -616,7 +595,6 @@  EQMP
     {
         .name       = "xen-set-global-dirty-log",
         .args_type  = "enable:b",
-        .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
     },
 
 SQMP
@@ -640,7 +618,6 @@  EQMP
     {
         .name       = "migrate",
         .args_type  = "detach:-d,blk:-b,inc:-i,uri:s",
-        .mhandler.cmd_new = qmp_marshal_migrate,
     },
 
 SQMP
@@ -673,7 +650,6 @@  EQMP
     {
         .name       = "migrate_cancel",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_migrate_cancel,
     },
 
 SQMP
@@ -694,7 +670,6 @@  EQMP
     {
         .name       = "migrate-incoming",
         .args_type  = "uri:s",
-        .mhandler.cmd_new = qmp_marshal_migrate_incoming,
     },
 
 SQMP
@@ -722,7 +697,6 @@  EQMP
     {
         .name       = "migrate-set-cache-size",
         .args_type  = "value:o",
-        .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
     },
 
 SQMP
@@ -745,7 +719,6 @@  EQMP
     {
         .name       = "migrate-start-postcopy",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy,
     },
 
 SQMP
@@ -764,7 +737,6 @@  EQMP
     {
         .name       = "query-migrate-cache-size",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
     },
 
 SQMP
@@ -786,7 +758,6 @@  EQMP
     {
         .name       = "migrate_set_speed",
         .args_type  = "value:o",
-        .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
     },
 
 SQMP
@@ -809,7 +780,6 @@  EQMP
     {
         .name       = "migrate_set_downtime",
         .args_type  = "value:T",
-        .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
     },
 
 SQMP
@@ -834,7 +804,6 @@  EQMP
         .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
         .params     = "protocol hostname port tls-port cert-subject",
         .help       = "set migration information for remote display",
-        .mhandler.cmd_new = qmp_marshal_client_migrate_info,
     },
 
 SQMP
@@ -868,7 +837,6 @@  EQMP
         .args_type  = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
         .params     = "-p protocol [-d] [begin] [length] [format]",
         .help       = "dump guest memory to file",
-        .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
     },
 
 SQMP
@@ -907,7 +875,6 @@  EQMP
     {
         .name       = "query-dump-guest-memory-capability",
         .args_type  = "",
-    .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
     },
 
 SQMP
@@ -929,7 +896,6 @@  EQMP
         .args_type  = "",
         .params     = "",
         .help       = "query background dump status",
-        .mhandler.cmd_new = qmp_marshal_query_dump,
     },
 
 SQMP
@@ -952,7 +918,6 @@  EQMP
     {
         .name       = "dump-skeys",
         .args_type  = "filename:F",
-        .mhandler.cmd_new = qmp_marshal_dump_skeys,
     },
 #endif
 
@@ -976,7 +941,6 @@  EQMP
     {
         .name       = "netdev_add",
         .args_type  = "netdev:O",
-        .mhandler.cmd_new = qmp_netdev_add,
     },
 
 SQMP
@@ -1007,7 +971,6 @@  EQMP
     {
         .name       = "netdev_del",
         .args_type  = "id:s",
-        .mhandler.cmd_new = qmp_marshal_netdev_del,
     },
 
 SQMP
@@ -1031,7 +994,6 @@  EQMP
     {
         .name       = "object-add",
         .args_type  = "qom-type:s,id:s,props:q?",
-        .mhandler.cmd_new = qmp_marshal_object_add,
     },
 
 SQMP
@@ -1057,7 +1019,6 @@  EQMP
     {
         .name       = "object-del",
         .args_type  = "id:s",
-        .mhandler.cmd_new = qmp_marshal_object_del,
     },
 
 SQMP
@@ -1082,7 +1043,6 @@  EQMP
     {
         .name       = "block_resize",
         .args_type  = "device:s?,node-name:s?,size:o",
-        .mhandler.cmd_new = qmp_marshal_block_resize,
     },
 
 SQMP
@@ -1107,7 +1067,6 @@  EQMP
     {
         .name       = "block-stream",
         .args_type  = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
-        .mhandler.cmd_new = qmp_marshal_block_stream,
     },
 
 SQMP
@@ -1152,7 +1111,6 @@  EQMP
     {
         .name       = "block-commit",
         .args_type  = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?",
-        .mhandler.cmd_new = qmp_marshal_block_commit,
     },
 
 SQMP
@@ -1218,7 +1176,6 @@  EQMP
         .name       = "drive-backup",
         .args_type  = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
                       "format:s?,bitmap:s?,on-source-error:s?,on-target-error:s?",
-        .mhandler.cmd_new = qmp_marshal_drive_backup,
     },
 
 SQMP
@@ -1274,7 +1231,6 @@  EQMP
         .name       = "blockdev-backup",
         .args_type  = "job-id:s?,sync:s,device:B,target:B,speed:i?,"
                       "on-source-error:s?,on-target-error:s?",
-        .mhandler.cmd_new = qmp_marshal_blockdev_backup,
     },
 
 SQMP
@@ -1316,33 +1272,27 @@  EQMP
     {
         .name       = "block-job-set-speed",
         .args_type  = "device:B,speed:o",
-        .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
     },
 
     {
         .name       = "block-job-cancel",
         .args_type  = "device:B,force:b?",
-        .mhandler.cmd_new = qmp_marshal_block_job_cancel,
     },
     {
         .name       = "block-job-pause",
         .args_type  = "device:B",
-        .mhandler.cmd_new = qmp_marshal_block_job_pause,
     },
     {
         .name       = "block-job-resume",
         .args_type  = "device:B",
-        .mhandler.cmd_new = qmp_marshal_block_job_resume,
     },
     {
         .name       = "block-job-complete",
         .args_type  = "device:B",
-        .mhandler.cmd_new = qmp_marshal_block_job_complete,
     },
     {
         .name       = "transaction",
         .args_type  = "actions:q,properties:q?",
-        .mhandler.cmd_new = qmp_marshal_transaction,
     },
 
 SQMP
@@ -1436,7 +1386,6 @@  EQMP
     {
         .name       = "block-dirty-bitmap-add",
         .args_type  = "node:B,name:s,granularity:i?",
-        .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
     },
 
 SQMP
@@ -1464,7 +1413,6 @@  EQMP
     {
         .name       = "block-dirty-bitmap-remove",
         .args_type  = "node:B,name:s",
-        .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
     },
 
 SQMP
@@ -1492,7 +1440,6 @@  EQMP
     {
         .name       = "block-dirty-bitmap-clear",
         .args_type  = "node:B,name:s",
-        .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
     },
 
 SQMP
@@ -1521,7 +1468,6 @@  EQMP
     {
         .name       = "blockdev-snapshot-sync",
         .args_type  = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
-        .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
     },
 
 SQMP
@@ -1557,7 +1503,6 @@  EQMP
     {
         .name       = "blockdev-snapshot",
         .args_type  = "node:s,overlay:s",
-        .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
     },
 
 SQMP
@@ -1595,7 +1540,6 @@  EQMP
     {
         .name       = "blockdev-snapshot-internal-sync",
         .args_type  = "device:B,name:s",
-        .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
     },
 
 SQMP
@@ -1624,8 +1568,6 @@  EQMP
     {
         .name       = "blockdev-snapshot-delete-internal-sync",
         .args_type  = "device:B,id:s?,name:s?",
-        .mhandler.cmd_new =
-                      qmp_marshal_blockdev_snapshot_delete_internal_sync,
     },
 
 SQMP
@@ -1669,7 +1611,6 @@  EQMP
                       "on-source-error:s?,on-target-error:s?,"
                       "unmap:b?,"
                       "granularity:i?,buf-size:i?",
-        .mhandler.cmd_new = qmp_marshal_drive_mirror,
     },
 
 SQMP
@@ -1733,7 +1674,6 @@  EQMP
         .args_type  = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
                       "on-source-error:s?,on-target-error:s?,"
                       "granularity:i?,buf-size:i?",
-        .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
     },
 
 SQMP
@@ -1781,7 +1721,6 @@  EQMP
     {
         .name       = "change-backing-file",
         .args_type  = "device:s,image-node-name:s,backing-file:s",
-        .mhandler.cmd_new = qmp_marshal_change_backing_file,
     },
 
 SQMP
@@ -1820,7 +1759,6 @@  EQMP
     {
         .name       = "balloon",
         .args_type  = "value:M",
-        .mhandler.cmd_new = qmp_marshal_balloon,
     },
 
 SQMP
@@ -1843,7 +1781,6 @@  EQMP
     {
         .name       = "set_link",
         .args_type  = "name:s,up:b",
-        .mhandler.cmd_new = qmp_marshal_set_link,
     },
 
 SQMP
@@ -1869,7 +1806,6 @@  EQMP
         .args_type  = "fdname:s",
         .params     = "getfd name",
         .help       = "receive a file descriptor via SCM rights and assign it a name",
-        .mhandler.cmd_new = qmp_marshal_getfd,
     },
 
 SQMP
@@ -1902,7 +1838,6 @@  EQMP
         .args_type  = "fdname:s",
         .params     = "closefd name",
         .help       = "close a file descriptor previously passed via SCM rights",
-        .mhandler.cmd_new = qmp_marshal_closefd,
     },
 
 SQMP
@@ -1927,7 +1862,6 @@  EQMP
         .args_type  = "fdset-id:i?,opaque:s?",
         .params     = "add-fd fdset-id opaque",
         .help       = "Add a file descriptor, that was passed via SCM rights, to an fd set",
-        .mhandler.cmd_new = qmp_marshal_add_fd,
     },
 
 SQMP
@@ -1966,7 +1900,6 @@  EQMP
         .args_type  = "fdset-id:i,fd:i?",
         .params     = "remove-fd fdset-id fd",
         .help       = "Remove a file descriptor from an fd set",
-        .mhandler.cmd_new = qmp_marshal_remove_fd,
     },
 
 SQMP
@@ -1998,7 +1931,6 @@  EQMP
         .name       = "query-fdsets",
         .args_type  = "",
         .help       = "Return information describing all fd sets",
-        .mhandler.cmd_new = qmp_marshal_query_fdsets,
     },
 
 SQMP
@@ -2047,7 +1979,6 @@  EQMP
     {
         .name       = "block_passwd",
         .args_type  = "device:s?,node-name:s?,password:s",
-        .mhandler.cmd_new = qmp_marshal_block_passwd,
     },
 
 SQMP
@@ -2073,7 +2004,6 @@  EQMP
     {
         .name       = "block_set_io_throttle",
         .args_type  = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?",
-        .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
     },
 
 SQMP
@@ -2130,7 +2060,6 @@  EQMP
     {
         .name       = "set_password",
         .args_type  = "protocol:s,password:s,connected:s?",
-        .mhandler.cmd_new = qmp_marshal_set_password,
     },
 
 SQMP
@@ -2156,7 +2085,6 @@  EQMP
     {
         .name       = "expire_password",
         .args_type  = "protocol:s,time:s",
-        .mhandler.cmd_new = qmp_marshal_expire_password,
     },
 
 SQMP
@@ -2181,7 +2109,6 @@  EQMP
     {
         .name       = "add_client",
         .args_type  = "protocol:s,fdname:s,skipauth:b?,tls:b?",
-        .mhandler.cmd_new = qmp_marshal_add_client,
     },
 
 SQMP
@@ -2209,7 +2136,6 @@  EQMP
         .args_type  = "",
         .params     = "",
         .help       = "enable QMP capabilities",
-        .mhandler.cmd_new = qmp_marshal_qmp_capabilities,
     },
 
 SQMP
@@ -2232,7 +2158,6 @@  EQMP
     {
         .name       = "human-monitor-command",
         .args_type  = "command-line:s,cpu-index:i?",
-        .mhandler.cmd_new = qmp_marshal_human_monitor_command,
     },
 
 SQMP
@@ -2311,7 +2236,6 @@  EQMP
     {
         .name       = "query-version",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_version,
     },
 
 SQMP
@@ -2348,7 +2272,6 @@  EQMP
     {
         .name       = "query-commands",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_commands,
     },
 
 SQMP
@@ -2385,7 +2308,6 @@  EQMP
     {
         .name       = "query-events",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_events,
     },
 
 SQMP
@@ -2402,7 +2324,6 @@  EQMP
     {
         .name       = "query-qmp-schema",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_query_qmp_schema,
     },
 
 SQMP
@@ -2447,7 +2368,6 @@  EQMP
     {
         .name       = "query-chardev",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_chardev,
     },
 
 SQMP
@@ -2488,7 +2408,6 @@  EQMP
     {
         .name       = "query-chardev-backends",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
     },
 
 SQMP
@@ -2672,7 +2591,6 @@  EQMP
     {
         .name       = "query-block",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_block,
     },
 
 SQMP
@@ -2869,7 +2787,6 @@  EQMP
     {
         .name       = "query-blockstats",
         .args_type  = "query-nodes:b?",
-        .mhandler.cmd_new = qmp_marshal_query_blockstats,
     },
 
 SQMP
@@ -2924,7 +2841,6 @@  EQMP
     {
         .name       = "query-cpus",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_cpus,
     },
 
 SQMP
@@ -2963,7 +2879,6 @@  EQMP
     {
         .name       = "query-iothreads",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_iothreads,
     },
 
 SQMP
@@ -3180,7 +3095,6 @@  EQMP
     {
         .name       = "query-pci",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_pci,
     },
 
 SQMP
@@ -3204,7 +3118,6 @@  EQMP
     {
         .name       = "query-kvm",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_kvm,
     },
 
 SQMP
@@ -3244,7 +3157,6 @@  EQMP
     {
         .name       = "query-status",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_status,
     },
 
 SQMP
@@ -3288,7 +3200,6 @@  EQMP
     {
         .name       = "query-mice",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_mice,
     },
 
 SQMP
@@ -3351,12 +3262,10 @@  EQMP
     {
         .name       = "query-vnc",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_vnc,
     },
     {
         .name       = "query-vnc-servers",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
     },
 
 SQMP
@@ -3433,7 +3342,6 @@  EQMP
     {
         .name       = "query-spice",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_spice,
     },
 #endif
 
@@ -3457,7 +3365,6 @@  EQMP
     {
         .name       = "query-name",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_name,
     },
 
 SQMP
@@ -3480,7 +3387,6 @@  EQMP
     {
         .name       = "query-uuid",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_uuid,
     },
 
 SQMP
@@ -3529,7 +3435,6 @@  EQMP
     {
         .name       = "query-command-line-options",
         .args_type  = "option:s?",
-        .mhandler.cmd_new = qmp_marshal_query_command_line_options,
     },
 
 SQMP
@@ -3707,7 +3612,6 @@  EQMP
     {
         .name       = "query-migrate",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_migrate,
     },
 
 SQMP
@@ -3737,7 +3641,6 @@  EQMP
         .name       = "migrate-set-capabilities",
         .args_type  = "capabilities:q",
         .params     = "capability:s,state:b",
-        .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
     },
 SQMP
 query-migrate-capabilities
@@ -3774,7 +3677,6 @@  EQMP
     {
         .name       = "query-migrate-capabilities",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
     },
 
 SQMP
@@ -3804,7 +3706,6 @@  EQMP
         .name       = "migrate-set-parameters",
         .args_type  =
             "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
-        .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
     },
 SQMP
 query-migrate-parameters
@@ -3841,7 +3742,6 @@  EQMP
     {
         .name       = "query-migrate-parameters",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
     },
 
 SQMP
@@ -3869,88 +3769,73 @@  EQMP
     {
         .name       = "query-balloon",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_balloon,
     },
 
     {
         .name       = "query-block-jobs",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_block_jobs,
     },
 
     {
         .name       = "qom-list",
         .args_type  = "path:s",
-        .mhandler.cmd_new = qmp_marshal_qom_list,
     },
 
     {
         .name       = "qom-set",
 	.args_type  = "path:s,property:s,value:q",
-        .mhandler.cmd_new = qmp_marshal_qom_set,
     },
 
     {
         .name       = "qom-get",
 	.args_type  = "path:s,property:s",
-        .mhandler.cmd_new = qmp_marshal_qom_get,
     },
 
     {
         .name       = "nbd-server-start",
         .args_type  = "addr:q,tls-creds:s?",
-        .mhandler.cmd_new = qmp_marshal_nbd_server_start,
     },
     {
         .name       = "nbd-server-add",
         .args_type  = "device:B,writable:b?",
-        .mhandler.cmd_new = qmp_marshal_nbd_server_add,
     },
     {
         .name       = "nbd-server-stop",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
     },
 
     {
         .name       = "change-vnc-password",
         .args_type  = "password:s",
-        .mhandler.cmd_new = qmp_marshal_change_vnc_password,
     },
     {
         .name       = "qom-list-types",
         .args_type  = "implements:s?,abstract:b?",
-        .mhandler.cmd_new = qmp_marshal_qom_list_types,
     },
 
     {
         .name       = "device-list-properties",
         .args_type  = "typename:s",
-        .mhandler.cmd_new = qmp_marshal_device_list_properties,
     },
 
     {
         .name       = "query-machines",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_machines,
     },
 
     {
         .name       = "query-cpu-definitions",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
     },
 
     {
         .name       = "query-target",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_target,
     },
 
     {
         .name       = "query-tpm",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_tpm,
     },
 
 SQMP
@@ -3984,7 +3869,6 @@  EQMP
     {
         .name       = "query-tpm-models",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_tpm_models,
     },
 
 SQMP
@@ -4005,7 +3889,6 @@  EQMP
     {
         .name       = "query-tpm-types",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_tpm_types,
     },
 
 SQMP
@@ -4026,7 +3909,6 @@  EQMP
     {
         .name       = "chardev-add",
         .args_type  = "id:s,backend:q",
-        .mhandler.cmd_new = qmp_marshal_chardev_add,
     },
 
 SQMP
@@ -4063,7 +3945,6 @@  EQMP
     {
         .name       = "chardev-remove",
         .args_type  = "id:s",
-        .mhandler.cmd_new = qmp_marshal_chardev_remove,
     },
 
 
@@ -4086,7 +3967,6 @@  EQMP
     {
         .name       = "query-rx-filter",
         .args_type  = "name:s?",
-        .mhandler.cmd_new = qmp_marshal_query_rx_filter,
     },
 
 SQMP
@@ -4152,7 +4032,6 @@  EQMP
     {
         .name       = "blockdev-add",
         .args_type  = "options:q",
-        .mhandler.cmd_new = qmp_marshal_blockdev_add,
     },
 
 SQMP
@@ -4211,7 +4090,6 @@  EQMP
     {
         .name       = "x-blockdev-del",
         .args_type  = "id:s?,node-name:s?",
-        .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
     },
 
 SQMP
@@ -4268,7 +4146,6 @@  EQMP
     {
         .name       = "blockdev-open-tray",
         .args_type  = "device:s,force:b?",
-        .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
     },
 
 SQMP
@@ -4316,7 +4193,6 @@  EQMP
     {
         .name       = "blockdev-close-tray",
         .args_type  = "device:s",
-        .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
     },
 
 SQMP
@@ -4351,7 +4227,6 @@  EQMP
     {
         .name       = "x-blockdev-remove-medium",
         .args_type  = "device:s",
-        .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
     },
 
 SQMP
@@ -4399,7 +4274,6 @@  EQMP
     {
         .name       = "x-blockdev-insert-medium",
         .args_type  = "device:s,node-name:s",
-        .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
     },
 
 SQMP
@@ -4439,7 +4313,6 @@  EQMP
     {
         .name       = "x-blockdev-change",
         .args_type  = "parent:B,child:B?,node:B?",
-        .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
     },
 
 SQMP
@@ -4492,7 +4365,6 @@  EQMP
     {
         .name       = "query-named-block-nodes",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
     },
 
 SQMP
@@ -4554,7 +4426,6 @@  EQMP
     {
         .name       = "blockdev-change-medium",
         .args_type  = "device:B,filename:F,format:s?,read-only-mode:s?",
-        .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
     },
 
 SQMP
@@ -4607,7 +4478,6 @@  EQMP
     {
         .name       = "query-memdev",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_memdev,
     },
 
 SQMP
@@ -4645,7 +4515,6 @@  EQMP
     {
         .name       = "query-memory-devices",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_memory_devices,
     },
 
 SQMP
@@ -4672,7 +4541,6 @@  EQMP
     {
         .name       = "query-acpi-ospm-status",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
     },
 
 SQMP
@@ -4695,7 +4563,6 @@  EQMP
     {
         .name       = "rtc-reset-reinjection",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
     },
 #endif
 
@@ -4716,7 +4583,6 @@  EQMP
     {
         .name       = "trace-event-get-state",
         .args_type  = "name:s,vcpu:i?",
-        .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
     },
 
 SQMP
@@ -4748,7 +4614,6 @@  EQMP
     {
         .name       = "trace-event-set-state",
         .args_type  = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
-        .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
     },
 
 SQMP
@@ -4783,7 +4648,6 @@  EQMP
     {
         .name       = "input-send-event",
         .args_type  = "console:i?,events:q",
-        .mhandler.cmd_new = qmp_marshal_input_send_event,
     },
 
 SQMP
@@ -4849,7 +4713,6 @@  EQMP
     {
         .name       = "block-set-write-threshold",
         .args_type  = "node-name:s,write-threshold:l",
-        .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
     },
 
 SQMP
@@ -4877,7 +4740,6 @@  EQMP
     {
         .name       = "query-rocker",
         .args_type  = "name:s",
-        .mhandler.cmd_new = qmp_marshal_query_rocker,
     },
 
 SQMP
@@ -4898,7 +4760,6 @@  EQMP
     {
         .name       = "query-rocker-ports",
         .args_type  = "name:s",
-        .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
     },
 
 SQMP
@@ -4923,7 +4784,6 @@  EQMP
     {
         .name       = "query-rocker-of-dpa-flows",
         .args_type  = "name:s,tbl-id:i?",
-        .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
     },
 
 SQMP
@@ -4952,7 +4812,6 @@  EQMP
     {
         .name       = "query-rocker-of-dpa-groups",
         .args_type  = "name:s,type:i?",
-        .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
     },
 
 SQMP
@@ -4983,7 +4842,6 @@  EQMP
     {
         .name       = "query-gic-capabilities",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
     },
 #endif
 
@@ -5007,7 +4865,6 @@  EQMP
     {
         .name       = "query-hotpluggable-cpus",
         .args_type  = "",
-        .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
     },
 
 SQMP
diff --git a/vl.c b/vl.c
index a455947..a819e05 100644
--- a/vl.c
+++ b/vl.c
@@ -2971,6 +2971,7 @@  int main(int argc, char **argv, char **envp)
     qemu_init_exec_dir(argv[0]);
 
     module_call_init(MODULE_INIT_QOM);
+    module_call_init(MODULE_INIT_QAPI);
 
     qemu_add_opts(&qemu_drive_opts);
     qemu_add_drive_opts(&qemu_legacy_drive_opts);