From: Wei Yang Date: Mon, 11 Mar 2019 08:32:34 +0000 (+0800) Subject: qom: use object_new_with_type in object_new_with_propv X-Git-Tag: v4.1.0-rc0~122^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66e1155a693e44adcd75ac644269c046cd8672c5;p=thirdparty%2Fqemu.git qom: use object_new_with_type in object_new_with_propv Function object_new_with_propv already get the Type of the object, so we could leverage object_new_with_type here. Signed-off-by: Wei Yang Reviewed-by: Marc-André Lureau Reviewed-by: Stefano Garzarella Message-Id: <20190311083234.20841-1-richardw.yang@linux.intel.com> Signed-off-by: Laurent Vivier --- diff --git a/qom/object.c b/qom/object.c index e3206d6799e..d3412e7fdca 100644 --- a/qom/object.c +++ b/qom/object.c @@ -679,7 +679,7 @@ Object *object_new_with_propv(const char *typename, error_setg(errp, "object type '%s' is abstract", typename); return NULL; } - obj = object_new(typename); + obj = object_new_with_type(klass->type); if (object_set_propv(obj, &local_err, vargs) < 0) { goto error;