diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-08-06 08:53:27 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-08-16 08:42:06 +0200 |
commit | 6ce80fd80355d29b3ed8c2fa14251a9b8276a86a (patch) | |
tree | 6d048a675aaa10b377a5470a4ae94b06084ca679 /include/qapi | |
parent | bb340eb2387edfc59098bde4caea387c369005b1 (diff) | |
download | qemu-6ce80fd80355d29b3ed8c2fa14251a9b8276a86a.zip |
qobject: Replace qobject_from_jsonf() by qobject_from_jsonf_nofail()
Commit ab45015a968 "qobject: Let qobject_from_jsonf() fail instead of
abort" fails to accomplish its stated aim: the function can still
abort due to its use of &error_abort.
Its rationale for letting it fail is that all remaining users cope
fine with failure. Well, they're just fine with aborting, too; it's
what they do on failure.
Simply reverting the broken commit would bring back the unfortunate
asymmetry between qobject_from_jsonf() and qobject_from_jsonv(): one
aborts, the other returns null. So also rename it to
qobject_from_jsonf_nofail().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180806065344.7103-7-armbru@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/qmp/qjson.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 43b2ce2f33..dc509d51ae 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -15,11 +15,13 @@ #define QJSON_H QObject *qobject_from_json(const char *string, Error **errp); -QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap, Error **errp) GCC_FMT_ATTR(1, 0); -QDict *qdict_from_jsonf_nofail(const char *string, ...) GCC_FMT_ATTR(1, 2); +QObject *qobject_from_jsonf_nofail(const char *string, ...) + GCC_FMT_ATTR(1, 2); +QDict *qdict_from_jsonf_nofail(const char *string, ...) + GCC_FMT_ATTR(1, 2); QString *qobject_to_json(const QObject *obj); QString *qobject_to_json_pretty(const QObject *obj); |