summaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2016-11-04 12:04:23 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-11-15 17:20:36 +0200
commit9b706dbbbb81f5cb7c67e491d38cd6077205e056 (patch)
treea6169a835baa959e8dbdaae6cadb22136665ad9e /hw/s390x
parent1b39bc1cf67eee07518ee05ce9306eaa53d868e4 (diff)
downloadqemu-9b706dbbbb81f5cb7c67e491d38cd6077205e056.tar.gz
virtio: allow per-device-class legacy features
Legacy features are those that transitional devices only expose on the legacy interface. Allow different ones per device class. Cc: qemu-stable@nongnu.org # dependency for the next patch Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/virtio-ccw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 7d7f8f6e19..f5c1d98192 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -303,6 +303,8 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
if (!ccw.cda) {
ret = -EFAULT;
} else {
+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
+
features.index = address_space_ldub(&address_space_memory,
ccw.cda
+ sizeof(features.features),
@@ -312,7 +314,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
if (dev->revision >= 1) {
/* Don't offer legacy features for modern devices. */
features.features = (uint32_t)
- (vdev->host_features & ~VIRTIO_LEGACY_FEATURES);
+ (vdev->host_features & ~vdc->legacy_features);
} else {
features.features = (uint32_t)vdev->host_features;
}