util/iov: improve qemu_iovec_is_zero
commitf76889e7b947d896db51be8a4d9c941c2f70365a
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 4 Jun 2019 16:15:04 +0000 (4 19:15 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 27 Aug 2019 13:52:45 +0000 (27 14:52 +0100)
treed233a85f4d166859d08cf38aa556f6297c5f59a6
parentd953169d4840f312d3b9a54952f4a7ccfcb3b311
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 <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-3-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-3-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c
include/qemu/iov.h
util/iov.c