From: Paolo Bonzini <pbonzini@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 06/12] qom/object: register 'type' property as class property
Date: Wed, 3 Oct 2018 14:59:34 +0200 [thread overview]
Message-ID: <ec937f8d-a243-98b5-e95e-5c23a07894a4@redhat.com> (raw)
In-Reply-To: <20180907075948.26917-7-marcandre.lureau@redhat.com>
On 07/09/2018 09:59, Marc-André Lureau wrote:
> Let's save a few byte in each object instance.
>
> (Is this property really used anywhere? Only qom-get could read it)
Well, it's not really used but it's part of the external API.
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> qom/object.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index d8666de3f2..185d1dd9f8 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -2423,9 +2423,10 @@ void object_class_property_set_description(ObjectClass *klass,
> op->description = g_strdup(description);
> }
>
> -static void object_instance_init(Object *obj)
> +static void object_class_init(ObjectClass *klass, void *data)
> {
> - object_property_add_str(obj, "type", qdev_get_type, NULL, NULL);
> + object_class_property_add_str(klass, "type", qdev_get_type,
> + NULL, &error_abort);
> }
>
> static void register_types(void)
> @@ -2439,7 +2440,7 @@ static void register_types(void)
> static TypeInfo object_info = {
> .name = TYPE_OBJECT,
> .instance_size = sizeof(Object),
> - .instance_init = object_instance_init,
> + .class_init = object_class_init,
> .abstract = true,
> };
>
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2018-10-03 12:59 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 7:59 [Qemu-devel] [PATCH v2 00/12] Various qemu command line options help improvements Marc-André Lureau
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout Marc-André Lureau
2018-09-07 8:22 ` Thomas Huth
2018-09-07 13:46 ` Eric Blake
2018-09-07 18:53 ` Marc-André Lureau
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 02/12] cutils: add qemu_pstrcmp Marc-André Lureau
2018-09-07 8:25 ` Thomas Huth
2018-09-07 8:29 ` Marc-André Lureau
2018-09-07 8:34 ` Thomas Huth
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 03/12] qemu-option: add help fallback to print the list of options Marc-André Lureau
2018-09-07 13:42 ` Eric Blake
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 04/12] qemu-option: improve qemu_opts_print_help() output Marc-André Lureau
2018-10-08 22:03 ` Max Reitz
2018-10-09 8:24 ` Marc-André Lureau
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 05/12] qom/object: fix iterating properties over a class Marc-André Lureau
2018-10-03 12:58 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 06/12] qom/object: register 'type' property as class property Marc-André Lureau
2018-10-03 12:59 ` Paolo Bonzini [this message]
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 07/12] tests/qom-proplist: check duplicate "bv" property registration failed Marc-André Lureau
2018-10-03 13:01 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 08/12] tests/qom-proplist: check properties are not listed multiple times Marc-André Lureau
2018-10-03 13:01 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 09/12] tests/qom-proplist: check class properties iterator Marc-André Lureau
2018-10-03 13:02 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 10/12] vl: handle -object help Marc-André Lureau
2018-10-03 13:02 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 11/12] hostmem: add some properties description Marc-André Lureau
2018-10-03 13:02 ` Paolo Bonzini
2018-09-07 7:59 ` [Qemu-devel] [PATCH v2 12/12] vl: list user creatable properties when 'help' is argument Marc-André Lureau
2018-09-07 13:52 ` Eric Blake
2018-10-03 13:02 ` Paolo Bonzini
2018-09-11 13:09 ` [Qemu-devel] [PATCH v2 00/12] Various qemu command line options help improvements Paolo Bonzini
2018-10-02 10:54 ` Marc-André Lureau
2018-10-03 13:03 ` Paolo Bonzini
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=ec937f8d-a243-98b5-e95e-5c23a07894a4@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).