On 03/02/2016 02:59 AM, David Hildenbrand wrote: >> Check for and propogate errors during s390 cpu creation. >> >> Signed-off-by: Matthew Rosato <mjros...@linux.vnet.ibm.com> >> --- >> hw/s390x/s390-virtio-ccw.c | 30 +++++++++++++++++++++ >> hw/s390x/s390-virtio.c | 2 +- >> hw/s390x/s390-virtio.h | 1 + >> target-s390x/cpu-qom.h | 3 +++ >> target-s390x/cpu.c | 65 >> ++++++++++++++++++++++++++++++++++++++++++++-- >> target-s390x/cpu.h | 1 + >> target-s390x/helper.c | 31 ++++++++++++++++++++-- >> 7 files changed, 128 insertions(+), 5 deletions(-) >> >> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c >> index 3090e76..4886dbf 100644 >> --- a/hw/s390x/s390-virtio-ccw.c >> +++ b/hw/s390x/s390-virtio-ccw.c >> @@ -112,6 +112,36 @@ void s390_memory_init(ram_addr_t mem_size) >> s390_skeys_init(); >> } >> >> +S390CPU *s390_new_cpu(MachineState *machine, int64_t id, Error **errp) > > Just a thought, if not passing machine but the model string, we could make > > cpu_s390x_init() call s390_new_cpu(). > > But then s390_new_cpu() would have to be moved again. Not sure if this is > really worth it. >
Additionally, next_cpu_id would have to be moved somewhere other than the S390CPUClass, as we need that value for input to s390_new_cpu() here, but won't have a cpu object to acquire it until after s390_new_cpu() returns. Going to leave cpu_s390x_init() calling cpu_s390x_create() unless someone voices a strong opinion. Matt