]> git.proxmox.com Git - mirror_qemu.git/commit - tests/check-qjson.c
qobject: Replace qobject_from_jsonf() by qobject_from_jsonf_nofail()
authorMarkus Armbruster <armbru@redhat.com>
Mon, 6 Aug 2018 06:53:27 +0000 (08:53 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 16 Aug 2018 06:42:06 +0000 (08:42 +0200)
commit6ce80fd80355d29b3ed8c2fa14251a9b8276a86a
tree6d048a675aaa10b377a5470a4ae94b06084ca679
parentbb340eb2387edfc59098bde4caea387c369005b1
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>
include/qapi/qmp/qjson.h
qobject/qjson.c
tests/check-qjson.c
tests/libqtest.h