From patchwork Thu Apr 23 06:21:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 463885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EA07014012C for ; Thu, 23 Apr 2015 16:23:10 +1000 (AEST) Received: from localhost ([::1]:38242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAXV-0000nH-3y for incoming@patchwork.ozlabs.org; Thu, 23 Apr 2015 02:23:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWj-0007eg-0U for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlAWi-0001aM-47 for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWh-0001Zg-VQ; Thu, 23 Apr 2015 02:22:20 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9FF328E3C0; Thu, 23 Apr 2015 06:22:19 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (vpn1-7-179.pek2.redhat.com [10.72.7.179]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3N6M588032751; Thu, 23 Apr 2015 02:22:17 -0400 From: Jason Wang To: qemu-devel@nongnu.org Date: Thu, 23 Apr 2015 14:21:36 +0800 Message-Id: <1429770109-23873-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1429770109-23873-1-git-send-email-jasowang@redhat.com> References: <1429770109-23873-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , qemu-ppc@nongnu.org, Alexander Graf , mst@redhat.com Subject: [Qemu-devel] [PATCH V7 03/16] spapr: add machine type specific instance init function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patches adds machine type specific instance initialization functions. Those functions will be used by following patches to compat class properties for legacy machine types. Cc: Alexander Graf Cc: qemu-ppc@nongnu.org Signed-off-by: Jason Wang --- hw/ppc/spapr.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 61ddc79..9e676ef 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1825,6 +1825,27 @@ static const TypeInfo spapr_machine_info = { #define SPAPR_COMPAT_2_1 \ SPAPR_COMPAT_2_2 +static void spapr_compat_2_2(Object *obj) +{ +} + +static void spapr_compat_2_1(Object *obj) +{ + spapr_compat_2_2(obj); +} + +static void spapr_machine_2_2_instance_init(Object *obj) +{ + spapr_compat_2_2(obj); + spapr_machine_initfn(obj); +} + +static void spapr_machine_2_1_instance_init(Object *obj) +{ + spapr_compat_2_1(obj); + spapr_machine_initfn(obj); +} + static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -1843,6 +1864,7 @@ static const TypeInfo spapr_machine_2_1_info = { .name = TYPE_SPAPR_MACHINE "2.1", .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_1_class_init, + .instance_init = spapr_machine_2_1_instance_init, }; static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) @@ -1862,6 +1884,7 @@ static const TypeInfo spapr_machine_2_2_info = { .name = TYPE_SPAPR_MACHINE "2.2", .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_2_class_init, + .instance_init = spapr_machine_2_2_instance_init, }; static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data)