diff options
| author | Stefan Hajnoczi | 2020-09-17 11:44:53 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2020-09-23 14:41:58 +0200 |
| commit | 9dd6f7c28eaa7d001a526d51c74bbf89d5402b8c (patch) | |
| tree | 5ce0c2924bf4607bbdbc892eb806b37971c52dff /include/hw/virtio | |
| parent | virtio: add vhost-user-fs-ccw device (diff) | |
| download | qemu-9dd6f7c28eaa7d001a526d51c74bbf89d5402b8c.tar.gz qemu-9dd6f7c28eaa7d001a526d51c74bbf89d5402b8c.tar.xz qemu-9dd6f7c28eaa7d001a526d51c74bbf89d5402b8c.zip | |
util/iov: add iov_discard_undo()
The iov_discard_front/back() operations are useful for parsing iovecs
but they modify the array elements. If the original array is needed
after parsing finishes there is currently no way to restore it.
Although g_memdup() can be used before performing destructive
iov_discard_front/back() operations, this is inefficient.
Introduce iov_discard_undo() to restore the array to the state prior to
an iov_discard_front/back() operation.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200917094455.822379-2-stefanha@redhat.com>
Diffstat (limited to 'include/hw/virtio')
0 files changed, 0 insertions, 0 deletions
