aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-06-01 11:53:25 +0100
committerGitHub <noreply@github.com>2021-06-01 11:53:25 +0100
commit9ed077601004c5c72665010b893ace6d8709e244 (patch)
tree73d9db59d12ebec371cd59b4fd7d9b3c19de2740 /lib/dma.c
parentd69581a45fa1c720cb796eb829259739c0ee2c2f (diff)
downloadlibvfio-user-9ed077601004c5c72665010b893ace6d8709e244.zip
libvfio-user-9ed077601004c5c72665010b893ace6d8709e244.tar.gz
libvfio-user-9ed077601004c5c72665010b893ace6d8709e244.tar.bz2
fixes for VFIO_USER_DIRTY_PAGES (#537)
- we should only accept one range, not multiple ones - clearly define and implement argsz behaviour - we need to check if migration is configured - add proper test coverage; move existing testing to python Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/dma.c b/lib/dma.c
index 125c4c8..32014f0 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -265,8 +265,8 @@ get_bitmap_size(size_t region_size, size_t pgsize)
if (region_size < pgsize) {
return ERROR_INT(EINVAL);
}
- size_t nr_pages = (region_size / pgsize) + (region_size % pgsize != 0);
- return ROUND_UP(nr_pages, sizeof(uint64_t) * CHAR_BIT) / CHAR_BIT;
+
+ return _get_bitmap_size(region_size, pgsize);
}
static int
@@ -544,8 +544,8 @@ dma_controller_dirty_page_get(dma_controller_t *dma, vfu_dma_addr_t addr,
}
/*
- * FIXME they must be equal because this is how much data the client
- * expects to receive.
+ * They must be equal because this is how much data the client expects to
+ * receive.
*/
if (size != (size_t)bitmap_size) {
vfu_log(dma->vfu_ctx, LOG_ERR, "bad bitmap size %ld != %ld", size,