diff options
author | Amit Shah | 2010-04-27 14:34:06 +0200 |
---|---|---|
committer | Anthony Liguori | 2010-04-28 15:58:22 +0200 |
commit | fa6111f215736e44f0ac4fc50947e6c407588c28 (patch) | |
tree | 28a1e359c6292845b02521cf94e7b99e196a9d24 /hw/iov.h | |
parent | iov: Introduce a new file for helpers around iovs, add iov_from_buf() (diff) | |
download | qemu-fa6111f215736e44f0ac4fc50947e6c407588c28.tar.gz qemu-fa6111f215736e44f0ac4fc50947e6c407588c28.tar.xz qemu-fa6111f215736e44f0ac4fc50947e6c407588c28.zip |
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>
Diffstat (limited to 'hw/iov.h')
-rw-r--r-- | hw/iov.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -14,3 +14,6 @@ size_t iov_from_buf(struct iovec *iov, unsigned int iovcnt, const void *buf, size_t size); +size_t iov_to_buf(const struct iovec *iov, const unsigned int iovcnt, + void *buf, size_t offset, size_t size); +size_t iov_size(const struct iovec *iov, const unsigned int iovcnt); |