diff options
-rw-r--r-- | cutils.c | 6 | ||||
-rw-r--r-- | qemu-common.h | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -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); |