Revision bb89c2e9

b/monitor.c
3848 3848
    return 0;
3849 3849
}
3850 3850

  
3851
static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret)
3852
{
3853
    if (ret && !monitor_has_error(mon)) {
3854
        /*
3855
         * If it returns failure, it must have passed on error.
3856
         *
3857
         * Action: Report an internal error to the client if in QMP.
3858
         */
3859
        if (monitor_ctrl_mode(mon)) {
3860
            qemu_error_new(QERR_UNDEFINED_ERROR);
3861
        }
3862
        MON_DEBUG("command '%s' returned failure but did not pass an error\n",
3863
                  cmd->name);
3864
    }
3865

  
3866
#ifdef CONFIG_DEBUG_MONITOR
3867
    if (!ret && monitor_has_error(mon)) {
3868
        /*
3869
         * If it returns success, it must not have passed an error.
3870
         *
3871
         * Action: Report the passed error to the client.
3872
         */
3873
        MON_DEBUG("command '%s' returned success but passed an error\n",
3874
                  cmd->name);
3875
    }
3876
#endif
3877
}
3878

  
3851 3879
static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
3852 3880
                                 const QDict *params)
3853 3881
{
3882
    int ret;
3854 3883
    QObject *data = NULL;
3855 3884

  
3856
    cmd->mhandler.cmd_new(mon, params, &data);
3885
    ret = cmd->mhandler.cmd_new(mon, params, &data);
3886
    handler_audit(mon, cmd, ret);
3857 3887

  
3858 3888
    if (is_async_return(data)) {
3859 3889
        /*

Also available in: Unified diff