summaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2018-06-14 23:50:57 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2018-06-16 16:32:33 +1000
commitd9f0e34cb7174aefa2a1f4a7d6631c62b1e0d05d (patch)
tree0516d1926f5ef745958a3359ab35b3125443ebfd /hw/ppc
parent9986ddec4ccdc1f6320c158be50274fe390b7bb2 (diff)
spapr_cpu_core: introduce spapr_create_vcpu()
This moves some code out from spapr_cpu_core_realize() for clarity. No functional change. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_cpu_core.c73
1 files changed, 45 insertions, 28 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 30a7cf9e03..98a018c8d0 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -157,6 +157,49 @@ error:
error_propagate(errp, local_err);
}
+static PowerPCCPU *spapr_create_vcpu(sPAPRCPUCore *sc, int i, Error **errp)
+{
+ sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_GET_CLASS(sc);
+ CPUCore *cc = CPU_CORE(sc);
+ Object *obj;
+ char *id;
+ CPUState *cs;
+ PowerPCCPU *cpu;
+ Error *local_err = NULL;
+
+ obj = object_new(scc->cpu_type);
+
+ cs = CPU(obj);
+ cpu = POWERPC_CPU(obj);
+ cs->cpu_index = cc->core_id + i;
+ spapr_set_vcpu_id(cpu, cs->cpu_index, &local_err);
+ if (local_err) {
+ goto err;
+ }
+
+ cpu->node_id = sc->node_id;
+
+ id = g_strdup_printf("thread[%d]", i);
+ object_property_add_child(OBJECT(sc), id, obj, &local_err);
+ g_free(id);
+ if (local_err) {
+ goto err;
+ }
+
+ object_unref(obj);
+ return cpu;
+
+err:
+ object_unref(obj);
+ error_propagate(errp, local_err);
+ return NULL;
+}
+
+static void spapr_delete_vcpu(PowerPCCPU *cpu)
+{
+ object_unparent(OBJECT(cpu));
+}
+
static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
{
/* We don't use SPAPR_MACHINE() in order to exit gracefully if the user
@@ -166,10 +209,8 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
(sPAPRMachineState *) object_dynamic_cast(qdev_get_machine(),
TYPE_SPAPR_MACHINE);
sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev));
- sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_GET_CLASS(OBJECT(dev));
CPUCore *cc = CPU_CORE(OBJECT(dev));
Error *local_err = NULL;
- Object *obj;
int i, j;
if (!spapr) {
@@ -179,33 +220,10 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
sc->threads = g_new(PowerPCCPU *, cc->nr_threads);
for (i = 0; i < cc->nr_threads; i++) {
- char *id;
- CPUState *cs;
- PowerPCCPU *cpu;
-
- obj = object_new(scc->cpu_type);
-
- cs = CPU(obj);
- cpu = sc->threads[i] = POWERPC_CPU(obj);
- cs->cpu_index = cc->core_id + i;
- spapr_set_vcpu_id(cpu, cs->cpu_index, &local_err);
- if (local_err) {
- object_unref(obj);
- goto err;
- }
-
-
- /* Set NUMA node for the threads belonged to core */
- cpu->node_id = sc->node_id;
-
- id = g_strdup_printf("thread[%d]", i);
- object_property_add_child(OBJECT(sc), id, obj, &local_err);
- g_free(id);
+ sc->threads[i] = spapr_create_vcpu(sc, i, &local_err);
if (local_err) {
- object_unref(obj);
goto err;
}
- object_unref(obj);
}
for (j = 0; j < cc->nr_threads; j++) {
@@ -222,8 +240,7 @@ err_unrealize:
}
err:
while (--i >= 0) {
- obj = OBJECT(sc->threads[i]);
- object_unparent(obj);
+ spapr_delete_vcpu(sc->threads[i]);
}
g_free(sc->threads);
error_propagate(errp, local_err);
e-5-3-1'>libreoffice-5-3-1 Unnamed repository; edit this file to name it for gitweb.root
summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Expand)AuthorFilesLines
2018-07-04update translations with the updated submodulesChristian Lohmaier251-8166/+13205
2018-07-04update translations for 6.1.0 rc1Christian Lohmaier297-56322/+48498
2018-07-03update translations for 6.1.0 rc1Christian Lohmaier2157-127618/+192971
2018-07-02Updated Slovenian translationAndras Timar29-971/+1729
2018-06-18Updated Slovenian translationAndras Timar21-884/+1233
2018-06-14update translations for 6.1 beta2Christian Lohmaier1860-61144/+68688
2018-06-03Updated Slovenian translationsAndras Timar26-255/+321
2018-05-24update translations for master/6.1 beta1libreoffice-6-1-branch-pointChristian Lohmaier1800-103940/+133185
2018-05-23add Frisian translationChristian Lohmaier151-0/+197757
2018-05-23update translations for master/6.1 beta1Christian Lohmaier3270-225217/+309831
2018-05-22Updated Slovenian translationAndras Timar28-1091/+2104
2018-05-22Updated Slovenian translationAndras Timar44-2443/+3152
2018-04-25update translatiosn for 6.1.0 alpha1Christian Lohmaier7038-3076810/+3123935
2018-04-24Updated Slovenian translationAndras Timar43-2679/+2792
2018-04-23Updated Slovenian translationAndras Timar67-26702/+27634
2018-02-22update translations for 6.0.2 rc1Christian Lohmaier718-129684/+137151
2018-02-08update translations for 6.0Christian Lohmaier420-9661/+8359
2018-01-24update translations for 6.0.0 rc3Christian Lohmaier501-16700/+13747
2018-01-17update translations after another de-fuzzying roundChristian Lohmaier1494-26316/+1330
2018-01-15update translations after first de-fuzzying roundChristian Lohmaier3272-224093/+14153
2018-01-10update translations for 6.0 rc2Christian Lohmaier1152-83636/+67632
2018-01-03Updated Slovenian translationAndras Timar38-4707/+9933
2017-12-20update translations for 6.0 rc1Christian Lohmaier1875-117341/+604955
2017-12-18update translations for 6.0/masterChristian Lohmaier4166-354536/+699155
2017-12-12resurrect some translated strings via compendiumChristian Lohmaier2588-156024/+311864
2017-12-11update translationsChristian Lohmaier367-14115/+13078
2017-12-11update translations for 6.0 beta2Christian Lohmaier