Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-25 Thread Peter Xu
On Fri, Oct 22, 2021 at 04:43:43AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 22, 2021 at 10:33:15AM +0800, Peter Xu wrote: > > Hi, Michael, > > > > On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > > > +typedef struct { > > > > +pci_bus_dev_fn fn; > > > > +void *

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-25 Thread Michael S. Tsirkin
On Mon, Oct 25, 2021 at 08:57:36PM +0800, Peter Xu wrote: > On Fri, Oct 22, 2021 at 04:43:43AM -0400, Michael S. Tsirkin wrote: > > On Fri, Oct 22, 2021 at 10:33:15AM +0800, Peter Xu wrote: > > > Hi, Michael, > > > > > > On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > > > >

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-22 Thread Michael S. Tsirkin
On Fri, Oct 22, 2021 at 10:33:15AM +0800, Peter Xu wrote: > Hi, Michael, > > On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > > +typedef struct { > > > +pci_bus_dev_fn fn; > > > +void *opaque; > > > +} pci_bus_dev_args; > > > > code style violation. CamelCase for st

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-21 Thread Peter Xu
Hi, Michael, On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > +typedef struct { > > +pci_bus_dev_fn fn; > > +void *opaque; > > +} pci_bus_dev_args; > > code style violation. CamelCase for structs pls. OK. > > +/* Call 'fn' for each pci device on the system */ > >

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-21 Thread Michael S. Tsirkin
On Thu, Oct 21, 2021 at 06:42:58PM +0800, Peter Xu wrote: > With all the prepared infrastructures, we can easily add one helper now to > loop > over all the existing PCI devices across the whole system. > > Signed-off-by: Peter Xu > --- > hw/pci/pci.c | 25 + > i

[PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-21 Thread Peter Xu
With all the prepared infrastructures, we can easily add one helper now to loop over all the existing PCI devices across the whole system. Signed-off-by: Peter Xu --- hw/pci/pci.c | 25 + include/hw/pci/pci.h | 2 ++ 2 files changed, 27 insertions(+) diff --git