mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
virtio: endianness checks for virtio 1.0 devices
Add code that checks for the VERSION_1 feature bit in order to make decisions about the device's endianness. This allows us to support transitional devices. 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> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
24bfa207ef
commit
3c185597c8
3 changed files with 15 additions and 3 deletions
|
@ -903,7 +903,11 @@ static bool virtio_device_endian_needed(void *opaque)
|
|||
VirtIODevice *vdev = opaque;
|
||||
|
||||
assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
|
||||
return vdev->device_endian != virtio_default_endian();
|
||||
if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) {
|
||||
return vdev->device_endian != virtio_default_endian();
|
||||
}
|
||||
/* Devices conforming to VIRTIO 1.0 or later are always LE. */
|
||||
return vdev->device_endian != VIRTIO_DEVICE_ENDIAN_LITTLE;
|
||||
}
|
||||
|
||||
static bool virtio_64bit_features_needed(void *opaque)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue