iov: Add iov_to_buf and iov_size helpers
commitfa6111f215736e44f0ac4fc50947e6c407588c28
authorAmit Shah <amit.shah@redhat.com>
Tue, 27 Apr 2010 12:34:06 +0000 (27 18:04 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 28 Apr 2010 13:58:22 +0000 (28 08:58 -0500)
tree28a1e359c6292845b02521cf94e7b99e196a9d24
parente4d5639dbb6181ebbfdb554f2594721b2d63882b
iov: Add iov_to_buf and iov_size helpers

iov_to_buf() puts the buffer contents in the iov in a linearized buffer.

iov_size() gets the length of the contents in the iov.

The iov_to_buf() function is the memcpy_to_iovec() function that was
used in virtio-ballon.c.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/iov.c
hw/iov.h
hw/virtio-balloon.c