From 8d82bd5f20fac5d8b4dab510d2294e076a6dd93d Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Tue, 5 Oct 2021 13:54:26 +0100 Subject: make migration state callback optionally asynchronous (#608) Some devices need the migration state callback to be asynchronous. The simplest way to implement this is to require from the callback to return -1 and set errno to EBUSY, not process any other new messages (vfu_ctx_run returns -1 and sets errno to EBUSY), and provide a way to the user to complete migration (vfu_migr_done). Signed-off-by: Thanos Makatos Reviewed-by: John Levon Reviewed-by: Swapnil Ingle --- lib/private.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/private.h') diff --git a/lib/private.h b/lib/private.h index 93a354b..05d2fa4 100644 --- a/lib/private.h +++ b/lib/private.h @@ -169,6 +169,8 @@ struct vfu_ctx { size_t client_max_data_xfer_size; struct migration *migration; + bool migr_trans_pending; + vfu_msg_t *migr_trans_msg; uint32_t irq_count[VFU_DEV_NUM_IRQS]; vfu_irqs_t *irqs; -- cgit v1.1