diff options
| author | Cédric Le Goater <clg@redhat.com> | 2025-03-26 08:51:06 +0100 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2025-04-25 09:01:37 +0200 |
| commit | 8140d45b108c2b48960bbfb0a215f586f2d1d9e5 (patch) | |
| tree | 2fbd255fa451917467071ec89e17ef9794477c3a /hw/vfio | |
| parent | 68c07d76359589c9de2aa190d247afca7eb8cb8f (diff) | |
| download | focaccia-qemu-8140d45b108c2b48960bbfb0a215f586f2d1d9e5.tar.gz focaccia-qemu-8140d45b108c2b48960bbfb0a215f586f2d1d9e5.zip | |
vfio: Introduce new files for CPR definitions and declarations
Gather all CPR related declarations into "vfio-cpr.h" to reduce exposure
of VFIO internals in "hw/vfio/vfio-common.h". These were introduced in
commit d9fa4223b30a ("vfio: register container for cpr").
Order file list in meson.build while at it.
Cc: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-22-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio')
| -rw-r--r-- | hw/vfio/container.c | 1 | ||||
| -rw-r--r-- | hw/vfio/cpr.c | 1 | ||||
| -rw-r--r-- | hw/vfio/iommufd.c | 1 | ||||
| -rw-r--r-- | hw/vfio/meson.build | 2 | ||||
| -rw-r--r-- | hw/vfio/vfio-cpr.h | 15 |
5 files changed, 19 insertions, 1 deletions
diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 3fdd5dac37..c55fe8e4be 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -34,6 +34,7 @@ #include "pci.h" #include "hw/vfio/vfio-container.h" #include "vfio-helpers.h" +#include "vfio-cpr.h" #define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio" diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c index 3d1c8d290a..696987006b 100644 --- a/hw/vfio/cpr.c +++ b/hw/vfio/cpr.c @@ -10,6 +10,7 @@ #include "migration/misc.h" #include "qapi/error.h" #include "system/runstate.h" +#include "vfio-cpr.h" static int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 85b5a8146a..a5bd189a86 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -27,6 +27,7 @@ #include "pci.h" #include "vfio-iommufd.h" #include "vfio-helpers.h" +#include "vfio-cpr.h" #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \ TYPE_HOST_IOMMU_DEVICE_IOMMUFD "-vfio" diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 60caa36617..1f89bd28c1 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -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( diff --git a/hw/vfio/vfio-cpr.h b/hw/vfio/vfio-cpr.h new file mode 100644 index 0000000000..134b83a624 --- /dev/null +++ b/hw/vfio/vfio-cpr.h @@ -0,0 +1,15 @@ +/* + * VFIO CPR + * + * Copyright (c) 2025 Oracle and/or its affiliates. + * + * 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 */ |