]> git.ipfire.org Git - thirdparty/qemu.git/commit
qmp: fix object-add assert() without props
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 22 Sep 2016 20:39:25 +0000 (00:39 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 2 Nov 2016 22:24:25 +0000 (17:24 -0500)
commitf3467f56c14fe745b11ae9b37bb081c0967999d4
tree6870a16fa0e80f89f1f54b001963e370754dce03
parent5be5335661a9c28f64e2b4e296063a7387ab498f
qmp: fix object-add assert() without props

Since commit ad739706bbadee49, user_creatable_add_type() expects to be
given a qdict. However, if object-add is called without props, you reach
the assert: "qemu/qom/object_interfaces.c:115: user_creatable_add_type:
Assertion `qdict' failed.", because the qdict isn't created in this
case (it's optional).

Furthermore, qmp_input_visitor_new() is not meant to be called without a
dict, and a further commit will assert in this situation.

If none given, create an empty qdict in qmp to avoid the
user_creatable_add_type() assert(qdict).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20160922203927.28241-2-marcandre.lureau@redhat.com>
Tested-by: Xiao Long Jiang <zxiaol@linux.vnet.ibm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qmp.c