[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus. |
Date: |
Thu, 29 Nov 2012 13:53:22 +0000 |
On 29 November 2012 13:47, Konrad Frederic <address@hidden> wrote:
> On 29/11/2012 14:09, Peter Maydell wrote:
>> I suspect that qbus_find_recursive should be doing an
>> object_class_dynamic_cast() to check that the bus is of a suitable
>> type, rather than the
>> (strcmp(object_get_typename(OBJECT(bus)), bus_typename) != 0)
>> which it does at the moment.
>
> Yes, but we can cast VIRTIO_BUS in BUS no ?
> So in this case we could plug VirtioDevice in BUS and that's not what we
> want ?
I don't understand what you're asking. qbus_find_recursive()
looks for a bus which might be specified either by name or by
bus type. At the moment it insists on an exact type match
(so if you ask for a virtio-bus you have to provide a virtio-bus
object, not a subclass of virtio-bus); it should do a dynamic
cast, so anything which is a virtio-bus or a subclass of that
will do. Yes, if you say "please find me any bus which is a
bus of any kind" then you'll get something wrong back -- so
don't do that. In particular, since VirtioDevice sets its
bus_type to TYPE_VIRTIO_BUS then we will ask for that, and
anything which isn't a virtio bus (or subclass) won't be found.
-- PMM
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., (continued)
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Andreas Färber, 2012/11/24
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Peter Maydell, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Peter Maydell, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.,
Peter Maydell <=
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Andreas Färber, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Andreas Färber, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Stefan Hajnoczi, 2012/11/26
[Qemu-devel] [RFC PATCH v2 3/3] virtio-blk : add the virtio-blk device., fred . konrad, 2012/11/22
Re: [Qemu-devel] [RFC PATCH v2 0/3] Virtio-refactoring., Peter Maydell, 2012/11/22