qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, imammedo@redhat.com,
	thuth@redhat.com, aik@ozlabs.ru, agraf@suse.de,
	pbonzini@redhat.com, ehabkost@redhat.com, pkrempa@redhat.com,
	mdroth@linux.vnet.ibm.com, eblake@redhat.com,
	mjrosato@linux.vnet.ibm.com, borntraeger@de.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4 8/9] hmp: Add 'info hotpluggable-cpus' HMP command
Date: Fri, 10 Jun 2016 18:34:21 +1000	[thread overview]
Message-ID: <20160610083421.GS9226@voom.fritz.box> (raw)
In-Reply-To: <1465520348-13964-9-git-send-email-bharata@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

On Fri, Jun 10, 2016 at 06:29:07AM +0530, Bharata B Rao wrote:
> This is the HMP equivalent for QMP query-hotpluggable-cpus.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

This has a compile error on 32-bit host, because qapi 'int' values are
actually uint64s.  I've fixed it in my tree.

> ---
>  hmp-commands-info.hx | 14 ++++++++++++++
>  hmp.c                | 41 +++++++++++++++++++++++++++++++++++++++++
>  hmp.h                |  1 +
>  3 files changed, 56 insertions(+)
> 
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 52539c3..7da9e6c 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -800,6 +800,20 @@ STEXI
>  Display the latest dump status.
>  ETEXI
>  
> +    {
> +        .name       = "hotpluggable-cpus",
> +        .args_type  = "",
> +        .params     = "",
> +        .help       = "Show information about hotpluggable CPUs",
> +        .mhandler.cmd = hmp_hotpluggable_cpus,
> +    },
> +
> +STEXI
> +@item info hotpluggable-cpus
> +@findex hotpluggable-cpus
> +Show information about hotpluggable CPUs
> +ETEXI
> +
>  STEXI
>  @end table
>  ETEXI
> diff --git a/hmp.c b/hmp.c
> index a4b1d3d..14d4712 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2424,3 +2424,44 @@ void hmp_info_dump(Monitor *mon, const QDict *qdict)
>  
>      qapi_free_DumpQueryResult(result);
>  }
> +
> +void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
> +{
> +    Error *err = NULL;
> +    HotpluggableCPUList *l = qmp_query_hotpluggable_cpus(&err);
> +    HotpluggableCPUList *saved = l;
> +    CpuInstanceProperties *c;
> +
> +    if (err != NULL) {
> +        hmp_handle_error(mon, &err);
> +        return;
> +    }
> +
> +    monitor_printf(mon, "Hotpluggable CPUs:\n");
> +    while (l) {
> +        monitor_printf(mon, "  type: \"%s\"\n", l->value->type);
> +        monitor_printf(mon, "  vcpus_count: \"%ld\"\n", l->value->vcpus_count);
> +        if (l->value->has_qom_path) {
> +            monitor_printf(mon, "  qom_path: \"%s\"\n", l->value->qom_path);
> +        }
> +
> +        c = l->value->props;
> +        monitor_printf(mon, "  CPUInstance Properties:\n");
> +        if (c->has_node) {
> +            monitor_printf(mon, "    node: \"%ld\"\n", c->node);
> +        }
> +        if (c->has_socket) {
> +            monitor_printf(mon, "    socket: \"%ld\"\n", c->socket);
> +        }
> +        if (c->has_core) {
> +            monitor_printf(mon, "    core: \"%ld\"\n", c->core);
> +        }
> +        if (c->has_thread) {
> +            monitor_printf(mon, "    thread: \"%ld\"\n", c->thread);
> +        }
> +
> +        l = l->next;
> +    }
> +
> +    qapi_free_HotpluggableCPUList(saved);
> +}
> diff --git a/hmp.h b/hmp.h
> index 093d65f..f5d9749 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -132,5 +132,6 @@ void hmp_rocker_ports(Monitor *mon, const QDict *qdict);
>  void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict);
>  void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict);
>  void hmp_info_dump(Monitor *mon, const QDict *qdict);
> +void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
>  
>  #endif

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-06-10  8:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10  0:58 [Qemu-devel] [PATCH v4 0/9] Core based CPU hotplug for PowerPC sPAPR Bharata B Rao
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 1/9] qom: API to get instance_size of a type Bharata B Rao
2016-06-10  4:04   ` David Gibson
2016-06-10  7:38     ` Igor Mammedov
2016-06-15  5:48       ` David Gibson
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 2/9] spapr: Abstract CPU core device and type specific core devices Bharata B Rao
2016-06-10  4:24   ` David Gibson
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 3/9] spapr: Move spapr_cpu_init() to spapr_cpu_core.c Bharata B Rao
2016-06-10  4:27   ` David Gibson
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 4/9] spapr: convert boot CPUs into CPU core devices Bharata B Rao
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 5/9] spapr: CPU hotplug support Bharata B Rao
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 6/9] spapr: CPU hot unplug support Bharata B Rao
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 7/9] QMP: Add query-hotpluggable-cpus Bharata B Rao
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 8/9] hmp: Add 'info hotpluggable-cpus' HMP command Bharata B Rao
2016-06-10  8:34   ` David Gibson [this message]
2016-06-10  0:59 ` [Qemu-devel] [PATCH v4 9/9] spapr: implement query-hotpluggable-cpus callback Bharata B Rao
2016-06-10  5:14 ` [Qemu-devel] [PATCH v4 0/9] Core based CPU hotplug for PowerPC sPAPR David Gibson
2016-06-15  6:04   ` [Qemu-devel] [Qemu-ppc] " David Gibson
2016-06-16  3:49     ` Bharata B Rao
2016-06-16  6:41       ` David Gibson
2016-06-16 11:49       ` Thomas Huth
2016-06-16 16:57         ` Igor Mammedov

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=20160610083421.GS9226@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.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).