summaryrefslogtreecommitdiffstats
path: root/hw/iov.h
diff options
context:
space:
mode:
authorAmit Shah2010-04-27 14:34:06 +0200
committerAnthony Liguori2010-04-28 15:58:22 +0200
commitfa6111f215736e44f0ac4fc50947e6c407588c28 (patch)
tree28a1e359c6292845b02521cf94e7b99e196a9d24 /hw/iov.h
parentiov: Introduce a new file for helpers around iovs, add iov_from_buf() (diff)
downloadqemu-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/iov.h b/hw/iov.h
index 5e3e54123d..60a85470bd 100644
--- a/hw/iov.h
+++ b/hw/iov.h
@@ -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);