From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Te4S1-0004aO-Ig for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:46:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Te4Rv-0005fw-Hy for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:46:49 -0500 Received: from greensocs.com ([87.106.252.221]:35457 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Te4Ru-0005fl-Qi for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:46:43 -0500 Message-ID: <50B76758.70301@greensocs.com> Date: Thu, 29 Nov 2012 14:47:04 +0100 From: Konrad Frederic MIME-Version: 1.0 References: <1353595852-30776-1-git-send-email-fred.konrad@greensocs.com> <1353595852-30776-2-git-send-email-fred.konrad@greensocs.com> <87k3t8qvrg.fsf@codemonkey.ws> <877gp8pafv.fsf@codemonkey.ws> <50B75716.6030308@greensocs.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , e.voevodin@samsung.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, afaerber@suse.de On 29/11/2012 14:09, Peter Maydell wrote: > On 29 November 2012 12:37, Konrad Frederic wrote: >> On 26/11/2012 17:59, Anthony Liguori wrote: >>> virtio-pci-bus extends virtio-bus >>> - is constructed with a pointer to a PCIDevice >>> - implements the methods necessary to be a virtio bus >> I still have trouble with that ^^. >> The problem is that the virtio devices can't be connected to the >> virtio-pci-bus even if it extends virtio-bus because TYPE_VIRTIO_BUS != >> TYPE_VIRTIO_PCI_BUS. > Conceptually it ought to work I think: if the bus is-a TYPE_VIRTIO_BUS > then we should permit plugging in even if the actual bus object happens > to be an instance of a subclass. Yes, is my implementation doing the right thing ? I mean is the virtio-pci-bus a virtio-bus ? > > 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 ? > > -- PMM >