aboutsummaryrefslogtreecommitdiff
path: root/qapi/qmp-dispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'qapi/qmp-dispatch.c')
-rw-r--r--qapi/qmp-dispatch.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 187af56b86..168b083c87 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -62,6 +62,7 @@ static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
static QObject *do_qmp_dispatch(QObject *request, Error **errp)
{
+ Error *local_err = NULL;
const char *command;
QDict *args, *dict;
QmpCommand *cmd;
@@ -93,13 +94,13 @@ static QObject *do_qmp_dispatch(QObject *request, Error **errp)
switch (cmd->type) {
case QCT_NORMAL:
- cmd->fn(args, &ret, errp);
- if (!error_is_set(errp)) {
- if (cmd->options & QCO_NO_SUCCESS_RESP) {
- g_assert(!ret);
- } else if (!ret) {
- ret = QOBJECT(qdict_new());
- }
+ cmd->fn(args, &ret, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ } else if (cmd->options & QCO_NO_SUCCESS_RESP) {
+ g_assert(!ret);
+ } else if (!ret) {
+ ret = QOBJECT(qdict_new());
}
break;
}