aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2022-03-07 09:42:05 +0000
committerGitHub <noreply@github.com>2022-03-07 09:42:05 +0000
commita8d452e8e384be847377ab41a7ee19d4da71fde3 (patch)
tree53bf43c651e6f7af7b3add7034d197c6f6276dc6 /lib/dma.c
parent6bb0c5c7747499a0463c78a97591a64d1324aba7 (diff)
downloadlibvfio-user-a8d452e8e384be847377ab41a7ee19d4da71fde3.zip
libvfio-user-a8d452e8e384be847377ab41a7ee19d4da71fde3.tar.gz
libvfio-user-a8d452e8e384be847377ab41a7ee19d4da71fde3.tar.bz2
check for allowed operations in quiesce state (#647)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dma.c b/lib/dma.c
index 26c5758..3eb23f9 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -167,7 +167,9 @@ MOCK_DEFINE(dma_controller_remove_region)(dma_controller_t *dma,
}
if (dma_unregister != NULL) {
+ dma->vfu_ctx->in_cb = CB_DMA_UNREGISTER;
dma_unregister(data, &region->info);
+ dma->vfu_ctx->in_cb = CB_NONE;
}
assert(region->refcnt == 0);
@@ -203,7 +205,9 @@ dma_controller_remove_all_regions(dma_controller_t *dma,
region->info.mapping.iov_base, iov_end(&region->info.mapping));
if (dma_unregister != NULL) {
+ dma->vfu_ctx->in_cb = CB_DMA_UNREGISTER;
dma_unregister(data, &region->info);
+ dma->vfu_ctx->in_cb = CB_NONE;
}
if (region->info.vaddr != NULL) {