From patchwork Thu Apr 23 06:21:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 463884 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 59EF11400B7 for ; Thu, 23 Apr 2015 16:23:09 +1000 (AEST) Received: from localhost ([::1]:38241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAXT-0000js-Ik for incoming@patchwork.ozlabs.org; Thu, 23 Apr 2015 02:23:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWm-0007ln-6R for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlAWl-0001bW-4Y for qemu-devel@nongnu.org; Thu, 23 Apr 2015 02:22:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlAWk-0001bQ-W3; Thu, 23 Apr 2015 02:22:23 -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 A8FD58E3ED; Thu, 23 Apr 2015 06:22:22 +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 t3N6M589032751; Thu, 23 Apr 2015 02:22:20 -0400 From: Jason Wang To: qemu-devel@nongnu.org Date: Thu, 23 Apr 2015 14:21:37 +0800 Message-Id: <1429770109-23873-5-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 04/16] ppc: spapr: add 2.4 machine type 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 The following patches will limit the following things to legacy machine type: - maximum number of virtqueues for virtio-pci were limited to 64 Cc: Alexander Graf Cc: qemu-ppc@nongnu.org Signed-off-by: Jason Wang Reviewed-by: Alexander Graf --- hw/ppc/spapr.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 9e676ef..8e43aa2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1825,8 +1825,13 @@ static const TypeInfo spapr_machine_info = { #define SPAPR_COMPAT_2_1 \ SPAPR_COMPAT_2_2 +static void spapr_compat_2_3(Object *obj) +{ +} + static void spapr_compat_2_2(Object *obj) { + spapr_compat_2_3(obj); } static void spapr_compat_2_1(Object *obj) @@ -1834,6 +1839,12 @@ static void spapr_compat_2_1(Object *obj) spapr_compat_2_2(obj); } +static void spapr_machine_2_3_instance_init(Object *obj) +{ + spapr_compat_2_3(obj); + spapr_machine_initfn(obj); +} + static void spapr_machine_2_2_instance_init(Object *obj) { spapr_compat_2_2(obj); @@ -1893,14 +1904,29 @@ static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data) mc->name = "pseries-2.3"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3"; - mc->alias = "pseries"; - mc->is_default = 1; } static const TypeInfo spapr_machine_2_3_info = { .name = TYPE_SPAPR_MACHINE "2.3", .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_3_class_init, + .instance_init = spapr_machine_2_3_instance_init, +}; + +static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->name = "pseries-2.4"; + mc->desc = "pSeries Logical Partition (PAPR compliant) v2.4"; + mc->alias = "pseries"; + mc->is_default = 1; +} + +static const TypeInfo spapr_machine_2_4_info = { + .name = TYPE_SPAPR_MACHINE "2.4", + .parent = TYPE_SPAPR_MACHINE, + .class_init = spapr_machine_2_4_class_init, }; static void spapr_machine_register_types(void) @@ -1909,6 +1935,7 @@ static void spapr_machine_register_types(void) type_register_static(&spapr_machine_2_1_info); type_register_static(&spapr_machine_2_2_info); type_register_static(&spapr_machine_2_3_info); + type_register_static(&spapr_machine_2_4_info); } type_init(spapr_machine_register_types)