summaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-01-15 09:06:26 -0500
committerRusty Russell <rusty@rustcorp.com.au>2015-01-21 00:58:59 -0500
commit46506da5f365efe7fe3e4c9da73ab679c0382fac (patch)
treee8f11e77b344a635815b60968f4f694d3f60af93 /drivers/virtio
parent0327642337fee1dba50fa4d9a45d3a8b8fb2d1c3 (diff)
virtio_pci: add an option to disable legacy driver
Useful for testing device virtio 1 compatibility. Based on patch by Rusty - couldn't resist putting that flying car joke in there! Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/Kconfig19
-rw-r--r--drivers/virtio/Makefile3
-rw-r--r--drivers/virtio/virtio_pci_common.h10
3 files changed, 31 insertions, 1 deletions
diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index 083fb45950f5..b546da5d8ea3 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -19,6 +19,25 @@ config VIRTIO_PCI
19 19
20 If unsure, say M. 20 If unsure, say M.
21 21
22config VIRTIO_PCI_LEGACY
23 bool "Support for legacy virtio draft 0.9.X and older devices"
24 default y
25 depends on VIRTIO_PCI
26 ---help---
27 Virtio PCI Card 0.9.X Draft (circa 2014) and older device support.
28
29 This option enables building a transitional driver, supporting
30 both devices conforming to Virtio 1 specification, and legacy devices.
31 If disabled, you get a slightly smaller, non-transitional driver,
32 with no legacy compatibility.
33
34 So look out into your driveway. Do you have a flying car? If
35 so, you can happily disable this option and virtio will not
36 break. Otherwise, leave it set. Unless you're testing what
37 life will be like in The Future.
38
39 If unsure, say Y.
40
22config VIRTIO_BALLOON 41config VIRTIO_BALLOON
23 tristate "Virtio balloon driver" 42 tristate "Virtio balloon driver"
24 depends on VIRTIO 43 depends on VIRTIO
diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
index bd230d1c0533..d85565b8ea46 100644
--- a/drivers/virtio/Makefile
+++ b/drivers/virtio/Makefile
@@ -1,5 +1,6 @@
1obj-$(CONFIG_VIRTIO) += virtio.o virtio_ring.o 1obj-$(CONFIG_VIRTIO) += virtio.o virtio_ring.o
2obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o 2obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
3obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o 3obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
4virtio_pci-y := virtio_pci_modern.o virtio_pci_legacy.o virtio_pci_common.o 4virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
5virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
5obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o 6obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
index d39180512761..28ee4e56badf 100644
--- a/drivers/virtio/virtio_pci_common.h
+++ b/drivers/virtio/virtio_pci_common.h
@@ -147,8 +147,18 @@ const char *vp_bus_name(struct virtio_device *vdev);
147 */ 147 */
148int vp_set_vq_affinity(struct virtqueue *vq, int cpu); 148int vp_set_vq_affinity(struct virtqueue *vq, int cpu);
149 149
150#if IS_ENABLED(CONFIG_VIRTIO_PCI_LEGACY)
150int virtio_pci_legacy_probe(struct virtio_pci_device *); 151int virtio_pci_legacy_probe(struct virtio_pci_device *);
151void virtio_pci_legacy_remove(struct virtio_pci_device *); 152void virtio_pci_legacy_remove(struct virtio_pci_device *);
153#else
154static inline int virtio_pci_legacy_probe(struct virtio_pci_device *vp_dev)
155{
156 return -ENODEV;
157}
158static inline void virtio_pci_legacy_remove(struct virtio_pci_device *vp_dev)
159{
160}
161#endif
152int virtio_pci_modern_probe(struct virtio_pci_device *); 162int virtio_pci_modern_probe(struct virtio_pci_device *);
153void virtio_pci_modern_remove(struct virtio_pci_device *); 163void virtio_pci_modern_remove(struct virtio_pci_device *);
154 164