All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Alistair Francis <alistair.francis@xilinx.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 1/6] qdev: get_child_bus(): Use QOM lookup if available
Date: Thu, 7 Jan 2016 16:04:28 -0800	[thread overview]
Message-ID: <CAKmqyKMRSggRXY1U_2vY65TXuKs4RxBe4Rs-Jud7=iiPV1t9oA@mail.gmail.com> (raw)
In-Reply-To: <CAPokK=pmpbMeHRg6Y_0HUrNRuG2F9Npx8pjzRTyTAEAgLpGQmg@mail.gmail.com>

On Wed, Jan 6, 2016 at 4:25 PM, Peter Crosthwaite
<crosthwaitepeter@gmail.com> wrote:
> On Wed, Jan 6, 2016 at 4:18 PM, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> On Sat, Dec 19, 2015 at 9:43 PM, Peter Crosthwaite
>> <crosthwaitepeter@gmail.com> wrote:
>>> qbus_realize() adds busses as a QOM child of the device in addition to
>>> adding it to the qdev bus list. Change get_child_bus() to use the QOM
>>> child if it is available. This takes priority over the bus-list, but
>>> the child object is checked for type correctness.
>>
>> This doesn't cause problems for anything else? Is there anything else
>> with the same name or something where this causes conflicts?
>>
>
> Not that I know of, I'm just being defensive as it is core code. I
> suspect that that ignored failure path on the child setter is
> incorrect but I can't prove it beyond all doubt.

I just re-read what I said and it doesn't really make sense. My only
concern was busses with the same name somehow having conflicts that
weren't previously there. I can't think of any case where this would
happen though.

Acked-by: Alistair Francis <alistair.francis@xilinx.com>

Thanks,

Alistair

>
> Regards,
> Peter
>
>> Thanks,
>>
>> Alistair
>>
>>>
>>> This prepares support for aliasing of buses. The use case is SoCs,
>>> where a SoC container needs to present buses to the board level, but
>>> the buses are implemented by controller IP we already model as self
>>> contained qbus-containing devices.
>>>
>>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>>> ---
>>> Currently qbus_realize() ignores errors from object_property_add_child,
>>> so it is hard to guarantee that the QOM linkage is reliable. If it were
>>> the case that that object_property_add_child was supposed to be error
>>> asserting, we could remove the old bus-list strcmp iterator altogether.
>>>
>>>  hw/core/qdev.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
>>> index b3ad467..c96c464 100644
>>> --- a/hw/core/qdev.c
>>> +++ b/hw/core/qdev.c
>>> @@ -581,6 +581,12 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
>>>  BusState *qdev_get_child_bus(DeviceState *dev, const char *name)
>>>  {
>>>      BusState *bus;
>>> +    Object *child = object_resolve_path_component(OBJECT(dev), name);
>>> +
>>> +    bus = (BusState *)object_dynamic_cast(child, TYPE_BUS);
>>> +    if (bus) {
>>> +        return bus;
>>> +    }
>>>
>>>      QLIST_FOREACH(bus, &dev->child_bus, sibling) {
>>>          if (strcmp(name, bus->name) == 0) {
>>> --
>>> 1.9.1
>>>
>>>
>

  reply	other threads:[~2016-01-08  0:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-20  5:43 [Qemu-devel] [PATCH v6 0/6] Connect the SPI devices to ZynqMP Peter Crosthwaite
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 1/6] qdev: get_child_bus(): Use QOM lookup if available Peter Crosthwaite
2016-01-07  0:18   ` Alistair Francis
2016-01-07  0:25     ` Peter Crosthwaite
2016-01-08  0:04       ` Alistair Francis [this message]
2016-01-07 16:04   ` Peter Maydell
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 2/6] m25p80.c: Add sst25wf080 SPI flash device Peter Crosthwaite
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 3/6] ssi: Move ssi.h into a separate directory Peter Crosthwaite
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 4/6] xilinx_spips: Separate the state struct into a header Peter Crosthwaite
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 5/6] xlnx-zynqmp: Connect the SPI devices Peter Crosthwaite
2016-01-07 15:55   ` Peter Maydell
2016-01-15 15:21     ` Peter Maydell
2016-01-15 21:32       ` Alistair Francis
2015-12-20  5:43 ` [Qemu-devel] [PATCH v6 6/6] xlnx-ep108: Connect the SPI Flash Peter Crosthwaite

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='CAKmqyKMRSggRXY1U_2vY65TXuKs4RxBe4Rs-Jud7=iiPV1t9oA@mail.gmail.com' \
    --to=alistair.francis@xilinx.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --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.