new file mode 100644
@@ -0,0 +1,15 @@
+/*
+ * VFIO display
+ *
+ * Copyright Red Hat, Inc. 2025
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_VFIO_CPR_H
+#define HW_VFIO_CPR_H
+
+bool vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp);
+void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer);
+
+#endif /* HW_VFIO_CPR_H */
@@ -128,9 +128,6 @@ bool vfio_attach_device(char *name, VFIODevice *vbasedev,
void vfio_detach_device(VFIODevice *vbasedev);
VFIODevice *vfio_get_vfio_device(Object *obj);
-bool vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp);
-void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer);
-
typedef QLIST_HEAD(VFIODeviceList, VFIODevice) VFIODeviceList;
extern VFIODeviceList vfio_device_list;
extern const MemoryListener vfio_memory_listener;
@@ -34,6 +34,7 @@
#include "pci.h"
#include "hw/vfio/vfio-container.h"
#include "helpers.h"
+#include "cpr.h"
#define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio"
@@ -10,6 +10,7 @@
#include "migration/misc.h"
#include "qapi/error.h"
#include "system/runstate.h"
+#include "cpr.h"
static int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier,
MigrationEvent *e, Error **errp)
@@ -28,6 +28,7 @@
#include "migration.h"
#include "iommufd.h"
#include "helpers.h"
+#include "cpr.h"
#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \
TYPE_HOST_IOMMU_DEVICE_IOMMUFD "-vfio"
@@ -20,10 +20,10 @@ system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c'))
system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c'))
system_ss.add(when: 'CONFIG_VFIO', if_true: files(
'container-base.c',
+ 'cpr.c',
'device.c',
'migration.c',
'migration-multifd.c',
- 'cpr.c',
'region.c',
))
system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
Gather all CPR related declarations into "cpr.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Order file list in meson.build while at it. Signed-off-by: Cédric Le Goater <clg@redhat.com> --- hw/vfio/cpr.h | 15 +++++++++++++++ include/hw/vfio/vfio-common.h | 3 --- hw/vfio/container.c | 1 + hw/vfio/cpr.c | 1 + hw/vfio/iommufd.c | 1 + hw/vfio/meson.build | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 hw/vfio/cpr.h