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-01-06 18:41:32 +04:00
2019-08-16 13:31:52 +02:00
2020-08-28 10:02:47 +01:00
2020-09-23 13:41:58 +01:00
2020-02-19 11:17:40 +01:00
2020-09-01 12:07:52 +02:00
2019-09-11 08:46:17 +02:00
2020-07-07 14:54:29 +02:00
2018-09-26 08:55:54 -07:00
2019-04-18 22:18:59 +02:00
2019-08-16 13:31:52 +02:00
2020-02-22 08:26:47 +00:00
2020-09-16 08:41:06 +02:00
2018-12-20 10:29:08 +01:00