Put buffer can be async as long as the flush happens before the buffer will
be recycled / reused. Do it for postcopy package data. Quick measurement
shows a small VM the time to push / flush the package shrinks from 91us to
38us.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Tested-by: Lukas Straub <lukasstraub2@web.de>
Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-14-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
trace_qemu_savevm_send_packaged();
qemu_savevm_command_send(f, MIG_CMD_PACKAGED, 4, (uint8_t *)&tmp);
- qemu_put_buffer(f, buf, len);
+ /* We can use async put because the qemufile will be flushed right away */
+ qemu_put_buffer_async(f, buf, len, false);
qemu_fflush(f);
return 0;