Received: from eggs.gnu.org ([209.51.188.92]:59483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMWE4-0008EK-67 for qemu-devel@nongnu.org; Fri, 03 May 2019 07:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMWE3-0001Jg-2l for qemu-devel@nongnu.org; Fri, 03 May 2019 07:19:36 -0400 From: Laurent Vivier Date: Fri, 3 May 2019 13:18:25 +0200 Message-Id: <20190503111832.30316-6-laurent@vivier.eu> In-Reply-To: <20190503111832.30316-1-laurent@vivier.eu> References: <20190503111832.30316-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL v2 05/12] qom: use object_new_with_type in object_new_with_propv List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier , Paolo Bonzini , Fabien Chouteau , qemu-trivial@nongnu.org, Richard Henderson , Jason Wang , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Michael Tokarev , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , Artyom Tarasenko , Michael Roth , Mark Cave-Ayland , Wei Yang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefano Garzarella From: Wei Yang 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 --- 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