* [Qemu-devel] [6523] Add qemu_iovec_reset() (Avi Kivity)
@ 2009-02-05 21:23 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-02-05 21:23 UTC (permalink / raw)
To: qemu-devel
Revision: 6523
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6523
Author: aliguori
Date: 2009-02-05 21:23:54 +0000 (Thu, 05 Feb 2009)
Log Message:
-----------
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>
Modified Paths:
--------------
trunk/cutils.c
trunk/qemu-common.h
Modified: trunk/cutils.c
===================================================================
--- trunk/cutils.c 2009-02-05 21:23:50 UTC (rev 6522)
+++ trunk/cutils.c 2009-02-05 21:23:54 UTC (rev 6523)
@@ -129,6 +129,12 @@
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;
Modified: trunk/qemu-common.h
===================================================================
--- trunk/qemu-common.h 2009-02-05 21:23:50 UTC (rev 6522)
+++ trunk/qemu-common.h 2009-02-05 21:23:54 UTC (rev 6523)
@@ -201,6 +201,7 @@
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-05 21:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-05 21:23 [Qemu-devel] [6523] Add qemu_iovec_reset() (Avi Kivity) Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).