aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-virtio.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/s390x/s390-virtio.c')
-rw-r--r--hw/s390x/s390-virtio.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index 57c3c88afd..f00d6b4bae 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -97,6 +97,7 @@ void s390_init_ipl_dev(const char *kernel_filename,
void s390_init_cpus(MachineState *machine)
{
int i;
+ gchar *name;
if (machine->cpu_model == NULL) {
machine->cpu_model = "host";
@@ -104,12 +105,18 @@ void s390_init_cpus(MachineState *machine)
cpu_states = g_malloc0(sizeof(S390CPU *) * max_cpus);
- for (i = 0; i < smp_cpus; i++) {
- S390CPU *cpu;
-
- cpu = cpu_s390x_init(machine->cpu_model);
+ for (i = 0; i < max_cpus; i++) {
+ name = g_strdup_printf("cpu[%i]", i);
+ object_property_add_link(OBJECT(machine), name, TYPE_S390_CPU,
+ (Object **) &cpu_states[i],
+ object_property_allow_set_link,
+ OBJ_PROP_LINK_UNREF_ON_RELEASE,
+ &error_abort);
+ g_free(name);
+ }
- cpu_states[i] = cpu;
+ for (i = 0; i < smp_cpus; i++) {
+ cpu_s390x_init(machine->cpu_model);
}
}