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 /include/vfio-user.h | |
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 'include/vfio-user.h')
-rw-r--r-- | include/vfio-user.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/vfio-user.h b/include/vfio-user.h index ef3159a..71112ef 100644 --- a/include/vfio-user.h +++ b/include/vfio-user.h @@ -155,7 +155,18 @@ struct vfio_user_irq_info { uint32_t subindex; } __attribute__((packed)); -/* based on struct vfio_iommu_type1_dirty_bitmap_get */ +/* Analogous to vfio_iommu_type1_dirty_bitmap. */ +struct vfio_user_dirty_pages { + uint32_t argsz; +#ifndef VFIO_IOMMU_DIRTY_PAGES_FLAG_START +#define VFIO_IOMMU_DIRTY_PAGES_FLAG_START (1 << 0) +#define VFIO_IOMMU_DIRTY_PAGES_FLAG_STOP (1 << 1) +#define VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP (1 << 2) +#endif + uint32_t flags; +} __attribute__((packed)); + +/* Analogous to struct vfio_iommu_type1_dirty_bitmap_get. */ struct vfio_user_bitmap_range { uint64_t iova; uint64_t size; @@ -200,15 +211,6 @@ struct vfio_device_migration_info { }; #endif /* not a RHEL kernel */ -struct vfio_iommu_type1_dirty_bitmap { - __u32 argsz; - __u32 flags; -#define VFIO_IOMMU_DIRTY_PAGES_FLAG_START (1 << 0) -#define VFIO_IOMMU_DIRTY_PAGES_FLAG_STOP (1 << 1) -#define VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP (1 << 2) - __u8 data[]; -}; - #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) */ #ifdef __cplusplus |