vhost.c (dc1e1350f8061021df765b396295329797d66933) | vhost.c (95129d6fc9ead97155627a4ca0cfd37282883658) |
---|---|
1/* 2 * vhost support 3 * 4 * Copyright Red Hat, Inc. 2010 5 * 6 * Authors: 7 * Michael S. Tsirkin <mst@redhat.com> 8 * --- 728 unchanged lines hidden (view full) --- 737 } 738 739 state.num = virtio_queue_get_last_avail_idx(vdev, idx); 740 r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_BASE, &state); 741 if (r) { 742 return -errno; 743 } 744 | 1/* 2 * vhost support 3 * 4 * Copyright Red Hat, Inc. 2010 5 * 6 * Authors: 7 * Michael S. Tsirkin <mst@redhat.com> 8 * --- 728 unchanged lines hidden (view full) --- 737 } 738 739 state.num = virtio_queue_get_last_avail_idx(vdev, idx); 740 r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_BASE, &state); 741 if (r) { 742 return -errno; 743 } 744 |
745 if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1) && | 745 if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) && |
746 virtio_legacy_is_cross_endian(vdev)) { 747 r = vhost_virtqueue_set_vring_endian_legacy(dev, 748 virtio_is_big_endian(vdev), 749 vhost_vq_index); 750 if (r) { 751 return -errno; 752 } 753 } --- 80 unchanged lines hidden (view full) --- 834 fflush(stderr); 835 } 836 virtio_queue_set_last_avail_idx(vdev, idx, state.num); 837 virtio_queue_invalidate_signalled_used(vdev, idx); 838 839 /* In the cross-endian case, we need to reset the vring endianness to 840 * native as legacy devices expect so by default. 841 */ | 746 virtio_legacy_is_cross_endian(vdev)) { 747 r = vhost_virtqueue_set_vring_endian_legacy(dev, 748 virtio_is_big_endian(vdev), 749 vhost_vq_index); 750 if (r) { 751 return -errno; 752 } 753 } --- 80 unchanged lines hidden (view full) --- 834 fflush(stderr); 835 } 836 virtio_queue_set_last_avail_idx(vdev, idx, state.num); 837 virtio_queue_invalidate_signalled_used(vdev, idx); 838 839 /* In the cross-endian case, we need to reset the vring endianness to 840 * native as legacy devices expect so by default. 841 */ |
842 if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1) && | 842 if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) && |
843 virtio_legacy_is_cross_endian(vdev)) { 844 r = vhost_virtqueue_set_vring_endian_legacy(dev, 845 !virtio_is_big_endian(vdev), 846 vhost_vq_index); 847 if (r < 0) { 848 error_report("failed to reset vring endianness"); 849 } 850 } --- 336 unchanged lines hidden --- | 843 virtio_legacy_is_cross_endian(vdev)) { 844 r = vhost_virtqueue_set_vring_endian_legacy(dev, 845 !virtio_is_big_endian(vdev), 846 vhost_vq_index); 847 if (r < 0) { 848 error_report("failed to reset vring endianness"); 849 } 850 } --- 336 unchanged lines hidden --- |