From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: "Thomas Huth" <thuth@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/pci-host/pnv_phb: Avoid quitting QEMU if hotplug of pnv-phb-root-port fails
Date: Wed, 9 Nov 2022 10:35:38 -0300 [thread overview]
Message-ID: <235a7fb2-dab1-a230-212d-398bffa94b1a@gmail.com> (raw)
In-Reply-To: <20221109122210.115667-1-thuth@redhat.com>
On 11/9/22 09:22, Thomas Huth wrote:
> Currently QEMU terminates if you try to hotplug pnv-phb-root-port in
> an environment where it is not supported, e.g. if doing this:
>
> echo "device_add pnv-phb-root-port" | \
> ./qemu-system-ppc64 -monitor stdio -M powernv9
>
> To avoid this problem, the pnv_phb_root_port_realize() function should
> not use error_fatal when trying to set the properties which might not
> be available.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
Ops, my bad. Thanks for fixing it up.
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
And queued in gitlab.com/danielhb/qemu/tree/ppc-next after adding the
"Fixes" tag Cedric mentioned. Thanks,
Daniel
> hw/pci-host/pnv_phb.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pci-host/pnv_phb.c b/hw/pci-host/pnv_phb.c
> index 7b11f1e8dd..0b26b43736 100644
> --- a/hw/pci-host/pnv_phb.c
> +++ b/hw/pci-host/pnv_phb.c
> @@ -241,8 +241,16 @@ static void pnv_phb_root_port_realize(DeviceState *dev, Error **errp)
> * QOM id. 'chip_id' is going to be used as PCIE chassis for the
> * root port.
> */
> - chip_id = object_property_get_int(OBJECT(bus), "chip-id", &error_fatal);
> - index = object_property_get_int(OBJECT(bus), "phb-id", &error_fatal);
> + chip_id = object_property_get_int(OBJECT(bus), "chip-id", &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
> + index = object_property_get_int(OBJECT(bus), "phb-id", &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
>
> /* Set unique chassis/slot values for the root port */
> qdev_prop_set_uint8(dev, "chassis", chip_id);
prev parent reply other threads:[~2022-11-09 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 12:22 [PATCH] hw/pci-host/pnv_phb: Avoid quitting QEMU if hotplug of pnv-phb-root-port fails Thomas Huth
2022-11-09 13:24 ` Cédric Le Goater
2022-11-09 13:35 ` Daniel Henrique Barboza [this message]
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=235a7fb2-dab1-a230-212d-398bffa94b1a@gmail.com \
--to=danielhb413@gmail.com \
--cc=clg@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.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).