From: Luca T. <kro...@gm...> - 2008-04-22 15:12:23
|
On Tue, Apr 22, 2008 at 4:15 PM, Anthony Liguori <ali...@us...> wrote: > This patch changes virtio devices to be multi-function devices whenever > possible. This increases the number of virtio devices we can support now by > a factor of 8. [...] > diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c > index 9100bb1..9ea14d3 100644 > --- a/qemu/hw/virtio.c > +++ b/qemu/hw/virtio.c > @@ -405,9 +405,18 @@ VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name, > PCIDevice *pci_dev; > uint8_t *config; > uint32_t size; > + static int devfn = 7; > + > + if ((devfn % 8) == 7) > + devfn = -1; > + else > + devfn++; This code look strange... devfn should be passed to virtio_init_pci by virtio-{net,blk} init functions, no? Luca |