virtio: refactor find_vqs
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 26 Jul 2009 12:48:08 +0000 (15:48 +0300)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 30 Jul 2009 06:33:45 +0000 (16:03 +0930)
commite969fed542cae08cb11d666efac4f7c5d624d09f
tree7de7cb45ba6b3a28ef0054df71c7dc7676d4af65
parentf6c82507030d61e15928d5cad946d3eac1c4a384
virtio: refactor find_vqs

This refactors find_vqs, making it more readable and robust, and fixing
two regressions from 2.6.30:
- double free_irq causing BUG_ON on device removal
- probe failure when vq can't be assigned to msi-x vector
  (reported on old host kernels)

Tested-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_pci.c