From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abF4X-0003HI-O0 for qemu-devel@nongnu.org; Wed, 02 Mar 2016 17:16:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abF4S-00010E-2r for qemu-devel@nongnu.org; Wed, 02 Mar 2016 17:16:45 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:42081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abF4R-0000zb-LZ for qemu-devel@nongnu.org; Wed, 02 Mar 2016 17:16:40 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Mar 2016 15:16:35 -0700 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id DDC2D19D803E for ; Wed, 2 Mar 2016 15:04:29 -0700 (MST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u22MGXOb30277692 for ; Wed, 2 Mar 2016 15:16:33 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u22MGXLK017691 for ; Wed, 2 Mar 2016 15:16:33 -0700 References: <1456866806-31466-1-git-send-email-mjrosato@linux.vnet.ibm.com> <1456866806-31466-6-git-send-email-mjrosato@linux.vnet.ibm.com> <20160302085920.31132938@thinkpad-w530> From: Matthew Rosato Message-ID: <56D7663F.4000501@linux.vnet.ibm.com> Date: Wed, 2 Mar 2016 17:16:31 -0500 MIME-Version: 1.0 In-Reply-To: <20160302085920.31132938@thinkpad-w530> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 5/6] s390x/cpu: Add error handling to cpu creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand Cc: imammedo@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, bharata@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de, rth@twiddle.net On 03/02/2016 02:59 AM, David Hildenbrand wrote: >> Check for and propogate errors during s390 cpu creation. >> >> Signed-off-by: Matthew Rosato >> --- >> 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