Skip to contentSkip to conversation

spapr: Define a 2.1 pseries machine

PATCH Superseded Alexey Kardashevskiy 1 participant 2 messages Jun 24, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr: Define a 2.1 pseries machine

This adds a v2.1 machine to support backward compatibility for newer macines in the case if they ever be implemented.

This adds a "pseries-2.1" machine as a child of the "pseries" machine and only changes visible machine name.

---

It seems to be everyone's consensus that we want some versioned pseries machine so here it is :)

---
 hw/ppc/spapr.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
hw/ppc/spapr.c +17 -0
index f4d464a..ab8f1ba 100644
@@ -1672,9 +1672,26 @@ static const TypeInfo spapr_machine_info = {
     },
 };
 
+static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    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 = {
+    .name          = TYPE_SPAPR_MACHINE "2.1",
+    .parent        = TYPE_SPAPR_MACHINE,
+    .instance_size = sizeof(SPAPRMachine),
+    .class_init    = spapr_machine_2_1_class_init,
+};
+
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
+    type_register_static(&spapr_machine_2_1_info);
 }
 
 type_init(spapr_machine_register_types)
Signature · 1 line
2.0.0
#1 lore raw
Quoted 7 lines · Alexey Kardashevskiy

This adds a v2.1 machine to support backward compatibility for newer macines in the case if they ever be implemented.

This adds a "pseries-2.1" machine as a child of the "pseries" machine and only changes visible machine name.

Agrh. Drop it. For some reason unknown there is SPAPRMachine struct instead of expected sPAPRMachineState struct. I'll change this and repost everything in a patchset.

Quoted 41 lines

---

It seems to be everyone's consensus that we want some versioned pseries machine so here it is :)

---
 hw/ppc/spapr.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
hw/ppc/spapr.c +17 -0
index f4d464a..ab8f1ba 100644
@@ -1672,9 +1672,26 @@ static const TypeInfo spapr_machine_info = {
     },
 };
 
+static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    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 = {
+    .name          = TYPE_SPAPR_MACHINE "2.1",
+    .parent        = TYPE_SPAPR_MACHINE,
+    .instance_size = sizeof(SPAPRMachine),
+    .class_init    = spapr_machine_2_1_class_init,
+};
+
 static void spapr_machine_register_types(void)
 {
     type_register_static(&spapr_machine_info);
+    type_register_static(&spapr_machine_2_1_info);
 }
 
 type_init(spapr_machine_register_types)
Signature · 1 line
Alexey