diff options
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r-- | lib/libvfio-user.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index c45ceeb..ac04d3b 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -2014,10 +2014,13 @@ vfu_setup_device_migration_callbacks(vfu_ctx_t *vfu_ctx, } static void -quiesce_check_allowed(vfu_ctx_t *vfu_ctx) +quiesce_check_allowed(vfu_ctx_t *vfu_ctx, const char *func) { - if (!(vfu_ctx->in_cb != CB_NONE || vfu_ctx->quiesce == NULL || !vfu_ctx->quiesced)) { - vfu_log(vfu_ctx, LOG_ERR, "illegal function in quiesced state"); + if (!(vfu_ctx->in_cb != CB_NONE || + vfu_ctx->quiesce == NULL || + !vfu_ctx->quiesced)) { + vfu_log(vfu_ctx, LOG_ERR, + "illegal function %s() in quiesced state", func); #ifdef DEBUG abort(); #endif @@ -2034,7 +2037,7 @@ vfu_addr_to_sgl(vfu_ctx_t *vfu_ctx, vfu_dma_addr_t dma_addr, return ERROR_INT(EINVAL); } - quiesce_check_allowed(vfu_ctx); + quiesce_check_allowed(vfu_ctx, __func__); return dma_addr_to_sgl(vfu_ctx->dma, dma_addr, len, sgl, max_nr_sgs, prot); } @@ -2047,7 +2050,7 @@ vfu_sgl_get(vfu_ctx_t *vfu_ctx, dma_sg_t *sgl, struct iovec *iov, size_t cnt, return ERROR_INT(EINVAL); } - quiesce_check_allowed(vfu_ctx); + quiesce_check_allowed(vfu_ctx, __func__); return dma_sgl_get(vfu_ctx->dma, sgl, iov, cnt); } @@ -2059,7 +2062,7 @@ vfu_sgl_mark_dirty(vfu_ctx_t *vfu_ctx, dma_sg_t *sgl, size_t cnt) return; } - quiesce_check_allowed(vfu_ctx); + quiesce_check_allowed(vfu_ctx, __func__); return dma_sgl_mark_dirty(vfu_ctx->dma, sgl, cnt); } @@ -2072,7 +2075,7 @@ vfu_sgl_put(vfu_ctx_t *vfu_ctx, dma_sg_t *sgl, return; } - quiesce_check_allowed(vfu_ctx); + quiesce_check_allowed(vfu_ctx, __func__); return dma_sgl_put(vfu_ctx->dma, sgl, cnt); } |