summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2020-12-11 19:39:20 +0100
committerEric Blake2021-02-03 15:00:33 +0100
commit4c002cef0e9abe7135d7916c51abce47f7fc1ee2 (patch)
treecd2bfc6b897f859e5c26f9c3b761c540a20f97cf /include/qemu
parentblock: refactor bdrv_check_request: add errp (diff)
downloadqemu-4c002cef0e9abe7135d7916c51abce47f7fc1ee2.tar.gz
qemu-4c002cef0e9abe7135d7916c51abce47f7fc1ee2.tar.xz
qemu-4c002cef0e9abe7135d7916c51abce47f7fc1ee2.zip
util/iov: make qemu_iovec_init_extended() honest
Actually, we can't extend the io vector in all cases. Handle possible MAX_IOV and size_t overflows. For now add assertion to callers (actually they rely on success anyway) and fix them in the following patch. Add also some additional good assertions to qemu_iovec_init_slice() while being here. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201211183934.169161-3-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/iov.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index b6b283a5e5..9330746680 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -222,7 +222,7 @@ 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(
+int qemu_iovec_init_extended(
QEMUIOVector *qiov,
void *head_buf, size_t head_len,
QEMUIOVector *mid_qiov, size_t mid_offset, size_t mid_len,