From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNJAm-0002rS-5T for qemu-devel@nongnu.org; Fri, 29 Aug 2014 06:13:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNJAc-0001iQ-Pp for qemu-devel@nongnu.org; Fri, 29 Aug 2014 06:12:48 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:50928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNJAc-0001hD-5i for qemu-devel@nongnu.org; Fri, 29 Aug 2014 06:12:38 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Aug 2014 20:12:36 +1000 From: Alexey Kardashevskiy Date: Fri, 29 Aug 2014 20:12:05 +1000 Message-Id: <1409307142-2600-2-git-send-email-aik@ozlabs.ru> In-Reply-To: <1409307142-2600-1-git-send-email-aik@ozlabs.ru> References: <1409307142-2600-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [RFC PATCH v3 01/18] spapr: Make machine naming conventions closer to those for PC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alex Williamson , qemu-ppc@nongnu.org, Alexander Graf , David Gibson From: David Gibson As of qemu-2.1, spapr/pseries, has a set of versioned machine classes to represent the machine type as it appeared to the guest in different qemu versions. This allows for safe migration of guests between current and future qemu versions. In PC, however, the default plain "pc" machine type is just an alias for the most recent versioned machine type. In sPAPR at the moment, it names the base machine class from which the versioned types are derived. The PC approach is preferable; it makes it clearer which explicit version is the current one. Additionally updating the "current" machine as the base class makes it even more likely than otherwise to incorrectly alter the versioned machines' behaviour when updating the current machine. Therefore this patch changes sPAPR to the PC approach - the base class becomes abstract, and plain "pseries" becomes an alias for the most recent versioned machine class. Signed-off-by: David Gibson [aik: removed "pseries" name from the parent class] Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 647c383..d2d3c27 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1643,9 +1643,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc); - mc->name = "pseries"; - mc->desc = "pSeries Logical Partition (PAPR compliant)"; - mc->is_default = 1; mc->init = ppc_spapr_init; mc->reset = ppc_spapr_reset; mc->block_default_type = IF_SCSI; @@ -1660,6 +1657,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) static const TypeInfo spapr_machine_info = { .name = TYPE_SPAPR_MACHINE, .parent = TYPE_MACHINE, + .abstract = true, .instance_size = sizeof(sPAPRMachineState), .instance_init = spapr_machine_initfn, .class_init = spapr_machine_class_init, @@ -1675,7 +1673,8 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) mc->name = "pseries-2.1"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1"; - mc->is_default = 0; + mc->alias = "pseries"; + mc->is_default = 1; } static const TypeInfo spapr_machine_2_1_info = { -- 2.0.0