qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Hu Tao <hutao@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
	Igor Mammedov <imammedo@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/4] qmp: add query-memdev
Date: Mon, 16 Jun 2014 11:38:18 -0600	[thread overview]
Message-ID: <539F2B8A.5010009@redhat.com> (raw)
In-Reply-To: <aec40366ed4d59b13a0ee238940bb024e55c7cd8.1402912665.git.hutao@cn.fujitsu.com>

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

On 06/16/2014 04:05 AM, Hu Tao wrote:
> Add qmp command query-memdev to query for information
> of memory devices
> 
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
>  numa.c           | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  qapi-schema.json | 40 +++++++++++++++++++++++++++
>  qmp-commands.hx  | 38 +++++++++++++++++++++++++
>  3 files changed, 162 insertions(+)
> 
> diff --git a/numa.c b/numa.c
> index 8ba5a38..bcbafd2 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -34,6 +34,7 @@
>  #include "qapi/qmp/qerror.h"
>  #include "hw/boards.h"
>  #include "sysemu/hostmem.h"
> +#include "qmp-commands.h"
>  
>  QemuOptsList qemu_numa_opts = {
>      .name = "numa",
> @@ -280,3 +281,86 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
>          addr += size;
>      }
>  }
> +
> +static int query_memdev(Object *obj, void *opaque)
> +{
> +    MemdevList **list = opaque;
> +    Error *err = NULL;

This variable is usually named local_err.

> +
> +    if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
> +        MemdevList *m = g_malloc0(sizeof(*m));
> +
> +        m->value = g_malloc0(sizeof(*m->value));
> +
> +        m->value->size = object_property_get_int(obj, "size",
> +                                                 &err);
> +        if (err) {
> +            goto error;
> +        }

Is this error ever likely, or would it represent a programming error, in
which case passing &error_abort would avoid the need to check for
failure afterwords.  Similarly for all the other properties.


> +query-memdev
> +------------
> +
> +Show memory devices information.

Makes sense, but took me a couple reads.  Might be better as:

Show information on memory devices.

> +
> +
> +Example (1):

What is the "(1)" for?  I'd just drop it (probably copy-and-paste from
another command that actually had more than one example)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-06-16 17:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 10:05 [Qemu-devel] [PATCH v2 0/4] fixes for pci tree, v2 Hu Tao
2014-06-16 10:05 ` [Qemu-devel] [PATCH v2 1/4] qmp: add query-memdev Hu Tao
2014-06-16 17:38   ` Eric Blake [this message]
2014-06-16 10:05 ` [Qemu-devel] [PATCH v2 2/4] check if we have space left for hotplugged memory Hu Tao
2014-06-16 10:44   ` Igor Mammedov
2014-06-16 10:47   ` Igor Mammedov
2014-06-16 10:05 ` [Qemu-devel] [PATCH v2 3/4] memory-backend-file: improve error handling Hu Tao
2014-06-17 10:03   ` Igor Mammedov
2014-06-17 10:09     ` Hu Tao
2014-06-17 10:56       ` Michael S. Tsirkin
2014-06-16 10:05 ` [Qemu-devel] [PATCH v2 4/4] fixup! numa: add -numa node, memdev= option Hu Tao
2014-06-16 11:09 ` [Qemu-devel] [PATCH v2 0/4] fixes for pci tree, v2 Michael S. Tsirkin
2014-06-17  8:47   ` Hu Tao
2014-06-17 10:55     ` Michael S. Tsirkin

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=539F2B8A.5010009@redhat.com \
    --to=eblake@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=y-goto@jp.fujitsu.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).