diff options
Diffstat (limited to 'qapi/qmp-dispatch.c')
-rw-r--r-- | qapi/qmp-dispatch.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 43f640a95e..122c1a29ba 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -94,8 +94,12 @@ 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) && ret == NULL) { - ret = QOBJECT(qdict_new()); + if (!error_is_set(errp)) { + if (cmd->options & QCO_NO_SUCCESS_RESP) { + g_assert(!ret); + } else if (!ret) { + ret = QOBJECT(qdict_new()); + } } break; } |