mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-21 09:02:00 -06:00
vfio: Move vfio_device_state_is_running/precopy() into migration.c
These routines are migration related. Move their declaration and implementation under the migration files. Reviewed-by: Prasad Pandit <pjp@fedoraproject.org> Reviewed-by: John Levon <john.levon@nutanix.com> Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-8-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
b553d2c414
commit
eb6caa7916
4 changed files with 18 additions and 19 deletions
|
@ -66,22 +66,6 @@ int vfio_kvm_device_fd = -1;
|
|||
*/
|
||||
|
||||
|
||||
bool vfio_device_state_is_running(VFIODevice *vbasedev)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_RUNNING ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_RUNNING_P2P;
|
||||
}
|
||||
|
||||
bool vfio_device_state_is_precopy(VFIODevice *vbasedev)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_PRE_COPY ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_PRE_COPY_P2P;
|
||||
}
|
||||
|
||||
static bool vfio_devices_all_device_dirty_tracking_started(
|
||||
const VFIOContainerBase *bcontainer)
|
||||
{
|
||||
|
|
|
@ -1220,3 +1220,19 @@ void vfio_migration_exit(VFIODevice *vbasedev)
|
|||
|
||||
migrate_del_blocker(&vbasedev->migration_blocker);
|
||||
}
|
||||
|
||||
bool vfio_device_state_is_running(VFIODevice *vbasedev)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_RUNNING ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_RUNNING_P2P;
|
||||
}
|
||||
|
||||
bool vfio_device_state_is_precopy(VFIODevice *vbasedev)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_PRE_COPY ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_PRE_COPY_P2P;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ typedef struct VFIOMigration {
|
|||
|
||||
bool vfio_migration_realize(VFIODevice *vbasedev, Error **errp);
|
||||
void vfio_migration_exit(VFIODevice *vbasedev);
|
||||
bool vfio_device_state_is_running(VFIODevice *vbasedev);
|
||||
bool vfio_device_state_is_precopy(VFIODevice *vbasedev);
|
||||
int vfio_save_device_config_state(QEMUFile *f, void *opaque, Error **errp);
|
||||
int vfio_load_device_config_state(QEMUFile *f, void *opaque);
|
||||
|
||||
|
|
|
@ -252,9 +252,6 @@ extern VFIODeviceList vfio_device_list;
|
|||
extern const MemoryListener vfio_memory_listener;
|
||||
extern int vfio_kvm_device_fd;
|
||||
|
||||
bool vfio_device_state_is_running(VFIODevice *vbasedev);
|
||||
bool vfio_device_state_is_precopy(VFIODevice *vbasedev);
|
||||
|
||||
#ifdef CONFIG_LINUX
|
||||
int vfio_get_region_info(VFIODevice *vbasedev, int index,
|
||||
struct vfio_region_info **info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue