diff options
author | John Levon <john.levon@nutanix.com> | 2022-06-09 13:32:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-09 13:32:49 +0100 |
commit | 9a5124df49efed644f0db7e573ebd0367df480cd (patch) | |
tree | 479b95fe2ef9eeda2997e16ef69ec10d60275180 /lib | |
parent | a767ebd126157c4aa55ff0fe5786681507fb7ea8 (diff) | |
download | libvfio-user-9a5124df49efed644f0db7e573ebd0367df480cd.zip libvfio-user-9a5124df49efed644f0db7e573ebd0367df480cd.tar.gz libvfio-user-9a5124df49efed644f0db7e573ebd0367df480cd.tar.bz2 |
report function in quiesce_check_allowed() (#693)
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'lib')
-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); } |