diff options
author | John Levon <john.levon@nutanix.com> | 2021-06-01 11:53:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 11:53:25 +0100 |
commit | 9ed077601004c5c72665010b893ace6d8709e244 (patch) | |
tree | 73d9db59d12ebec371cd59b4fd7d9b3c19de2740 /lib/dma.c | |
parent | d69581a45fa1c720cb796eb829259739c0ee2c2f (diff) | |
download | libvfio-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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, |