From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, Alexey Kardashevskiy <aik@ozlabs.ru>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
qemu-ppc@nongnu.org, Bharata B Rao <bharata@linux.vnet.ibm.com>,
Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [for-2.10 PATCH 1/3] spapr_drc: abort if object_property_add_child() fails
Date: Tue, 8 Aug 2017 16:09:37 +1000 [thread overview]
Message-ID: <20170808060937.GA25081@umbus.fritz.box> (raw)
In-Reply-To: <150212667952.12227.2933198220121691613.stgit@bahia>
[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]
On Mon, Aug 07, 2017 at 07:24:39PM +0200, Greg Kurz wrote:
> object_property_add_child() can only fail in two cases:
> - the child already has a parent, which shouldn't happen since the DRC was
> allocated a few lines above
> - the parent already has a child with the same name, which would mean the
> caller tries to create a DRC that already exists
>
> In both case, this is a QEMU bug and we should abort.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
This is definitely a fix, so applied for 2.10.
> ---
> hw/ppc/spapr_drc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
> index 47d94e782ac2..5260b5d363a0 100644
> --- a/hw/ppc/spapr_drc.c
> +++ b/hw/ppc/spapr_drc.c
> @@ -541,7 +541,7 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type,
> drc->owner = owner;
> prop_name = g_strdup_printf("dr-connector[%"PRIu32"]",
> spapr_drc_index(drc));
> - object_property_add_child(owner, prop_name, OBJECT(drc), NULL);
> + object_property_add_child(owner, prop_name, OBJECT(drc), &error_abort);
> object_property_set_bool(OBJECT(drc), true, "realized", NULL);
> g_free(prop_name);
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-08-08 6:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 17:24 [Qemu-devel] [for-2.10 PATCH 0/3] spapr: fix PCI hotplug issue when PHBs don't have index Greg Kurz
2017-08-07 17:24 ` [Qemu-devel] [for-2.10 PATCH 1/3] spapr_drc: abort if object_property_add_child() fails Greg Kurz
2017-08-08 6:09 ` David Gibson [this message]
2017-08-07 17:24 ` [Qemu-devel] [for-2.10 PATCH 2/3] spapr_drc: add Error ** argument to spapr_dr_connector_new() Greg Kurz
2017-08-07 17:25 ` [Qemu-devel] [for-2.10 PATCH 3/3] spapr: error out if PHB fails to setup PCI DRCs Greg Kurz
2017-08-08 6:16 ` David Gibson
2017-08-08 9:18 ` Greg Kurz
2017-08-09 3:33 ` David Gibson
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=20170808060937.GA25081@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=bharata@linux.vnet.ibm.com \
--cc=danielhb@linux.vnet.ibm.com \
--cc=groug@kaod.org \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).