qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>
Cc: mjrosato@linux.vnet.ibm.com, qemu-devel@nongnu.org,
	ehabkost@redhat.com, imammedo@redhat.com, aik@ozlabs.ru,
	"Markus Armbruster" <armbru@redhat.com>,
	agraf@suse.de, mdroth@linux.vnet.ibm.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com,
	nfont@linux.vnet.ibm.com, pbonzini@redhat.com, afaerber@suse.de,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH v7 12/13] qmp: Add query-ppc-cpu-cores command
Date: Fri, 29 Jan 2016 12:04:13 +0530	[thread overview]
Message-ID: <20160129063413.GE13713@in.ibm.com> (raw)
In-Reply-To: <56AA7F8A.2080903@redhat.com>

On Thu, Jan 28, 2016 at 01:52:26PM -0700, Eric Blake wrote:
> On 01/27/2016 10:49 PM, Bharata B Rao wrote:
> > Show the details of PPC CPU cores via a new QMP command.
> > 
> > TODO: update qmp-commands.hx with example
> 
> Is this a stale comment? [1]

Yes, I missed removing it after I put the example in qmp-commands.hx.

> 
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> 
> >  #include <sysemu/cpus.h>
> > +#include <sysemu/kvm.h>
> >  #include "qemu/error-report.h"
> > +#include "qmp-commands.h"
> > +
> > +/*
> > + * QMP: info ppc-cpu-cores
> > + */
> > +static int qmp_ppc_cpu_list(Object *obj, void *opaque)
> 
> Comment is a bit off - 'info ...' is an HMP command; this callback is
> helping implement the QMP function query-ppc-cpu-cores.

Ok, will make it "QMP: query-ppc-cpu-cores"

> 
> > +++ b/qapi-schema.json
> > @@ -4083,3 +4083,34 @@
> >  ##
> >  { 'enum': 'ReplayMode',
> >    'data': [ 'none', 'record', 'play' ] }
> > +
> > +##
> > +# @PPCCPUCore:
> > +#
> > +# Information about PPC CPU core devices
> > +#
> > +# @hotplugged: true if device was hotplugged
> > +#
> > +# @hotpluggable: true if device if could be added/removed while machine is running
> > +#
> > +# Since: 2.6
> 
> Missing docs on 'id' and 'threads'.

Will add.

> 
> > +##
> > +
> > +{ 'struct': 'PPCCPUCore',
> > +  'data': { '*id': 'str',
> > +            'hotplugged': 'bool',
> > +            'hotpluggable': 'bool',
> > +            'threads' : ['CpuInfo']
> > +          }
> > +}
> > +
> > +##
> > +# @query-ppc-cpu-core:
> > +#
> > +# Returns information for all PPC CPU core devices
> > +#
> > +# Returns: a list of @PPCCPUCore.
> > +#
> > +# Since: 2.6
> > +##
> > +{ 'command': 'query-ppc-cpu-cores', 'returns': ['PPCCPUCore'] }
> 
> Interface seems okay.
> 
> > +++ b/qmp-commands.hx
> > @@ -4795,3 +4795,54 @@ Example:
> >                   {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
> >                    "pop-vlan": 1, "id": 251658240}
> >     ]}
> > +
> > +EQMP
> > +
> > +#if defined TARGET_PPC64
> > +    {
> > +        .name       = "query-ppc-cpu-cores",
> > +        .args_type  = "",
> > +        .mhandler.cmd_new = qmp_marshal_query_ppc_cpu_cores,
> > +    },
> > +#endif
> 
> Hmm. Conditional compilation. Does the command show up in
> 'query-commands' and introspection output, even when the target is not
> ppc64?  We may need to fix qapi introspection to support conditionals
> better; maybe some of Marc-Andre's patches towards eliminating
> qmp-commands.hx will come into play here.

For targets other than ppc64, query-commands doesn't list
query-ppc-cpu-cores.

> 
> > +
> > +SQMP
> > +@query-ppc-cpu-cores
> > +--------------------
> > +
> > +Show PowerPC CPU core devices information.
> > +
> > +Example:
> > +-> { "execute": "query-ppc-cpu-cores" }
> > +<- {"return": [{"threads": [
> > +                 {"arch": "ppc",
> 
> [1] looks like you provided an example after all.  Is it worth
> documenting that this command is only conditionally available?

Will add

# Note: This command is available only for PowerPC targets

> 
> 
> > +++ b/stubs/qmp_query_ppc_cpu_cores.c
> > @@ -0,0 +1,10 @@
> > +#include "qom/object.h"
> > +#include "qapi/qmp/qerror.h"
> > +#include "qemu/typedefs.h"
> > +#include "qmp-commands.h"
> > +
> > +PPCCPUCoreList *qmp_query_ppc_cpu_cores(Error **errp)
> > +{
> > +    error_setg(errp, QERR_UNSUPPORTED);
> > +    return 0;
> > +}
> 
> Hmm - will the stub even be used, since you used an #ifdef in the .hx file?

Though I have put

.mhandler.cmd_new = qmp_marshal_query_ppc_cpu_cores,

under ifdef in .hx, qmp_marshal_query_ppc_cpu_cores() is getting defined in
qmp-marshal.c and hence we need this stub file so that qmp_query_ppc_cpu_cores()
gets resolved from qmp-marshal.c:qmp_marshal_query_ppc_cpu_cores().

Regards,
Bharata.

  reply	other threads:[~2016-01-29  6:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  5:49 [Qemu-devel] [PATCH v7 00/13] sPAPR CPU hotplug Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores Bharata B Rao
2016-01-28 19:04   ` Eduardo Habkost
2016-01-29  3:52   ` David Gibson
2016-01-29 14:24     ` Eduardo Habkost
2016-01-29 15:10       ` Igor Mammedov
2016-01-29 15:36         ` Eduardo Habkost
2016-01-29 16:52           ` Igor Mammedov
2016-01-29 17:24             ` Eduardo Habkost
2016-02-01  9:41               ` Igor Mammedov
2016-02-03 17:38                 ` Eduardo Habkost
2016-02-04  9:38                   ` Igor Mammedov
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 02/13] exec: Remove cpu from cpus list during cpu_exec_exit() Bharata B Rao
2016-01-28 19:19   ` Eduardo Habkost
2016-01-29  6:14     ` Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 03/13] exec: Do vmstate unregistration from cpu_exec_exit() Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 04/13] cpu: Don't realize CPU from cpu_generic_init() Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 05/13] cpu: Reclaim vCPU objects Bharata B Rao
2016-02-19 15:21   ` Thomas Huth
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 06/13] cpu: Add a sync version of cpu_remove() Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 07/13] xics, xics_kvm: Handle CPU unplug correctly Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 08/13] target-ppc: Introduce PowerPC specific CPU core device Bharata B Rao
2016-02-01  2:39   ` David Gibson
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 09/13] spapr: Enable CPU hotplug for pseries-2.6 and add CPU DRC DT entries Bharata B Rao
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 10/13] spapr: CPU hotplug support Bharata B Rao
2016-02-01  3:07   ` David Gibson
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 11/13] spapr: CPU hot unplug support Bharata B Rao
2016-02-01  3:13   ` David Gibson
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 12/13] qmp: Add query-ppc-cpu-cores command Bharata B Rao
2016-01-28 20:52   ` Eric Blake
2016-01-29  6:34     ` Bharata B Rao [this message]
2016-01-29 15:45   ` Igor Mammedov
2016-02-01  8:43     ` Bharata B Rao
2016-02-01  9:56       ` Igor Mammedov
2016-01-28  5:49 ` [Qemu-devel] [PATCH v7 13/13] hmp: Add "info ppc-cpu-cores" command Bharata B Rao
2016-01-28 21:56   ` Eric Blake
2016-01-29  6:49     ` Bharata B Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160129063413.GE13713@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tyreld@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).