Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Emanuele
On 07/18/2018 09:33 PM, Paolo Bonzini wrote: On 18/07/2018 20:29, Emanuele wrote: I had to put this patch here because it also introduces qpci_device_init, used by sdhci (patch 3). For the next version I plan to have a patch X where I rename all occurrences of qpci_init_pc in qpci_pc_new,

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Paolo Bonzini
On 11/07/2018 19:46, Emanuele wrote: >>> +static void qpci(void) >>> +{ >>> +    qos_node_create_interface("pci-bus"); >>> +} >>> + >>> +libqos_init(qpci); >> Why does an interface need to be created?  The drivers declare which >> interfaces they support? >> >> I don't think this can be used to

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Paolo Bonzini
On 18/07/2018 20:29, Emanuele wrote: > I had to put this patch here because it also introduces > qpci_device_init, used by sdhci (patch 3). > > For the next version I plan to have a patch X where I rename all > occurrences of qpci_init_pc in qpci_pc_new, and a patch X+1 that > introduces

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Emanuele
On 07/18/2018 04:29 PM, Stefan Hajnoczi wrote: On Wed, Jul 11, 2018 at 05:18:03PM +0200, Paolo Bonzini wrote: On 11/07/2018 16:49, Stefan Hajnoczi wrote: On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Stefan Hajnoczi
On Wed, Jul 11, 2018 at 07:46:09PM +0200, Emanuele wrote: > On 07/11/2018 04:49 PM, Stefan Hajnoczi wrote: > > On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: > > > +void qpci_device_init(QPCIDevice *dev, QPCIBus *bus, int devfn) > > > +{ > > > +if (!bus) { > > > +

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-18 Thread Stefan Hajnoczi
On Wed, Jul 11, 2018 at 05:18:03PM +0200, Paolo Bonzini wrote: > On 11/07/2018 16:49, Stefan Hajnoczi wrote: > > On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: > >> -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc) > >> +static void *qpci_get_driver(void

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-11 Thread Philippe Mathieu-Daudé
Hi Emanuele, On 07/09/2018 06:11 AM, Emanuele Giuseppe Esposito wrote: > Add pci-bus-pc node and pci-bus interface, moved QPCIBusPC struct "move" > declaration in its header (since it will be needed by other drivers) > and introduced a setter method for drivers that do not need to allocate

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-11 Thread Emanuele
On 07/11/2018 04:49 PM, Stefan Hajnoczi wrote: On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc) +static void *qpci_get_driver(void *obj, const char *interface) { -QPCIBusPC *ret = g_new0(QPCIBusPC,

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-11 Thread Paolo Bonzini
On 11/07/2018 16:49, Stefan Hajnoczi wrote: > On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: >> -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc) >> +static void *qpci_get_driver(void *obj, const char *interface) >> { >> -QPCIBusPC *ret =

Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes

2018-07-11 Thread Stefan Hajnoczi
On Mon, Jul 09, 2018 at 11:11:31AM +0200, Emanuele Giuseppe Esposito wrote: > -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc) > +static void *qpci_get_driver(void *obj, const char *interface) > { > -QPCIBusPC *ret = g_new0(QPCIBusPC, 1); > +QPCIBusPC *qpci = obj; > +if