From f76889e7b947d896db51be8a4d9c941c2f70365a Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Tue, 4 Jun 2019 19:15:04 +0300 Subject: util/iov: improve qemu_iovec_is_zero We'll need to check a part of qiov soon, so implement it now. Optimization with align down to 4 * sizeof(long) is dropped due to: 1. It is strange: it aligns length of the buffer, but where is a guarantee that buffer pointer is aligned itself? 2. buffer_is_zero() is a better place for optimizations and it has them. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-3-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-3-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi --- include/qemu/iov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/qemu') diff --git a/include/qemu/iov.h b/include/qemu/iov.h index f3787a0..29957c8 100644 --- a/include/qemu/iov.h +++ b/include/qemu/iov.h @@ -212,7 +212,7 @@ void qemu_iovec_concat(QEMUIOVector *dst, size_t qemu_iovec_concat_iov(QEMUIOVector *dst, struct iovec *src_iov, unsigned int src_cnt, size_t soffset, size_t sbytes); -bool qemu_iovec_is_zero(QEMUIOVector *qiov); +bool qemu_iovec_is_zero(QEMUIOVector *qiov, size_t qiov_offeset, size_t bytes); void qemu_iovec_destroy(QEMUIOVector *qiov); void qemu_iovec_reset(QEMUIOVector *qiov); size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset, -- cgit v1.1