mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
Monitor: Directly call QObject handlers
This avoids handle_user_command() calling monitor_call_handler(), which is currently shared with QMP. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
4903de0ceb
commit
de79ba6f53
1 changed files with 9 additions and 1 deletions
10
monitor.c
10
monitor.c
|
@ -3917,7 +3917,15 @@ static void handle_user_command(Monitor *mon, const char *cmdline)
|
|||
if (handler_is_async(cmd)) {
|
||||
user_async_cmd_handler(mon, cmd, qdict);
|
||||
} else if (handler_is_qobject(cmd)) {
|
||||
monitor_call_handler(mon, cmd, qdict);
|
||||
QObject *data = NULL;
|
||||
|
||||
/* XXX: ignores the error code */
|
||||
cmd->mhandler.cmd_new(mon, qdict, &data);
|
||||
assert(!monitor_has_error(mon));
|
||||
if (data) {
|
||||
cmd->user_print(mon, data);
|
||||
qobject_decref(data);
|
||||
}
|
||||
} else {
|
||||
cmd->mhandler.cmd(mon, qdict);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue