All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr: Cleanup machine naming conventions, and prepare for 2.2 release
@ 2014-09-08  5:30 David Gibson
  2014-09-08 11:39 ` Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: David Gibson @ 2014-09-08  5:30 UTC (permalink / raw)
  To: agraf; +Cc: qemu-devel, 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.

However, these are organized a bit differently from those for PC: on PC,
the default plain "pc" machine type is just an alias for the most recent
versioned machine type.  In sPAPR, 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.  Since qemu-2.1 is now released, we also
create a new pseries-2.2 machine type, to incorporate changes during this
development cycle (for now it is identical to pseries-2.1).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5cb452f..70c7170 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1600,9 +1600,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc);
     NMIClass *nc = NMI_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;
@@ -1618,6 +1615,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,
@@ -1634,7 +1632,6 @@ 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;
 }
 
 static const TypeInfo spapr_machine_2_1_info = {
@@ -1643,10 +1640,27 @@ static const TypeInfo spapr_machine_2_1_info = {
     .class_init    = spapr_machine_2_1_class_init,
 };
 
+static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->name = "pseries-2.2";
+    mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2";
+    mc->alias = "pseries";
+    mc->is_default = 1;
+}
+
+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,
+};
+
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
     type_register_static(&spapr_machine_2_1_info);
+    type_register_static(&spapr_machine_2_2_info);
 }
 
 type_init(spapr_machine_register_types)
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr: Cleanup machine naming conventions, and prepare for 2.2 release
  2014-09-08  5:30 [Qemu-devel] [PATCH] spapr: Cleanup machine naming conventions, and prepare for 2.2 release David Gibson
@ 2014-09-08 11:39 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2014-09-08 11:39 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-devel



On 08.09.14 07:30, David Gibson wrote:
> 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.
> 
> However, these are organized a bit differently from those for PC: on PC,
> the default plain "pc" machine type is just an alias for the most recent
> versioned machine type.  In sPAPR, 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.  Since qemu-2.1 is now released, we also
> create a new pseries-2.2 machine type, to incorporate changes during this
> development cycle (for now it is identical to pseries-2.1).
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Thanks, applied to ppc-next.


Alex

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-08 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08  5:30 [Qemu-devel] [PATCH] spapr: Cleanup machine naming conventions, and prepare for 2.2 release David Gibson
2014-09-08 11:39 ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.