static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret)

{

    if (ret && !monitor_has_error(mon)) {

        /*

         * If it returns failure, it must have passed on error.

         *

         * Action: Report an internal error to the client if in QMP.

         */

        if (monitor_ctrl_mode(mon)) {

            qerror_report(QERR_UNDEFINED_ERROR);

        }

        MON_DEBUG("command '%s' returned failure but did not pass an error\n",

                  cmd->name);

    }



#ifdef CONFIG_DEBUG_MONITOR

    if (!ret && monitor_has_error(mon)) {

        /*

         * If it returns success, it must not have passed an error.

         *

         * Action: Report the passed error to the client.

         */

        MON_DEBUG("command '%s' returned success but passed an error\n",

                  cmd->name);

    }



    if (mon_print_count_get(mon) > 0 && strcmp(cmd->name, "info") != 0) {

        /*

         * Handlers should not call Monitor print functions.

         *

         * Action: Ignore them in QMP.

         *

         * (XXX: we don't check any 'info' or 'query' command here

         * because the user print function _is_ called by do_info(), hence

         * we will trigger this check. This problem will go away when we

         * make 'query' commands real and kill do_info())

         */

        MON_DEBUG("command '%s' called print functions %d time(s)\n",

                  cmd->name, mon_print_count_get(mon));

    }

#endif

}

static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret)

{

    if (ret && !monitor_has_error(mon)) {

        









        if (monitor_ctrl_mode(mon)) {

            qerror_report(QERR_UNDEFINED_ERROR);

        }

        MON_DEBUG("command '%s' returned failure but did not pass an error\n",

                  cmd->name);

    }



#ifdef CONFIG_DEBUG_MONITOR

    if (!ret && monitor_has_error(mon)) {

        









        MON_DEBUG("command '%s' returned success but passed an error\n",

                  cmd->name);

    }



    if (mon_print_count_get(mon) > 0 && strcmp(cmd->name, "info") != 0) {

        



















        MON_DEBUG("command '%s' called print functions %d time(s)\n",

                  cmd->name, mon_print_count_get(mon));

    }

#endif

}

static void FUNC_0(Monitor *VAR_0, const mon_cmd_t *VAR_1, int VAR_2)

{

    if (VAR_2 && !monitor_has_error(VAR_0)) {

        









        if (monitor_ctrl_mode(VAR_0)) {

            qerror_report(QERR_UNDEFINED_ERROR);

        }

        MON_DEBUG("command '%s' returned failure but did not pass an error\n",

                  VAR_1->name);

    }



#ifdef CONFIG_DEBUG_MONITOR

    if (!VAR_2 && monitor_has_error(VAR_0)) {

        









        MON_DEBUG("command '%s' returned success but passed an error\n",

                  VAR_1->name);

    }



    if (mon_print_count_get(VAR_0) > 0 && strcmp(VAR_1->name, "info") != 0) {

        



















        MON_DEBUG("command '%s' called print functions %d time(s)\n",

                  VAR_1->name, mon_print_count_get(VAR_0));

    }

#endif

}

static void FUNC_0(Monitor *VAR_0, const mon_cmd_t *VAR_1, int VAR_2)
{ if (VAR_2 && !monitor_has_error(VAR_0)) { if (monitor_ctrl_mode(VAR_0)) { qerror_report(QERR_UNDEFINED_ERROR); } MON_DEBUG("command '%s' returned failure but did not pass an error\n",
VAR_1->name); } #ifdef CONFIG_DEBUG_MONITOR
if (!VAR_2 && monitor_has_error(VAR_0)) { MON_DEBUG("command '%s' returned success but passed an error\n",
VAR_1->name); } if (mon_print_count_get(VAR_0) > 0 && strcmp(VAR_1->name, "info") != 0) { MON_DEBUG("command '%s' called print functions %d time(s)\n",
VAR_1->name, mon_print_count_get(VAR_0)); } #endif
}