mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
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 d9fa4223b3
("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>
This commit is contained in:
parent
68c07d7635
commit
8140d45b10
6 changed files with 19 additions and 4 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
#include "hw/vfio/vfio-container.h"
|
#include "hw/vfio/vfio-container.h"
|
||||||
#include "vfio-helpers.h"
|
#include "vfio-helpers.h"
|
||||||
|
#include "vfio-cpr.h"
|
||||||
|
|
||||||
#define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio"
|
#define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio"
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "migration/misc.h"
|
#include "migration/misc.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "system/runstate.h"
|
#include "system/runstate.h"
|
||||||
|
#include "vfio-cpr.h"
|
||||||
|
|
||||||
static int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier,
|
static int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier,
|
||||||
MigrationEvent *e, Error **errp)
|
MigrationEvent *e, Error **errp)
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
#include "vfio-iommufd.h"
|
#include "vfio-iommufd.h"
|
||||||
#include "vfio-helpers.h"
|
#include "vfio-helpers.h"
|
||||||
|
#include "vfio-cpr.h"
|
||||||
|
|
||||||
#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \
|
#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \
|
||||||
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_AMD_XGBE', if_true: files('amd-xgbe.c'))
|
||||||
system_ss.add(when: 'CONFIG_VFIO', if_true: files(
|
system_ss.add(when: 'CONFIG_VFIO', if_true: files(
|
||||||
'container-base.c',
|
'container-base.c',
|
||||||
|
'cpr.c',
|
||||||
'device.c',
|
'device.c',
|
||||||
'migration.c',
|
'migration.c',
|
||||||
'migration-multifd.c',
|
'migration-multifd.c',
|
||||||
'cpr.c',
|
|
||||||
'region.c',
|
'region.c',
|
||||||
))
|
))
|
||||||
system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
|
system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files(
|
||||||
|
|
15
hw/vfio/vfio-cpr.h
Normal file
15
hw/vfio/vfio-cpr.h
Normal file
|
@ -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 */
|
|
@ -129,9 +129,6 @@ bool vfio_attach_device(char *name, VFIODevice *vbasedev,
|
||||||
void vfio_detach_device(VFIODevice *vbasedev);
|
void vfio_detach_device(VFIODevice *vbasedev);
|
||||||
VFIODevice *vfio_get_vfio_device(Object *obj);
|
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;
|
typedef QLIST_HEAD(VFIODeviceList, VFIODevice) VFIODeviceList;
|
||||||
extern VFIODeviceList vfio_device_list;
|
extern VFIODeviceList vfio_device_list;
|
||||||
extern const MemoryListener vfio_memory_listener;
|
extern const MemoryListener vfio_memory_listener;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue