From: Eric Blake <eblake@redhat.com>
To: Valentin Rakush <valentin.rakush@gmail.com>, qemu-devel@nongnu.org
Cc: armbru@redhat.com, lcapitulino@redhat.com,
asmetanin@virtuozzo.com, den@openvz.org, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH] qom, qmp, hmp, qapi: create qom-type-list for class properties
Date: Wed, 20 Jan 2016 09:38:07 -0700 [thread overview]
Message-ID: <569FB7EF.405@redhat.com> (raw)
In-Reply-To: <1453282958-385-1-git-send-email-valentin.rakush@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3128 bytes --]
On 01/20/2016 02:42 AM, Valentin Rakush wrote:
> This patch adds support for qom-type-list command that supposed to list object class properties. Will use this functionality further to implement x86_64 cpu properties.
In addition to Dan's comments,
s/that supposed//
s/Will use/A later patch will use/
>
> Additionally object_class_property_iterator_init function is implemented for consistency.
Starting a paragraph with "Also" or "Additionally" can be a sign that
the patch may be worth splitting into two smaller pieces. It's not
always the case, but worth thinking about.
>
>
> Signed-off-by: Valentin Rakush <valentin.rakush@gmail.com>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> ---
> hmp.c | 26 ++++++++++++++++++++++++++
> hmp.h | 1 +
> include/qom/object.h | 31 +++++++++++++++++++++++++++++++
> qapi-schema.json | 19 +++++++++++++++++++
> qmp-commands.hx | 6 ++++++
> qmp.c | 29 +++++++++++++++++++++++++++++
> qom/object.c | 8 ++++++++
> 7 files changed, 120 insertions(+)
>
> diff --git a/hmp.c b/hmp.c
> index 54f2620..64aa991 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2052,6 +2052,32 @@ void hmp_qom_list(Monitor *mon, const QDict *qdict)
> hmp_handle_error(mon, &err);
> }
>
> +void hmp_qom_type_list(Monitor *mon, const QDict *qdict)
> +{
> + const char *path = qdict_get_try_str(qdict, "path");
> + ObjectPropertyInfoList *list;
> + Error *err = NULL;
> +
> + if (path == NULL) {
I'd write '(!path)', but that's cosmetic.
> + monitor_printf(mon, "/\n");
> + return;
> + }
> +
> + list = qmp_qom_type_list(path, &err);
> + if (err == NULL) {
> + ObjectPropertyInfoList *start = list;
> + while (list != NULL) {
Again, this could be 'if (!err)' and 'while (list)'.
> +++ b/include/qom/object.h
> @@ -1013,6 +1013,37 @@ void object_property_iter_init(ObjectPropertyIterator *iter,
> */
> ObjectProperty *object_property_iter_next(ObjectPropertyIterator *iter);
>
> +/**
> + * object_class_property_iter_init:
> + * @klass: the klass to iter properties for
Reads awkwardly; maybe:
@klass: the class owning the properties to be iterated over
> +++ b/qapi-schema.json
> @@ -4081,3 +4081,22 @@
> ##
> { 'enum': 'ReplayMode',
> 'data': [ 'none', 'record', 'play' ] }
> +
> +##
> +# @qom-type-list:
> +#
> +# This command will list any properties of a object class
s/a object/an object/
> +# given a path in the object class model.
If you change the parameter name to 'typename' as suggested by Dan, then
this sentence needs tweaking as well.
> +#
> +# @path: the path within the object class model. See @qom-list-types
> +# to check available object class names.
> +#
--
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 --]
next prev parent reply other threads:[~2016-01-20 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 9:42 [Qemu-devel] [PATCH] qom, qmp, hmp, qapi: create qom-type-list for class properties Valentin Rakush
2016-01-20 11:41 ` Daniel P. Berrange
2016-01-20 16:38 ` Eric Blake [this message]
2016-01-20 18:15 ` Daniel P. Berrange
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=569FB7EF.405@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=asmetanin@virtuozzo.com \
--cc=den@openvz.org \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=valentin.rakush@gmail.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).