Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Konrad Frederic
On 29/11/2012 14:55, Andreas Färber wrote: Am 29.11.2012 14:47, schrieb Konrad Frederic: 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 pointe

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Andreas Färber
Am 29.11.2012 14:47, schrieb Konrad Frederic: > 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 -

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Peter Maydell
On 29 November 2012 13:47, Konrad Frederic 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)), bu

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Anthony Liguori
Konrad Frederic writes: > On 26/11/2012 17:59, Anthony Liguori wrote: >> Peter Maydell writes: >> >>> On 26 November 2012 14:33, Anthony Liguori wrote: VirtioBusInfo is not a great name. This is a proxy class that allows for a device to implement the virtio bus interface. T

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Konrad Frederic
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 tro

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Peter Maydell
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

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-29 Thread Konrad Frederic
On 26/11/2012 17:59, Anthony Liguori wrote: Peter Maydell writes: On 26 November 2012 14:33, Anthony Liguori wrote: VirtioBusInfo is not a great name. This is a proxy class that allows for a device to implement the virtio bus interface. This could be done as an interface but since nothing

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Anthony Liguori
Peter Maydell writes: > On 26 November 2012 14:33, Anthony Liguori wrote: >> VirtioBusInfo is not a great name. This is a proxy class that allows >> for a device to implement the virtio bus interface. >> >> This could be done as an interface but since nothing else uses >> interfaces, I'm okay w

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Anthony Liguori
Andreas Färber writes: > Am 26.11.2012 15:33, schrieb Anthony Liguori: >> fred.kon...@greensocs.com writes: >>> +#define DEBUG_VIRTIO_BUS 1 >>> + >>> +#define DPRINTF(fmt, ...) if (DEBUG_VIRTIO_BUS) {\ >>> +printf("virtio_bus: " fmt , ## __VA_AR

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Stefan Hajnoczi
On Mon, Nov 26, 2012 at 08:33:23AM -0600, Anthony Liguori wrote: > fred.kon...@greensocs.com writes: > > > From: KONRAD Frederic > > > > This patch create a new VirtioBus, which can be added to Virtio transports > > like > > virtio-pci, virtio-mmio,... > > > > One VirtIODevice can be connected t

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Konrad Frederic
On 26/11/2012 15:33, Anthony Liguori wrote: fred.kon...@greensocs.com writes: From: KONRAD Frederic This patch create a new VirtioBus, which can be added to Virtio transports like virtio-pci, virtio-mmio,... One VirtIODevice can be connected to this device, like virtio-blk in the 3rd patch.

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Andreas Färber
Am 26.11.2012 15:33, schrieb Anthony Liguori: > fred.kon...@greensocs.com writes: >> +#define DEBUG_VIRTIO_BUS 1 >> + >> +#define DPRINTF(fmt, ...) if (DEBUG_VIRTIO_BUS) {\ >> +printf("virtio_bus: " fmt , ## __VA_ARGS__); \ >> +

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Peter Maydell
On 26 November 2012 14:33, Anthony Liguori wrote: > VirtioBusInfo is not a great name. This is a proxy class that allows > for a device to implement the virtio bus interface. > > This could be done as an interface but since nothing else uses > interfaces, I'm okay with something like this. But t

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Anthony Liguori
fred.kon...@greensocs.com writes: > From: KONRAD Frederic > > This patch create a new VirtioBus, which can be added to Virtio transports > like > virtio-pci, virtio-mmio,... > > One VirtIODevice can be connected to this device, like virtio-blk in the 3rd > patch. > > The VirtioBus shares through

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Cornelia Huck
On Mon, 26 Nov 2012 14:55:56 +0100 Konrad Frederic wrote: > On 23/11/2012 13:08, Cornelia Huck wrote: > > On Thu, 22 Nov 2012 15:50:50 +0100 > > fred.kon...@greensocs.com wrote: > > > > > >> +/* Create a virtio bus. */ > >> +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info)

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-26 Thread Konrad Frederic
On 23/11/2012 13:08, Cornelia Huck wrote: On Thu, 22 Nov 2012 15:50:50 +0100 fred.kon...@greensocs.com wrote: +/* Create a virtio bus. */ +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info) +{ +/* + * This is needed, as we want to have different names for each vir

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-24 Thread Andreas Färber
Am 22.11.2012 15:50, schrieb fred.kon...@greensocs.com: > diff --git a/hw/virtio-bus.c b/hw/virtio-bus.c > new file mode 100644 > index 000..991b6f5 > --- /dev/null > +++ b/hw/virtio-bus.c [...] > +#define DEBUG_VIRTIO_BUS 1 We probably want to disable debug output by default as done elsewhere

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Stefan Hajnoczi
On Fri, Nov 23, 2012 at 03:21:30PM +0100, Konrad Frederic wrote: > On 23/11/2012 13:23, Stefan Hajnoczi wrote: > >On Thu, Nov 22, 2012 at 03:50:50PM +0100, fred.kon...@greensocs.com wrote: > >>+struct VirtioBusInfo { > >This is defining an ad-hoc interface. QOM has support for interfaces so > >tha

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Cornelia Huck
On Fri, 23 Nov 2012 15:12:45 +0100 Konrad Frederic wrote: > On 23/11/2012 13:08, Cornelia Huck wrote: > > On Thu, 22 Nov 2012 15:50:50 +0100 > > fred.kon...@greensocs.com wrote: > > > > > >> +/* Create a virtio bus. */ > >> +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info)

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Konrad Frederic
On 23/11/2012 13:23, Stefan Hajnoczi wrote: On Thu, Nov 22, 2012 at 03:50:50PM +0100, fred.kon...@greensocs.com wrote: +/* Bind the VirtIODevice to the VirtioBus. */ +void virtio_bus_bind_device(VirtioBus *bus) +{ +BusState *qbus = BUS(bus); +assert(bus != NULL); +assert(bus->vdev !=

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Konrad Frederic
On 23/11/2012 13:08, Cornelia Huck wrote: On Thu, 22 Nov 2012 15:50:50 +0100 fred.kon...@greensocs.com wrote: +/* Create a virtio bus. */ +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info) +{ +/* + * This is needed, as we want to have different names for each vir

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Stefan Hajnoczi
On Thu, Nov 22, 2012 at 03:50:50PM +0100, fred.kon...@greensocs.com wrote: > +/* Bind the VirtIODevice to the VirtioBus. */ > +void virtio_bus_bind_device(VirtioBus *bus) > +{ > +BusState *qbus = BUS(bus); > +assert(bus != NULL); > +assert(bus->vdev != NULL); > +virtio_bind_device(b

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-23 Thread Cornelia Huck
On Thu, 22 Nov 2012 15:50:50 +0100 fred.kon...@greensocs.com wrote: > +/* Create a virtio bus. */ > +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info) > +{ > +/* > + * This is needed, as we want to have different names for each > virtio-bus. > + * If we don't d

[Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.

2012-11-22 Thread fred . konrad
From: KONRAD Frederic This patch create a new VirtioBus, which can be added to Virtio transports like virtio-pci, virtio-mmio,... One VirtIODevice can be connected to this device, like virtio-blk in the 3rd patch. The VirtioBus shares through a VirtioBusInfo structure : * two callbacks wit