From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUags-0006Fm-Mj for qemu-devel@nongnu.org; Tue, 02 Aug 2016 10:29:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUagn-000232-TH for qemu-devel@nongnu.org; Tue, 02 Aug 2016 10:29:05 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUagn-00022x-Jc for qemu-devel@nongnu.org; Tue, 02 Aug 2016 10:29:01 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u72ENo96145958 for ; Tue, 2 Aug 2016 10:29:00 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0a-001b2d01.pphosted.com with ESMTP id 24jvnkj3uy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 02 Aug 2016 10:28:59 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Aug 2016 15:28:57 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id E861B2190046 for ; Tue, 2 Aug 2016 15:28:19 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u72ESr1655377922 for ; Tue, 2 Aug 2016 14:28:53 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u72ESrkG017052 for ; Tue, 2 Aug 2016 08:28:53 -0600 Date: Tue, 2 Aug 2016 16:28:52 +0200 From: David Hildenbrand In-Reply-To: <20160802142250.GG3337@thinpad.lan.raisama.net> References: <1470139155-53900-1-git-send-email-dahi@linux.vnet.ibm.com> <1470139155-53900-28-git-send-email-dahi@linux.vnet.ibm.com> <20160802142250.GG3337@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160802162852.5512930c@thinkpad-w530> Subject: Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, jdenemar@redhat.com, imammedo@redhat.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, fiuczy@linux.vnet.ibm.com, mimu@linux.vnet.ibm.com > On Tue, Aug 02, 2016 at 01:59:13PM +0200, David Hildenbrand wrote: > [...] > > +CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type, > > + CpuModelInfo *model, > > + Error **errp) > > +{ > > + CpuModelExpansionInfo *expansion_info = NULL; > > + S390CPUModel s390_model; > > + bool delta_changes = false; > > + > > + /* convert it to our internal representation */ > > + cpu_model_from_info(&s390_model, model, errp); > > + if (*errp) { > > + return NULL; > > + } > > + > > + if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) { > > + delta_changes = true; > > + } > > This assumes the only valid values for type will always be > "static" and "full". I would check explicitly for > CPU_MODEL_EXPANSION_TYPE_STATIC and CPU_MODEL_EXPANSION_TYPE_FULL > and return an error otherwise, just in case CpuModelExpansionType > is extended to include other expansion modes in the future. I actually also had that in mind :) Will add that check! Thanks! David