iov: Introduce a new file for helpers around iovs, add iov_from_buf()
commite4d5639dbb6181ebbfdb554f2594721b2d63882b
authorAmit Shah <amit.shah@redhat.com>
Tue, 27 Apr 2010 12:34:05 +0000 (27 18:04 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 28 Apr 2010 13:58:22 +0000 (28 08:58 -0500)
tree1ad23eabc520022e909e73bbc3affbdfca4cc25f
parent3ecb45f893d09a97b8f24399b5e40808a708261f
iov: Introduce a new file for helpers around iovs, add iov_from_buf()

The virtio-net code uses iov_fill() which fills an iov from a linear
buffer. The virtio-serial-bus code does something similar in an
open-coded function.

Create a new iov.c file that has iov_from_buf().

Convert virtio-net and virtio-serial-bus over to use this functionality.
virtio-net used ints to hold sizes, the new function is going to use
size_t types.

Later commits will add the opposite functionality -- going from an iov
to a linear buffer.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Makefile
Makefile.objs
hw/iov.c [new file with mode: 0644]
hw/iov.h [new file with mode: 0644]
hw/virtio-net.c
hw/virtio-serial-bus.c