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
..
2016-09-08 18:05:21 +04:00
2016-05-18 15:04:27 +03:00
2016-09-08 18:05:21 +04:00
2013-04-08 18:13:10 +02:00
2016-06-24 05:13:57 +03:00
2016-09-13 19:09:44 +02:00
2016-09-06 17:06:50 +02:00
2016-05-19 16:42:30 +02:00
2014-10-23 16:41:25 +02:00
2016-04-07 19:57:33 +03:00
2016-06-06 16:59:31 +01:00
2016-09-08 18:05:22 +04:00
2013-04-08 18:13:10 +02:00
2016-06-22 12:53:26 +02:00