Lines Matching refs:qiov
261 void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) in qemu_iovec_init() argument
263 qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec)); in qemu_iovec_init()
264 qiov->niov = 0; in qemu_iovec_init()
265 qiov->nalloc = alloc_hint; in qemu_iovec_init()
266 qiov->size = 0; in qemu_iovec_init()
269 void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov) in qemu_iovec_init_external() argument
273 qiov->iov = iov; in qemu_iovec_init_external()
274 qiov->niov = niov; in qemu_iovec_init_external()
275 qiov->nalloc = -1; in qemu_iovec_init_external()
276 qiov->size = 0; in qemu_iovec_init_external()
278 qiov->size += iov[i].iov_len; in qemu_iovec_init_external()
281 void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len) in qemu_iovec_add() argument
283 assert(qiov->nalloc != -1); in qemu_iovec_add()
285 if (qiov->niov == qiov->nalloc) { in qemu_iovec_add()
286 qiov->nalloc = 2 * qiov->nalloc + 1; in qemu_iovec_add()
287 qiov->iov = g_realloc(qiov->iov, qiov->nalloc * sizeof(struct iovec)); in qemu_iovec_add()
289 qiov->iov[qiov->niov].iov_base = base; in qemu_iovec_add()
290 qiov->iov[qiov->niov].iov_len = len; in qemu_iovec_add()
291 qiov->size += len; in qemu_iovec_add()
292 ++qiov->niov; in qemu_iovec_add()
345 void qemu_iovec_destroy(QEMUIOVector *qiov) in qemu_iovec_destroy() argument
347 assert(qiov->nalloc != -1); in qemu_iovec_destroy()
349 qemu_iovec_reset(qiov); in qemu_iovec_destroy()
350 g_free(qiov->iov); in qemu_iovec_destroy()
351 qiov->nalloc = 0; in qemu_iovec_destroy()
352 qiov->iov = NULL; in qemu_iovec_destroy()
355 void qemu_iovec_reset(QEMUIOVector *qiov) in qemu_iovec_reset() argument
357 assert(qiov->nalloc != -1); in qemu_iovec_reset()
359 qiov->niov = 0; in qemu_iovec_reset()
360 qiov->size = 0; in qemu_iovec_reset()
363 size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset, in qemu_iovec_to_buf() argument
366 return iov_to_buf(qiov->iov, qiov->niov, offset, buf, bytes); in qemu_iovec_to_buf()
369 size_t qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset, in qemu_iovec_from_buf() argument
372 return iov_from_buf(qiov->iov, qiov->niov, offset, buf, bytes); in qemu_iovec_from_buf()
375 size_t qemu_iovec_memset(QEMUIOVector *qiov, size_t offset, in qemu_iovec_memset() argument
378 return iov_memset(qiov->iov, qiov->niov, offset, fillc, bytes); in qemu_iovec_memset()