Stefan Hajnoczi 9dd6f7c28e 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>
2020-09-23 13:41:58 +01:00
..
2020-09-18 10:44:47 +01:00
2020-09-08 07:17:09 +02:00
2020-09-16 08:41:06 +02:00
2020-09-17 20:40:59 +01:00
2020-08-21 06:30:45 -04:00
2020-09-10 10:46:46 +01:00
2020-09-23 13:41:58 +01:00
2020-09-08 11:43:16 +02:00