summaryrefslogtreecommitdiffstats
path: root/hw/virtio/virtio-pci.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin2016-11-04 11:04:23 +0100
committerMichael S. Tsirkin2016-11-15 16:20:36 +0100
commit9b706dbbbb81f5cb7c67e491d38cd6077205e056 (patch)
treea6169a835baa959e8dbdaae6cadb22136665ad9e /hw/virtio/virtio-pci.c
parentacpi: fix DMAR device scope for IOAPIC (diff)
downloadqemu-9b706dbbbb81f5cb7c67e491d38cd6077205e056.tar.gz
qemu-9b706dbbbb81f5cb7c67e491d38cd6077205e056.tar.xz
qemu-9b706dbbbb81f5cb7c67e491d38cd6077205e056.zip
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/virtio/virtio-pci.c')
-rw-r--r--hw/virtio/virtio-pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 62001b46d7..97b32febaf 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1175,7 +1175,9 @@ static uint64_t virtio_pci_common_read(void *opaque, hwaddr addr,
break;
case VIRTIO_PCI_COMMON_DF:
if (proxy->dfselect <= 1) {
- val = (vdev->host_features & ~VIRTIO_LEGACY_FEATURES) >>
+ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
+
+ val = (vdev->host_features & ~vdc->legacy_features) >>
(32 * proxy->dfselect);
}
break;