From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Auger <eric.auger@redhat.com>,
eric.auger.pro@gmail.com, qemu-devel@nongnu.org,
berrange@redhat.com, ehabkost@redhat.com, armbru@redhat.com
Subject: Re: [PATCH v2 1/2] qom: Introduce object_property_try_add_child()
Date: Wed, 24 Jun 2020 16:12:38 +0200 [thread overview]
Message-ID: <1a144355-27bd-a26f-752e-00c2751d3a1f@redhat.com> (raw)
In-Reply-To: <20200624124301.7112-2-eric.auger@redhat.com>
On 24/06/20 14:43, Eric Auger wrote:
> + op = object_property_try_add(obj, name, type, object_get_child_property,
> + NULL, object_finalize_child_property,
> + child, errp);
> + if (!op) {
> + goto out;
> + }
> op->resolve = object_resolve_child_property;
> +out:
> object_ref(child);
> child->parent = obj;
> return op;
I think if there's an error you need to return NULL without ref-ing
child, shouldn't you?
You can then add another test that object_property_add_child succeeds
after object_property_try_add_child fails.
Paolo
next prev parent reply other threads:[~2020-06-24 14:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 12:42 [PATCH v2 0/2] Avoid abort on QMP attempt to add an object with duplicate id Eric Auger
2020-06-24 12:43 ` [PATCH v2 1/2] qom: Introduce object_property_try_add_child() Eric Auger
2020-06-24 14:12 ` Paolo Bonzini [this message]
2020-06-24 14:17 ` Auger Eric
2020-06-24 16:02 ` Auger Eric
2020-06-24 16:16 ` Paolo Bonzini
2020-06-24 17:03 ` Auger Eric
2020-06-24 12:43 ` [PATCH v2 2/2] tests/qmp-cmd-test: Add qmp/object-add-duplicate-id Eric Auger
2020-06-24 13:01 ` Thomas Huth
2020-06-24 16:13 ` Auger Eric
2020-06-24 13:35 ` [PATCH v2 0/2] Avoid abort on QMP attempt to add an object with duplicate id no-reply
2020-06-24 14:05 ` Auger Eric
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=1a144355-27bd-a26f-752e-00c2751d3a1f@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@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).