xemu/hw/virtio
Stefan Hajnoczi b1c7c07f2d virtio: use unsigned int for virtqueue_get_avail_bytes() index
The virtio code uses int, unsigned int, and uint16_t for virtqueue
indices.  The uint16_t is used for the low-level descriptor layout in
virtio_ring.h while code that isn't concerned with descriptor layout can
use unsigned int.

Use of int is problematic because it can result in signed/unsigned
comparison and incompatible int*/unsigned int* pointer types.

Make the virtqueue_get_avail_bytes() 'i' variable unsigned int.  This
eliminates the need to introduce casts and modify code further in the
patches that follow.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-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: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-09-23 19:03:56 +03:00
..
Makefile.objs vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
vhost-backend.c vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost-user.c Revert "vhost-user: Attempt to fix a race with set_mem_table." 2016-08-15 15:12:21 +01:00
vhost-vsock.c vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost.c vhost: don't set vring call if no vector 2016-09-09 20:58:34 +03:00
virtio-balloon.c virtio-balloon: fix stats vq migration 2016-09-09 20:58:34 +03:00
virtio-bus.c virtio-bus: Plug devices after features are negotiated 2016-09-15 17:30:03 +03:00
virtio-mmio.c virtio-mmio: format transport base address in BusClass.get_dev_path 2016-07-14 16:51:36 +01:00
virtio-pci.c virtio-bus: Plug devices after features are negotiated 2016-09-15 17:30:03 +03:00
virtio-pci.h virtio-bus: Plug devices after features are negotiated 2016-09-15 17:30:03 +03:00
virtio-rng.c virtio-rng: Wrap in vmstate 2016-07-21 20:44:20 +03:00
virtio.c virtio: use unsigned int for virtqueue_get_avail_bytes() index 2016-09-23 19:03:56 +03:00