virtio: handle non-virtio-1-capable backend for ccw
commit11380b36196c483ff5c7f800b0f7af6aa53b5657
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 2 Dec 2015 17:31:57 +0000 (2 18:31 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 2 Dec 2015 17:34:11 +0000 (2 19:34 +0200)
tree616f8cd145d8c08199f51ba39d9cae715c6d5b9a
parent6d0b908a628a7086fa855c68b217cc1e2a5c4c19
virtio: handle non-virtio-1-capable backend for ccw

If you run a qemu advertising VERSION_1 with an old kernel where
vhost did not yet support VERSION_1, you'll end up with a device
that is {modern pci|ccw revision 1} but does not advertise VERSION_1.
This is not a sensible configuration and is rejected by the Linux
guest drivers.

To fix this, add a ->post_plugged() callback invoked after features
have been queried that can handle the VERSION_1 bit being withdrawn
and change ccw to fall back to revision 0 if VERSION_1 is gone.

Note that pci is _not_ fixed; we'll need to rethink the approach
for the next release but at least for pci it's not a regression.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/s390x/virtio-ccw.c
hw/virtio/virtio-bus.c
include/hw/virtio/virtio-bus.h