qemu/include/hw/vfio/vfio-container.h
Cédric Le Goater aa90d775f0 vfio: Introduce a new header file for VFIOcontainer declarations
Gather all VFIOcontainer related declarations into
"hw/vfio/vfio-container.h" to reduce exposure of VFIO internals in
"hw/vfio/vfio-common.h". These declarations were initially introduced
in commit 65501a745d ("vfio: vfio-pci device assignment driver").
They are made available externally for PPC and s390x.

Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-12-clg@redhat.com
Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-13-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-04-25 09:01:37 +02:00

36 lines
856 B
C

/*
* VFIO container
*
* Copyright Red Hat, Inc. 2025
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef HW_VFIO_CONTAINER_H
#define HW_VFIO_CONTAINER_H
#include "hw/vfio/vfio-container-base.h"
typedef struct VFIOContainer VFIOContainer;
typedef struct VFIODevice VFIODevice;
typedef struct VFIOGroup {
int fd;
int groupid;
VFIOContainer *container;
QLIST_HEAD(, VFIODevice) device_list;
QLIST_ENTRY(VFIOGroup) next;
QLIST_ENTRY(VFIOGroup) container_next;
bool ram_block_discard_allowed;
} VFIOGroup;
typedef struct VFIOContainer {
VFIOContainerBase bcontainer;
int fd; /* /dev/vfio/vfio, empowered by the attached groups */
unsigned iommu_type;
QLIST_HEAD(, VFIOGroup) group_list;
} VFIOContainer;
OBJECT_DECLARE_SIMPLE_TYPE(VFIOContainer, VFIO_IOMMU_LEGACY);
#endif /* HW_VFIO_CONTAINER_H */