aboutsummaryrefslogtreecommitdiff
path: root/include/qemu
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-06-04 19:15:03 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2019-08-27 14:52:45 +0100
commitd953169d4840f312d3b9a54952f4a7ccfcb3b311 (patch)
tree79c227914cced3681a12abfd8c28f143f60419e0 /include/qemu
parentdac03af5d5482ec7ee9c23db467bb7230b33c0d9 (diff)
downloadqemu-d953169d4840f312d3b9a54952f4a7ccfcb3b311.zip
qemu-d953169d4840f312d3b9a54952f4a7ccfcb3b311.tar.gz
qemu-d953169d4840f312d3b9a54952f4a7ccfcb3b311.tar.bz2
util/iov: introduce qemu_iovec_init_extended
Introduce new initialization API, to create requests with padding. Will be used in the following patch. New API uses qemu_iovec_init_buf if resulting io vector has only one element, to avoid extra allocations. So, we need to update qemu_iovec_destroy to support destroying such QIOVs. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-2-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-2-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/iov.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index 48b4598..f3787a0 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -199,6 +199,13 @@ static inline void *qemu_iovec_buf(QEMUIOVector *qiov)
void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov);
+void qemu_iovec_init_extended(
+ QEMUIOVector *qiov,
+ void *head_buf, size_t head_len,
+ QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,
+ void *tail_buf, size_t tail_len);
+void qemu_iovec_init_slice(QEMUIOVector *qiov, QEMUIOVector *source,
+ size_t offset, size_t len);
void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
void qemu_iovec_concat(QEMUIOVector *dst,
QEMUIOVector *src, size_t soffset, size_t sbytes);