On 09/21/2016 02:41 PM, Marc-André Lureau wrote: > 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 <[email protected]> > --- > qmp.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >
> if (obj) {
> object_unref(obj);
> }
> + if (!props) {
> + qobject_decref(QOBJECT(pdict));
This can be written:
QDECREF(pdict);
With that simplification,
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
