mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
vfio/pci: Extract mdev check into an helper
In preparation to skip initialization of the HostIOMMUDevice for mdev, extract the checks that validate if a device is an mdev into helpers. A vfio_device_is_mdev() is created, and subsystems consult VFIODevice::mdev to check if it's mdev or not. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com>
This commit is contained in:
parent
07321a6d08
commit
13e522f644
3 changed files with 19 additions and 9 deletions
|
@ -116,6 +116,7 @@ typedef struct VFIODevice {
|
|||
DeviceState *dev;
|
||||
int fd;
|
||||
int type;
|
||||
bool mdev;
|
||||
bool reset_works;
|
||||
bool needs_reset;
|
||||
bool no_mmap;
|
||||
|
@ -231,6 +232,7 @@ void vfio_region_exit(VFIORegion *region);
|
|||
void vfio_region_finalize(VFIORegion *region);
|
||||
void vfio_reset_handler(void *opaque);
|
||||
struct vfio_device_info *vfio_get_device_info(int fd);
|
||||
bool vfio_device_is_mdev(VFIODevice *vbasedev);
|
||||
bool vfio_attach_device(char *name, VFIODevice *vbasedev,
|
||||
AddressSpace *as, Error **errp);
|
||||
void vfio_detach_device(VFIODevice *vbasedev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue