From patchwork Mon Mar 11 08:32:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 1054215 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44HrxG6FvZz9s4V for ; Mon, 11 Mar 2019 19:34:06 +1100 (AEDT) Received: from localhost ([127.0.0.1]:57207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3GNk-0001pW-LA for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 04:34:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3GN3-0001p9-1S for qemu-devel@nongnu.org; Mon, 11 Mar 2019 04:33:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3GMs-0007TC-Ok for qemu-devel@nongnu.org; Mon, 11 Mar 2019 04:33:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:53281) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3GMs-0007Pm-GT for qemu-devel@nongnu.org; Mon, 11 Mar 2019 04:33:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2019 01:33:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,467,1544515200"; d="scan'208";a="327437031" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga005.fm.intel.com with ESMTP; 11 Mar 2019 01:33:03 -0700 From: Wei Yang To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 16:32:34 +0800 Message-Id: <20190311083234.20841-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.120 Subject: [Qemu-devel] [PATCH] qom: use object_new_with_type in object_new_with_propv X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: afaerber@suse.de, Wei Yang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Function object_new_with_propv already get the Type of the object, so we could leverage object_new_with_type here. [make check test pass] Signed-off-by: Wei Yang Reviewed-by: Marc-André Lureau Reviewed-by: Stefano Garzarella --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 05a8567041..76d2f1eb2f 100644 --- a/qom/object.c +++ b/qom/object.c @@ -640,7 +640,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;