summaryrefslogtreecommitdiff
path: root/cutils.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 21:23:54 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 21:23:54 +0000
commitbe959463afd3e257611d6b6ab98d24c0c94d4e3d (patch)
tree71bba16628c40da3af95a8a05d9470fa26c8bd6e /cutils.c
parent244ab90e17e4feefbf35224d6d7bd96d394b4b26 (diff)
downloadqemu-be959463afd3e257611d6b6ab98d24c0c94d4e3d.tar.gz
qemu-be959463afd3e257611d6b6ab98d24c0c94d4e3d.tar.bz2
qemu-be959463afd3e257611d6b6ab98d24c0c94d4e3d.zip
Add qemu_iovec_reset() (Avi Kivity)
Add a helper to zero out an existing iovec. Removes the need to deallocate and reallocate it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6523 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cutils.c')
-rw-r--r--cutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cutils.c b/cutils.c
index 1090aa4c77..658746b8f0 100644
--- a/cutils.c
+++ b/cutils.c
@@ -129,6 +129,12 @@ void qemu_iovec_destroy(QEMUIOVector *qiov)
qemu_free(qiov->iov);
}
+void qemu_iovec_reset(QEMUIOVector *qiov)
+{
+ qiov->niov = 0;
+ qiov->size = 0;
+}
+
void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf)
{
uint8_t *p = (uint8_t *)buf;