All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH for-2.9 1/2] qom: Remove release function from class properties
Date: Thu, 17 Nov 2016 15:45:49 +0100	[thread overview]
Message-ID: <871syaf9lu.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20161117133623.GU5057@thinpad.lan.raisama.net> (Eduardo Habkost's message of "Thu, 17 Nov 2016 11:36:23 -0200")

Eduardo Habkost <ehabkost@redhat.com> writes:

> On Thu, Nov 17, 2016 at 01:33:34PM +0100, Markus Armbruster wrote:
>> Eduardo Habkost <ehabkost@redhat.com> writes:
>> 
>> > The release functions are never called for class properties, and
>> > their semantics aren't even defined clearly (should the release
>> > function be called when an instance is destroyed, or when a class
>> > is destroyed?). Remove the unused functionality.
>> >
>> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> [...]
>> >      g_hash_table_insert(klass->properties, g_strdup(name), prop);
>> > @@ -1808,7 +1806,6 @@ void object_class_property_add_str(ObjectClass *klass, const char *name,
>> >      object_class_property_add(klass, name, "string",
>> >                                get ? property_get_str : NULL,
>> >                                set ? property_set_str : NULL,
>> > -                              property_release_str,
>> >                                prop, &local_err);
>> >      if (local_err) {
>> >          error_propagate(errp, local_err);
>> 
>> Here, you drop property_release_str(), which calls g_free().  Assuming
>> you claim that it's never called is correct, this is again no functional
>> change.  But that begs the question why not freeing the stuff
>> property_release_str() frees is correct.  Can you explain?
>
> property_release_str() frees prop. The only right moment to free
> prop is on class destruction or class property removal, but we
> have no mechanisms for class destruction or class property
> removal today.

Would be a nice addition to the commit message.

>> > @@ -1897,7 +1894,6 @@ void object_class_property_add_bool(ObjectClass *klass, const char *name,
>> >      object_class_property_add(klass, name, "bool",
>> >                                get ? property_get_bool : NULL,
>> >                                set ? property_set_bool : NULL,
>> > -                              property_release_bool,
>> >                                prop, &local_err);
>> >      if (local_err) {
>> >          error_propagate(errp, local_err);
>> > @@ -1985,7 +1981,6 @@ void object_class_property_add_enum(ObjectClass *klass, const char *name,
>> >      object_class_property_add(klass, name, typename,
>> >                                get ? property_get_enum : NULL,
>> >                                set ? property_set_enum : NULL,
>> > -                              property_release_enum,
>> >                                prop, &local_err);
>> >      if (local_err) {
>> >          error_propagate(errp, local_err);
>> > @@ -2082,7 +2077,6 @@ void object_class_property_add_tm(ObjectClass *klass, const char *name,
>> >  
>> >      object_class_property_add(klass, name, "struct tm",
>> >                                get ? property_get_tm : NULL, NULL,
>> > -                              property_release_tm,
>> >                                prop, &local_err);
>> >      if (local_err) {
>> >          error_propagate(errp, local_err);
>> 
>> Likewise.
>
> Same as above.
>
>> [...]

Reviewed-by: Markus Armbruster <armbru@redhat.com>

  reply	other threads:[~2016-11-17 14:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 18:57 [Qemu-devel] [PATCH for-2.9 0/2] qom, qdev: Cleanup release functions Eduardo Habkost
2016-11-16 18:57 ` [Qemu-devel] [PATCH for-2.9 1/2] qom: Remove release function from class properties Eduardo Habkost
2016-11-17 12:33   ` Markus Armbruster
2016-11-17 13:36     ` Eduardo Habkost
2016-11-17 14:45       ` Markus Armbruster [this message]
2016-11-16 18:57 ` [Qemu-devel] [PATCH for-2.9 2/2] qdev: Change signature of PropertyInfo::release Eduardo Habkost
2016-11-17 12:26   ` Markus Armbruster
2016-11-17 13:40     ` Eduardo Habkost

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=871syaf9lu.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=afaerber@suse.de \
    --cc=ehabkost@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.