migration/multifd: multifd_send_prepare_header()
commit452b205702335ddd45554aaf0eb37baf50bdfa00
authorPeter Xu <peterx@redhat.com>
Fri, 2 Feb 2024 10:28:46 +0000 (2 18:28 +0800)
committerPeter Xu <peterx@redhat.com>
Mon, 5 Feb 2024 06:42:10 +0000 (5 14:42 +0800)
tree9c8eefe97fac0199e76864a2b2ee5c2e104a1647
parent8a9ef1738037e1d1132f9e1bd3e2f1102bde719f
migration/multifd: multifd_send_prepare_header()

Introduce a helper multifd_send_prepare_header() to setup the header packet
for multifd sender.

It's fine to setup the IOV[0] _before_ send_prepare() because the packet
buffer is already ready, even if the content is to be filled in.

With this helper, we can already slightly clean up the zero copy path.

Note that I explicitly put it into multifd.h, because I want it inlined
directly into multifd*.c where necessary later.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240202102857.110210-13-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/multifd.c
migration/multifd.h