vfio/common: Add VFIOBitmap and alloc function
commit725ccd7e419d640ebee4c3869235efea070764de
authorAvihai Horon <avihaih@nvidia.com>
Tue, 7 Mar 2023 12:54:39 +0000 (7 12:54 +0000)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 7 Mar 2023 14:20:32 +0000 (7 07:20 -0700)
tree328839532edf51148dc11c5bf53ad59887539b18
parent236e0a45f507f1e4130fce9c8edb615bf5e0b00e
vfio/common: Add VFIOBitmap and alloc function

There are already two places where dirty page bitmap allocation and
calculations are done in open code.

To avoid code duplication, introduce VFIOBitmap struct and corresponding
alloc function and use them where applicable.

Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/r/20230307125450.62409-5-joao.m.martins@oracle.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c