diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-10 16:21:28 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-18 08:47:10 +0200 |
commit | 519661ee6514f22b1e289b1c4c8c076378bc4202 (patch) | |
tree | 368b6cb11f0f15db444c3708ee598144a97809df /util/iov.c | |
parent | 1016b239c5c7b54a02fbd3121f68fb264a42d0a1 (diff) | |
download | hqemu-519661ee6514f22b1e289b1c4c8c076378bc4202.zip hqemu-519661ee6514f22b1e289b1c4c8c076378bc4202.tar.gz |
util: add return value to qemu_iovec_concat_iov
This will be necessary later to recognize the case where a
request has both dataout and datain.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/iov.c')
-rw-r--r-- | util/iov.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -295,15 +295,15 @@ void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len) * of src". * Only vector pointers are processed, not the actual data buffers. */ -void qemu_iovec_concat_iov(QEMUIOVector *dst, - struct iovec *src_iov, unsigned int src_cnt, - size_t soffset, size_t sbytes) +size_t qemu_iovec_concat_iov(QEMUIOVector *dst, + struct iovec *src_iov, unsigned int src_cnt, + size_t soffset, size_t sbytes) { int i; size_t done; if (!sbytes) { - return; + return 0; } assert(dst->nalloc != -1); for (i = 0, done = 0; done < sbytes && i < src_cnt; i++) { @@ -317,6 +317,8 @@ void qemu_iovec_concat_iov(QEMUIOVector *dst, } } assert(soffset == 0); /* offset beyond end of src */ + + return done; } /* |