qemu-e2k/include/hw/virtio
Maxime Coquelin d1b4259f1a virtio-bus: Plug devices after features are negotiated
Currently, devices are plugged before features are negotiated.
If the backend doesn't support VIRTIO_F_VERSION_1, the transport
needs to rewind some settings.

This is the case for CCW, for which a post_plugged callback had
been introduced, where max_rev field is just updated if
VIRTIO_F_VERSION_1 is not supported by the backend.
For PCI, implementing post_plugged would be much more
complicated, so it needs to know whether the backend supports
VIRTIO_F_VERSION_1 at plug time.

Currently, nothing is done for PCI. Modern capabilities get
exposed to the guest even if VIRTIO_F_VERSION_1 is not supported
by the backend, which confuses the guest.

This patch replaces existing post_plugged solution with an
approach that fits with both transports.
Features negotiation is performed before ->device_plugged() call.
A pre_plugged callback is introduced so that the transports can
set their supported features.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable@nongnu.org
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> [ccw]
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2016-09-15 17:30:03 +03:00
..
vhost-backend.h vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost-scsi.h vhost-scsi: include linux/vhost.h 2015-09-25 12:04:41 +02:00
vhost-vsock.h vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost.h vhost: add vhost_net_set_backend() 2016-07-29 00:33:49 +03:00
virtio-access.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-balloon.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-blk.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-bus.h virtio-bus: Plug devices after features are negotiated 2016-09-15 17:30:03 +03:00
virtio-gpu.h virtio-gpu: fix missing log.h include file 2016-08-16 11:21:31 +01:00
virtio-input.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-net.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-rng.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio-scsi.h virtio-scsi: Replace HandleOutput typedef 2016-07-21 20:44:19 +03:00
virtio-serial.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
virtio.h virtio: add virtqueue_rewind() 2016-09-09 20:58:34 +03:00