From: Wei Yang <richardw.y...@linux.intel.com> 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 <richardw.y...@linux.intel.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Stefano Garzarella <sgarz...@redhat.com> Message-Id: <20190311083234.20841-1-richardw.y...@linux.intel.com> Signed-off-by: Laurent Vivier <laur...@vivier.eu> --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index e3206d6799ee..d3412e7fdca6 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; -- 2.20.1