qemu/hw/virtio
Eduardo Habkost f6e501a28e virtio: Provide version-specific variants of virtio PCI devices
Many of the current virtio-*-pci device types actually represent
3 different types of devices:
* virtio 1.0 non-transitional devices
* virtio 1.0 transitional devices
* virtio 0.9 ("legacy device" in virtio 1.0 terminology)

That would be just an annoyance if it didn't break our device/bus
compatibility QMP interfaces.  With these multi-purpose device
types, there's no way to tell management software that
transitional devices and legacy devices require a Conventional
PCI bus.

The multi-purpose device types would also prevent us from telling
management software what's the PCI vendor/device ID for them,
because their PCI IDs change at runtime depending on the bus
where they were plugged.

This patch adds separate device types for each of those virtio
device flavors:

- virtio-*-pci: the existing multi-purpose device types
  - Configurable using `disable-legacy` and `disable-modern`
    properties
  - Legacy driver support is automatically enabled/disabled
    depending on the bus where it is plugged
  - Supports Conventional PCI and PCI Express buses
    (but Conventional PCI is incompatible with
    disable-legacy=off)
  - Changes PCI vendor/device IDs at runtime
- virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
  - Supports Conventional PCI buses only, because
    it has a PIO BAR
- virtio-*-pci-non-transitional: modern-only
  - Supports both Conventional PCI and PCI Express buses

The existing TYPE_* macros for these types will point to an
abstract base type, so existing casts in the code will keep
working for all variants.

A simple test script (tests/acceptance/virtio_version.py) is
included, to check if the new device types are equivalent to
using the `disable-legacy` and `disable-modern` options.

Acked-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-12-19 16:48:16 -05:00
..
Makefile.objs hw: make virtio devices configurable via default-configs/ 2018-06-01 15:14:31 +02:00
trace-events vhost: add trace for IOTLB miss 2018-05-23 03:14:41 +03:00
vhost-backend.c vhost: fix a memory leak 2017-08-02 00:13:25 +03:00
vhost-stub.c vhost-user: introduce shared vhost-user state 2018-05-24 21:14:11 +03:00
vhost-user.c vhost-user: Don't ask for reply on postcopy mem table set 2018-10-11 19:58:26 +01:00
vhost-vsock.c hw: use "qemu/osdep.h" as first #include in source files 2017-12-18 17:07:02 +03:00
vhost.c vhost: fix invalid downcast 2018-09-07 17:05:18 -04:00
virtio-balloon.c qapi: Drop qapi_event_send_FOO()'s Error ** argument 2018-08-28 18:21:38 +02:00
virtio-bus.c virtio: remove event notifier cleanup call on de-assign 2018-02-08 21:06:26 +02:00
virtio-crypto-pci.c virtio: Helper for registering virtio device types 2018-12-19 16:48:16 -05:00
virtio-crypto.c cryptodev: add vhost support 2018-03-01 18:26:17 +02:00
virtio-mmio.c virtio-mmio: switch to linux headers 2017-01-18 22:59:53 +02:00
virtio-pci.c virtio: Provide version-specific variants of virtio PCI devices 2018-12-19 16:48:16 -05:00
virtio-pci.h virtio: Provide version-specific variants of virtio PCI devices 2018-12-19 16:48:16 -05:00
virtio-rng.c qom: make user_creatable_complete() specific to UserCreatable 2018-12-11 15:45:22 -02:00
virtio.c virtio: pass argument by value for virtqueue_map_iovec() 2018-12-11 18:28:46 +01:00