aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2008-01-28 10:59:59 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-02-04 07:50:12 -0500
commit55a7c066041e7850948d29ed813f62821a9ec046 (patch)
treeea4ef20c8014d5222957cef83d4fc62b75c58fd6 /drivers/virtio
parent3343660d8c62c6b00b2f15324ef3fcb6be207bfa (diff)
virtio: Use PCI revision field to indicate virtio PCI ABI version
As Avi pointed out, as we continue to massage the virtio PCI ABI, we can make things a little more friendly to users by utilizing the PCI revision field to indicate which version of the ABI we're using. This is a hard ABI version and incrementing it will cause the guest driver to break. This is the necessary changes to virtio_pci to support this. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 192687e3a56a..26f787ddd5ff 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -311,6 +311,12 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
311 if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f) 311 if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f)
312 return -ENODEV; 312 return -ENODEV;
313 313
314 if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) {
315 printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n",
316 VIRTIO_PCI_ABI_VERSION, pci_dev->revision);
317 return -ENODEV;
318 }
319
314 /* allocate our structure and fill it out */ 320 /* allocate our structure and fill it out */
315 vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL); 321 vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL);
316 if (vp_dev == NULL) 322 if (vp_dev == NULL)