aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cutils.c6
-rw-r--r--qemu-common.h1
2 files changed, 7 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;
diff --git a/qemu-common.h b/qemu-common.h
index 8aef55867b..db3349315b 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -201,6 +201,7 @@ typedef struct QEMUIOVector {
void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
void qemu_iovec_destroy(QEMUIOVector *qiov);
+void qemu_iovec_reset(QEMUIOVector *qiov);
void qemu_iovec_to_buffer(QEMUIOVector *qiov, void *buf);
void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count);