From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aY8TQ-0003PX-E8 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 03:37:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aY8TP-00050r-6B for qemu-devel@nongnu.org; Tue, 23 Feb 2016 03:37:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aY8TP-00050n-0c for qemu-devel@nongnu.org; Tue, 23 Feb 2016 03:37:35 -0500 Date: Tue, 23 Feb 2016 09:37:29 +0100 From: Igor Mammedov Message-ID: <20160223093729.6d48bca0@nial.brq.redhat.com> In-Reply-To: <56CB3C24.5060001@redhat.com> References: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> <1456117285-22273-8-git-send-email-bharata@linux.vnet.ibm.com> <56CB3C24.5060001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v0 7/8] qmp: Implement query cpu-packages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, aik@ozlabs.ru, agraf@suse.de, armbru@redhat.com, Bharata B Rao , pbonzini@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au On Mon, 22 Feb 2016 09:49:40 -0700 Eric Blake wrote: > On 02/21/2016 10:01 PM, Bharata B Rao wrote: > > Signed-off-by: Bharata B Rao > > --- > > hw/cpu/package.c | 19 +++++++++++++ > > hw/ppc/spapr.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > include/hw/boards.h | 1 + > > qapi-schema.json | 48 ++++++++++++++++++++++++++++++++ > > 4 files changed, 147 insertions(+) > > > > > +++ b/qapi-schema.json > > @@ -4083,3 +4083,51 @@ > > ## > > { 'enum': 'ReplayMode', > > 'data': [ 'none', 'record', 'play' ] } > > + > > +## > > +# @CPUThreadInfo: > > +# > > +# Information about CPU Threads > > +# > > Missing documentation for the fields. > > > +# Since: 2.6 > > +## > > + > > +{ 'struct': 'CPUInfo', > > + 'data': { 'arch_id': 'int', > > New QMP code should favor '-' over '_'; this should be 'arch-id'. > > > + 'type': 'str', > > Is this string free-form, or is it a finite set of values? If the > latter, then it should be an enum type. I'd say it's a limited set of values. The same applies to other targets. It's basically cpu_model translated into corresponding QOM type name. Is there a way to auto-generate this QAPI enum dynamically? > > > + '*thread': 'int', > > + '*core': 'int', > > + '*socket' : 'int', > > + '*node' : 'int', > > + '*qom_path': 'str' > > 'qom-path'. But this one is definitely free-form, so 'str' is right. > > > + } > > +} > > + > > +## > > +# @CPUPackageInfo: > > +# > > +# Information about CPU Packages > > +# > > Missing field documentation. > > > +# Since: 2.6 > > +## > > + > > +{ 'struct': 'CPUPackageInfo', > > + 'data': { '*id': 'str', > > + 'type': 'str', > > + 'qom_path': 'str', > > + 'realized': 'bool', > > + 'nr_cpus': 'int', > > 'nr-cpus'. Is this field redundant, given that the caller can just count > the length of the 'cpus' array? > > > + 'cpus' : ['CPUInfo'] > > + } > > +} > > + > > +## > > +# @query-cpu-packages: > > +# > > +# Returns information for all CPU packages > > +# > > +# Returns: a list of @CPUPackageInfo > > +# > > +# Since: 2.6 > > +## > > +{ 'command': 'query-cpu-packages', 'returns': ['CPUPackageInfo'] } > > >