Revision fc29df75 monitor.c

b/monitor.c
3880 3880
    }
3881 3881
}
3882 3882

  
3883
static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
3884
                                 const QDict *params)
3885
{
3886
    int ret;
3887
    QObject *data = NULL;
3888

  
3889
    mon_print_count_init(mon);
3890

  
3891
    ret = cmd->mhandler.cmd_new(mon, params, &data);
3892
    handler_audit(mon, cmd, ret);
3893

  
3894
    if (monitor_ctrl_mode(mon)) {
3895
        /* Monitor Protocol */
3896
        monitor_protocol_emitter(mon, data);
3897
    } else {
3898
        /* User Protocol */
3899
         if (data)
3900
            cmd->user_print(mon, data);
3901
    }
3902

  
3903
    qobject_decref(data);
3904
}
3905

  
3906 3883
static void handle_user_command(Monitor *mon, const char *cmdline)
3907 3884
{
3908 3885
    QDict *qdict;
......
4433 4410
    }
4434 4411
}
4435 4412

  
4413
static void qmp_call_cmd(Monitor *mon, const mon_cmd_t *cmd,
4414
                         const QDict *params)
4415
{
4416
    int ret;
4417
    QObject *data = NULL;
4418

  
4419
    mon_print_count_init(mon);
4420

  
4421
    ret = cmd->mhandler.cmd_new(mon, params, &data);
4422
    handler_audit(mon, cmd, ret);
4423
    monitor_protocol_emitter(mon, data);
4424
    qobject_decref(data);
4425
}
4426

  
4436 4427
static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
4437 4428
{
4438 4429
    int err;
......
4500 4491
            goto err_out;
4501 4492
        }
4502 4493
    } else {
4503
        monitor_call_handler(mon, cmd, args);
4494
        qmp_call_cmd(mon, cmd, args);
4504 4495
    }
4505 4496

  
4506 4497
    goto out;

Also available in: Unified diff